Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
8aa976ca
Commit
8aa976ca
authored
May 22, 2024
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: reduce the risk of always allocating on the same node
parent
f6f4ab05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
...ateItem/portal_skins/slapos_cloud/Person_findPartition.py
+7
-3
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
View file @
8aa976ca
...
...
@@ -171,7 +171,7 @@ if test_mode:
SQL_WINDOW_SIZE
=
50
# fetch at mot 50 random Compute Partitions, and check if they are ok
# fetch at mo
s
t 50 random Compute Partitions, and check if they are ok
isTransitionPossible
=
portal
.
portal_workflow
.
isTransitionPossible
result_count
=
portal
.
portal_catalog
.
countResults
(
**
query_kw
)[
0
][
0
]
offset
=
max
(
0
,
result_count
-
1
)
...
...
@@ -180,8 +180,12 @@ if offset >= SQL_WINDOW_SIZE:
else
:
limit
=
(
0
,
SQL_WINDOW_SIZE
)
for
compute_partition_candidate
in
portal
.
portal_catalog
(
limit
=
limit
,
**
query_kw
):
compute_partition_candidate_list
=
[
x
for
x
in
portal
.
portal_catalog
(
limit
=
limit
,
**
query_kw
)]
# reduce risk of always allocating on the same node
# (in case of slave instance for example)
random
.
shuffle
(
compute_partition_candidate_list
)
for
compute_partition_candidate
in
compute_partition_candidate_list
:
compute_partition_candidate
=
compute_partition_candidate
.
getObject
()
if
compute_partition_candidate
.
getParentValue
().
getCapacityScope
()
==
"close"
:
...
...
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