Skip to content
Snippets Groups Projects
Commit fcb5e495 authored by ranchodeluxe's avatar ranchodeluxe
Browse files

make it the exact same

parent 9f74aa7f
No related branches found
No related tags found
1 merge request!93make it the exact same
......@@ -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 additional 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment