Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: dm/tools/jobsim_client/fire_missiles.py

Issue 2339413003: Refactor and test jobsim_client. (Closed)
Patch Set: Remove old script Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698