Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
768c00bb
Commit
768c00bb
authored
2 years ago
by
Pierre-Yves David
Browse files
Options
Downloads
Patches
Plain Diff
loop: add an action to upload result
parent
55e9bbc4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scm-perf/poulpe-scheduler-bin/loop
+19
-1
19 additions, 1 deletion
scm-perf/poulpe-scheduler-bin/loop
with
19 additions
and
1 deletion
scm-perf/poulpe-scheduler-bin/loop
+
19
−
1
View file @
768c00bb
#!/usr/bin/env python3
import
hashlib
import
json
import
os
...
...
@@ -4,5 +5,4 @@
import
os
from
pathlib
import
Path
import
shutil
import
subprocess
import
sys
...
...
@@ -6,6 +6,11 @@
import
shutil
import
subprocess
import
sys
import
tempfile
from
pathlib
import
Path
import
poulpe_process_result
as
resultlib
ACTION_FILE
=
"
current.poulpe-schedule
"
...
...
@@ -48,6 +53,8 @@
action_run
(
base_dir
,
*
args
.
split
())
elif
cmd
==
"
AUTOFILL
"
:
action_autofill
(
base_dir
,
*
[
int
(
x
)
for
x
in
args
.
split
()])
elif
cmd
==
"
UPLOAD
"
:
action_upload
(
base_dir
)
else
:
print
(
"
unknown action %s
"
%
action
,
file
=
sys
.
stderr
)
...
...
@@ -146,6 +153,17 @@
_write_all_actions
(
base_dir
,
actions
)
def
action_upload
(
base_dir
):
results
=
resultlib
.
load_results_from_dir
(
base_dir
/
"
results
"
)
print
(
"
upload: gather and upload %d results
"
%
len
(
results
))
dispatched
=
resultlib
.
group_results
(
results
)
with
tempfile
.
NamedTemporaryFile
(
mode
=
"
w
"
)
as
j
:
json
.
dump
(
dispatched
,
j
)
cmd
=
[
base_dir
/
"
bin
"
/
"
upload
"
,
j
.
name
]
subprocess
.
check_call
(
cmd
)
def
loop
(
base_dir
=
"
.
"
):
base_dir
=
Path
(
base_dir
).
resolve
()
_loop
(
base_dir
)
...
...
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