Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
371b5e0d
Commit
371b5e0d
authored
8 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs
parent
d785cd38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/dao/hierarchy.py
+15
-13
15 additions, 13 deletions
api/dao/hierarchy.py
api/placer.py
+3
-3
3 additions, 3 deletions
api/placer.py
with
18 additions
and
16 deletions
api/dao/hierarchy.py
+
15
−
13
View file @
371b5e0d
...
...
@@ -150,22 +150,24 @@ def is_session_compliant(session, template):
Return True if container satisfies requirements.
Return False otherwise.
"""
log
.
debug
(
'
entering with {} {}
'
.
format
(
cont
,
reqs
))
for
req_k
,
req_v
in
reqs
.
iteritems
():
if
req_k
==
'
files
'
:
file_reqs
=
req_v
min_count
=
file_reqs
.
pop
(
'
minimum
'
)
count
=
0
for
f
in
cont
.
get
(
'
files
'
,
[]):
if
not
check_cont
(
f
,
req_v
):
# Didn't find a match, on to the next one
continue
else
:
count
+=
1
if
count
>=
min_count
:
break
if
count
<
min_count
:
return
False
for
fr
in
req_v
:
fr_temp
=
fr
.
copy
()
#so subsequent calls don't have their minimum missing
min_count
=
fr_temp
.
pop
(
'
minimum
'
)
count
=
0
for
f
in
cont
.
get
(
'
files
'
,
[]):
if
not
check_cont
(
f
,
fr_temp
):
# Didn't find a match, on to the next one
continue
else
:
count
+=
1
if
count
>=
min_count
:
break
if
count
<
min_count
:
return
False
else
:
if
not
check_req
(
cont
,
req_k
,
req_v
):
...
...
This diff is collapsed.
Click to expand it.
api/placer.py
+
3
−
3
View file @
371b5e0d
...
...
@@ -237,7 +237,8 @@ class EnginePlacer(Placer):
###
# Remove when switch to dmv2 is complete across all gears
if
self
.
context
.
get
(
'
job_id
'
)
and
self
.
metadata
.
get
(
self
.
container_type
):
c_metadata
=
self
.
metadata
.
get
(
self
.
container_type
,
{})
if
self
.
context
.
get
(
'
job_id
'
)
and
c_metadata
and
not
c_metadata
.
get
(
'
files
'
,
[]):
job
=
Job
.
get
(
self
.
context
.
get
(
'
job_id
'
))
input_names
=
[{
'
name
'
:
v
.
name
}
for
k
,
v
in
job
.
inputs
.
iteritems
()]
...
...
@@ -281,8 +282,7 @@ class EnginePlacer(Placer):
saved_file_names
=
[
x
.
get
(
'
name
'
)
for
x
in
self
.
saved
]
for
file_md
in
file_mds
:
if
file_md
[
'
name
'
]
not
in
saved_file_names
:
# Updating file that already exists
hierarchy
.
update_fileinfo
(
self
.
container_type
,
self
.
id_
,
file_md
)
hierarchy
.
update_fileinfo
(
self
.
container_type
+
'
s
'
,
bid
,
file_md
)
# Remove file metadata as it was already updated in process_file_field
for
k
in
self
.
metadata
.
keys
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment