Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f234447f
authored
Oct 26, 2018
by
Belákovics Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified scheduler
parent
0ea5e0fd
Pipeline
#673
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
circle/circle/settings/base.py
+1
-1
circle/manager/scheduler.py
+8
-4
No files found.
circle/circle/settings/base.py
View file @
f234447f
...
...
@@ -576,7 +576,7 @@ SESSION_COOKIE_NAME = "csessid%x" % (((getnode() // 139) ^
MAX_NODE_RAM
=
get_env_variable
(
"MAX_NODE_RAM"
,
1024
)
MAX_NODE_CPU_CORE
=
get_env_variable
(
"MAX_NODE_CPU_CORE"
,
10
)
SCHEDULER_METHOD
=
get_env_variable
(
"SCHEDULER_METHOD"
,
'
random
'
)
SCHEDULER_METHOD
=
get_env_variable
(
"SCHEDULER_METHOD"
,
'
advanced
'
)
# Url to download the client: (e.g. http://circlecloud.org/client/download/)
CLIENT_DOWNLOAD_URL
=
get_env_variable
(
'CLIENT_DOWNLOAD_URL'
,
'http://circlecloud.org/client/download/'
)
...
...
circle/manager/scheduler.py
View file @
f234447f
...
...
@@ -110,6 +110,7 @@ def select_node(instance, nodes):
logger
.
info
(
'select_node:
%
s for
%
s'
,
unicode
(
result
),
unicode
(
instance
))
result
.
time_stamp
=
timezone
.
now
()
result
.
save
()
return
result
...
...
@@ -118,10 +119,11 @@ def sorting_key(node):
"""Determines how valuable a node is for scheduling.
"""
key
=
0
corr
=
last_scheduled_correction_factor
(
node
)
if
free_cpu_time
(
node
)
<
free_ram
(
node
):
key
=
free_cpu_time
(
node
)
key
=
free_cpu_time
(
node
)
*
corr
else
:
key
=
free_ram
(
node
)
key
=
free_ram
(
node
)
*
corr
return
key
def
last_scheduled_correction_factor
(
node
):
...
...
@@ -134,11 +136,13 @@ def last_scheduled_correction_factor(node):
factor
=
0
max_time_diff
=
settings
.
SCHEDULER_TIME_SENSITIVITY_IN_SECONDS
current_time
=
timezone
.
now
()
factor
=
(
current_time
-
node
.
time_stamp
)
/
max_time_diff
time_difference_in_seconds
=
(
current_time
-
node
.
time_stamp
)
.
total_seconds
()
factor
=
time_difference_in_seconds
/
float
(
max_time_diff
)
if
factor
>
1
:
factor
=
1
elif
factor
<
0
:
factor
=
0
factor
=
1
logger
.
info
(
'Scheduler set factor to
%
s'
,
unicode
(
factor
))
return
factor
def
has_traits
(
traits
,
node
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment