Skip to content

Commit 22c247c

Browse files
authored
Example enc-dec package (#32)
* Add `start_after` to process * Add example encdec package * Fix tests
1 parent 5601aa6 commit 22c247c

File tree

26 files changed

+465
-29
lines changed

26 files changed

+465
-29
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
{
2+
"run_test": {
3+
"name": "Workflow for running an enc-dec solution",
4+
"external_objects": [
5+
"<OUT_TEST_PATH>",
6+
"<IN_TEST_PATH>",
7+
"<SOL_PATH>",
8+
"<EXTRA_EXE:prog/abcchk.cpp>"
9+
],
10+
"observable_objects": [],
11+
"registers": 0,
12+
"observable_registers": 0,
13+
"tasks": [
14+
{
15+
"name": "Run encdec solution on test <TEST_ID>",
16+
"type": "execution",
17+
"pipes": 0,
18+
"channels": [],
19+
"exclusive": false,
20+
"hard_time_limit": 60000,
21+
"output_register": "r:run_res_<TEST_ID>",
22+
"pid_namespaces": 1,
23+
"filesystems": [
24+
{
25+
"type": "object",
26+
"handle": "<SOL_PATH>"
27+
}
28+
],
29+
"mount_namespaces": [
30+
{
31+
"mountpoints": [
32+
{
33+
"source": 0,
34+
"target": "/exe",
35+
"writable": false
36+
}
37+
],
38+
"root": 0
39+
}
40+
],
41+
"resource_groups": [
42+
{
43+
"cpu_usage_limit": 100.0,
44+
"instruction_limit": 1000000000.0,
45+
"memory_limit": 2147483648,
46+
"oom_terminate_all_tasks": false,
47+
"pid_limit": 2,
48+
"swap_limit": 0,
49+
"time_limit": 1000000000.0
50+
}
51+
],
52+
"processes": [
53+
{
54+
"arguments": [
55+
"/exe", "enc"
56+
],
57+
"environment": [],
58+
"image": "",
59+
"mount_namespace": 0,
60+
"resource_group": 0,
61+
"pid_namespace": 0,
62+
"working_directory": "/",
63+
"descriptors": {
64+
"0": {
65+
"type": "object_read",
66+
"handle": "<IN_TEST_PATH>"
67+
},
68+
"1": {
69+
"type": "object_write",
70+
"handle": "user_enc_<TEST_ID>"
71+
}
72+
}
73+
},
74+
{
75+
"arguments": [
76+
"/exe", "dec"
77+
],
78+
"environment": [],
79+
"image": "",
80+
"mount_namespace": 0,
81+
"resource_group": 0,
82+
"pid_namespace": 0,
83+
"working_directory": "/",
84+
"descriptors": {
85+
"0": {
86+
"type": "object_read",
87+
"handle": "user_enc_<TEST_ID>"
88+
},
89+
"1": {
90+
"type": "object_write",
91+
"handle": "user_out_<TEST_ID>"
92+
}
93+
},
94+
"start_after": [0]
95+
}
96+
]
97+
},
98+
{
99+
"name": "Run encdec checker for test <TEST_ID>",
100+
"type": "execution",
101+
"pipes": 0,
102+
"channels": [],
103+
"exclusive": false,
104+
"hard_time_limit": 60000,
105+
"output_register": "r:chk_res_<TEST_ID>",
106+
"pid_namespaces": 1,
107+
"filesystems": [
108+
{
109+
"type": "object",
110+
"handle": "<EXTRA_EXE:prog/abcchk.cpp>"
111+
},
112+
{
113+
"type": "object",
114+
"handle": "<IN_TEST_PATH>"
115+
},
116+
{
117+
"type": "object",
118+
"handle": "<OUT_TEST_PATH>"
119+
},
120+
{
121+
"type": "object",
122+
"handle": "user_out_<TEST_ID>"
123+
}
124+
],
125+
"mount_namespaces": [
126+
{
127+
"mountpoints": [
128+
{
129+
"source": 0,
130+
"target": "/chk",
131+
"writable": false
132+
},
133+
{
134+
"source": 1,
135+
"target": "/in",
136+
"writable": false
137+
},
138+
{
139+
"source": 2,
140+
"target": "/out",
141+
"writable": false
142+
},
143+
{
144+
"source": 3,
145+
"target": "/user_out",
146+
"writable": false
147+
}
148+
],
149+
"root": 0
150+
}
151+
],
152+
"resource_groups": [
153+
{
154+
"cpu_usage_limit": 100.0,
155+
"instruction_limit": 1000000000.0,
156+
"memory_limit": 2147483648,
157+
"oom_terminate_all_tasks": false,
158+
"pid_limit": 2,
159+
"swap_limit": 0,
160+
"time_limit": 1000000000.0
161+
}
162+
],
163+
"processes": [
164+
{
165+
"arguments": [
166+
"/chk", "/in", "/out", "/user_out"
167+
],
168+
"environment": [],
169+
"image": "",
170+
"mount_namespace": 0,
171+
"resource_group": 0,
172+
"pid_namespace": 0,
173+
"working_directory": "/",
174+
"descriptors": {
175+
"1": {
176+
"type": "object_write",
177+
"handle": "chk_out_<TEST_ID>"
178+
}
179+
}
180+
}
181+
]
182+
},
183+
{
184+
"name": "Grade test <TEST_ID>",
185+
"type": "script",
186+
"reactive": true,
187+
"input_registers": [
188+
"r:run_res_<TEST_ID>",
189+
"r:chk_res_<TEST_ID>"
190+
],
191+
"output_registers": ["r:grade_res_<TEST_ID>"],
192+
"objects": ["chk_out_<TEST_ID>"],
193+
"script": ""
194+
}
195+
]
196+
}
197+
}

example_workflows/example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
"mount_namespace": 0,
104104
"pid_namespace": 0,
105105
"resource_group": 0,
106-
"working_directory": "/"
106+
"working_directory": "/",
107+
"start_after": []
107108
}
108109
],
109110
"resource_groups": [

example_workflows/inwer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"type": "object_write",
6868
"handle": "executables/abcinwer.cpp.e"
6969
}
70-
}
70+
},
71+
"start_after": []
7172
}
7273
]
7374
},
@@ -126,7 +127,8 @@
126127
"type": "object_read",
127128
"handle": "abc/in/abc0.in"
128129
}
129-
}
130+
},
131+
"start_after": []
130132
}
131133
]
132134
},
@@ -185,7 +187,8 @@
185187
"type": "object_read",
186188
"handle": "abc/in/abc1a.in"
187189
}
188-
}
190+
},
191+
"start_after": []
189192
}
190193
]
191194
},

example_workflows/outgen.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"type": "object_write",
7171
"handle": "executables/abc.cpp.e"
7272
}
73-
}
73+
},
74+
"start_after": []
7475
}
7576
]
7677
},
@@ -132,7 +133,8 @@
132133
"type": "object_write",
133134
"handle": "abc1a.out"
134135
}
135-
}
136+
},
137+
"start_after": []
136138
}
137139
]
138140
},
@@ -194,7 +196,8 @@
194196
"type": "object_write",
195197
"handle": "abc0.out"
196198
}
197-
}
199+
},
200+
"start_after": []
198201
}
199202
]
200203
},

example_workflows/run.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"type": "object_write",
7171
"handle": "executables/abc.cpp.e"
7272
}
73-
}
73+
},
74+
"start_after": []
7475
}
7576
]
7677
},
@@ -132,7 +133,8 @@
132133
"type": "object_write",
133134
"handle": "user_out_0"
134135
}
135-
}
136+
},
137+
"start_after": []
136138
}
137139
]
138140
},
@@ -220,7 +222,8 @@
220222
"type": "object_write",
221223
"handle": "chk_out_0"
222224
}
223-
}
225+
},
226+
"start_after": []
224227
}
225228
]
226229
},
@@ -310,7 +313,8 @@
310313
"type": "object_write",
311314
"handle": "user_out_1a"
312315
}
313-
}
316+
},
317+
"start_after": []
314318
}
315319
]
316320
},
@@ -398,7 +402,8 @@
398402
"type": "object_write",
399403
"handle": "chk_out_1a"
400404
}
401-
}
405+
},
406+
"start_after": []
402407
}
403408
]
404409
},

example_workflows/simple_run.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"resource_group": 0,
6565
"mount_namespace": 0,
6666
"pid_namespace": 0,
67-
"working_directory": "/"
67+
"working_directory": "/",
68+
"start_after": []
6869
}
6970
],
7071
"resource_groups": [
@@ -157,7 +158,8 @@
157158
"resource_group": 0,
158159
"mount_namespace": 0,
159160
"pid_namespace": 0,
160-
"working_directory": "/"
161+
"working_directory": "/",
162+
"start_after": []
161163
}
162164
],
163165
"resource_groups": [
@@ -238,7 +240,8 @@
238240
"resource_group": 0,
239241
"mount_namespace": 0,
240242
"pid_namespace": 0,
241-
"working_directory": "/"
243+
"working_directory": "/",
244+
"start_after": []
242245
}
243246
],
244247
"resource_groups": [
@@ -331,7 +334,8 @@
331334
"resource_group": 0,
332335
"mount_namespace": 0,
333336
"pid_namespace": 0,
334-
"working_directory": "/"
337+
"working_directory": "/",
338+
"start_after": []
335339
}
336340
],
337341
"resource_groups": [

0 commit comments

Comments
 (0)