Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fireatlas_nrt
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gcorradini
fireatlas_nrt
Commits
fcb5e495
Commit
fcb5e495
authored
1 year ago
by
ranchodeluxe
Browse files
Options
Downloads
Patches
Plain Diff
make it the exact same
parent
9f74aa7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!93
make it the exact same
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
maap_runtime/submit-dps-job.py
+5
-2
5 additions, 2 deletions
maap_runtime/submit-dps-job.py
with
5 additions
and
2 deletions
maap_runtime/submit-dps-job.py
+
5
−
2
View file @
fcb5e495
...
...
@@ -10,13 +10,15 @@ parser.add_argument("github_ref", type=str, help="the git branch or tag to run a
parser
.
add_argument
(
"
username
"
,
type
=
str
,
help
=
"
the username who submits the job
"
)
parser
.
add_argument
(
"
queue
"
,
type
=
str
,
help
=
"
the queue where we want the job to run
"
)
parser
.
add_argument
(
"
maap_environment
"
,
type
=
str
,
help
=
"
the MAAP image environment to run the job inside of
"
)
parser
.
add_argument
(
"
--params
"
,
type
=
str
,
help
=
"
an optional json serialized
string of
additonal params to
"
parser
.
add_argument
(
"
--params
"
,
type
=
str
,
help
=
"
an optional
string of
json serialized addit
i
onal params to
"
"
pass to the job
"
,
default
=
"
{}
"
)
def
submit_job
(
algo_id
,
github_ref
,
username
,
queue
,
maap_environment
,
params
=
{}
):
def
submit_job
(
algo_id
,
github_ref
,
username
,
queue
,
maap_environment
,
params
=
None
):
maap
=
MAAP
(
maap_host
=
'
api.maap-project.org
'
)
if
params
is
None
:
params
=
{}
return
maap
.
submitJob
(
identifier
=
f
"
job-
{
algo_id
}
:
{
github_ref
}
"
,
algo_id
=
f
"
{
algo_id
}
"
,
# MAAP seems to expect `submitJob` to identify things this way
...
...
@@ -32,6 +34,7 @@ if __name__ == '__main__':
deserialized_params
=
json
.
loads
(
args
.
params
)
pargs
=
[
args
.
algo
,
args
.
github_ref
,
args
.
username
,
args
.
queue
,
args
.
maap_environment
]
print
(
f
"
[ ARGS ]:
{
pargs
}
"
)
print
(
f
"
[ KWARGS ]:
{
deserialized_params
}
"
)
response
=
submit_job
(
*
pargs
,
params
=
deserialized_params
)
print
(
response
)
...
...
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