| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2016 The LUCI Authors. All rights reserved. | |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | |
| 4 # that can be found in the LICENSE file. | |
| 5 | |
| 6 import json | |
| 7 | |
| 8 def dumps(obj): | |
| 9 return json.dumps(obj, sort_keys=True, separators=(',', ':')) | |
| 10 | |
| 11 distParams = { | |
| 12 "scheduling": { | |
| 13 "dimensions": { | |
| 14 "cpu": "x86-64", | |
| 15 "os": "Linux", | |
| 16 "pool": "default", | |
| 17 }, | |
| 18 }, | |
| 19 "meta": {"name_suffix": "dm test"}, | |
| 20 "job": { | |
| 21 "inputs": { | |
| 22 "isolated": [ | |
| 23 {"id": "01e25aad5365fc54a4b05971c15b84933bbe891a"} | |
| 24 ] | |
| 25 }, | |
| 26 "command": ["jobsim_client", "edit-distance", "-dm-host", "${DM.HOST}", | |
| 27 "-execution-auth-path", "${DM.EXECUTION.AUTH:PATH}", | |
| 28 "-quest-desc-path", "${DM.QUEST.DATA.DESC:PATH}"], | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 params = { | |
| 33 "a": "ca", | |
| 34 "b": "ha", | |
| 35 } | |
| 36 | |
| 37 desc = { | |
| 38 "quest": [ | |
| 39 { | |
| 40 "distributor_config_name": "swarming", | |
| 41 "parameters": dumps(params), | |
| 42 "distributor_parameters": dumps(distParams), | |
| 43 "meta": { | |
| 44 "timeouts": { | |
| 45 "start": "600s", | |
| 46 "run": "300s", | |
| 47 "stop": "300s", | |
| 48 } | |
| 49 }, | |
| 50 } | |
| 51 ], | |
| 52 "quest_attempt": [ | |
| 53 {"nums": [1]}, | |
| 54 ] | |
| 55 } | |
| 56 | |
| 57 print dumps(desc) | |
| OLD | NEW |