Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prepull_singularity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SASC
prepull_singularity
Commits
c3b7976b
Commit
c3b7976b
authored
5 years ago
by
Cats
Browse files
Options
Downloads
Patches
Plain Diff
fix subprocess run
parent
3a935bde
Branches
suggested_changes
Branches containing commit
No related tags found
1 merge request
!2
Suggested changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prepull_singularity.py
+4
-5
4 additions, 5 deletions
prepull_singularity.py
with
4 additions
and
5 deletions
prepull_singularity.py
+
4
−
5
View file @
c3b7976b
...
...
@@ -60,10 +60,10 @@ def pullimage(image: str, maxattempts: int = 3, prefix: str = "docker://", singu
stderr
=
[]
while
rc
!=
0
and
attempt
<
maxattempts
:
attempt
+=
1
with
subprocess
.
run
(
command
,
capture_output
=
True
)
as
proc
:
stdout
.
append
(
proc
.
stdout
.
read
()
)
stderr
.
append
(
proc
.
stderr
.
read
()
)
rc
=
proc
.
returncode
proc
=
subprocess
.
run
(
command
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
.
append
(
proc
.
stdout
)
stderr
.
append
(
proc
.
stderr
)
rc
=
proc
.
returncode
if
rc
==
0
:
coloredprint
(
"
Successfully pulled
'
{}{}
'
in {} attempt{}
"
.
format
(
prefix
,
image
,
attempt
,
"
s
"
if
attempt
>
1
else
""
),
...
...
@@ -109,7 +109,6 @@ def main():
args
=
parsearguments
()
with
args
.
input
.
open
(
"
r
"
)
as
imagesfile
:
images
=
yaml
.
load
(
imagesfile
,
Loader
=
yaml
.
FullLoader
)
print
(
images
)
if
type
(
images
)
==
dict
:
images
=
images
.
values
()
successes
=
[]
...
...
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