fail jobs if workers die
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,8 +2,17 @@
|
||||
|
||||
import sys
|
||||
import requests
|
||||
from os import environ
|
||||
|
||||
resp = requests.post("http://localhost:8080/status", json=[{"id": int(sys.argv[1])}])
|
||||
def print_and_exit(s):
|
||||
print(s)
|
||||
exit(0)
|
||||
|
||||
resp = requests.post(
|
||||
"http://localhost:8080/status",
|
||||
json=[{"id": int(sys.argv[1])}],
|
||||
headers={"cookie": environ["ZOIDBERG_SECRET"]},
|
||||
)
|
||||
|
||||
translation = {
|
||||
"Submitted": "running",
|
||||
@@ -11,4 +20,12 @@ translation = {
|
||||
"Failed": "failed",
|
||||
}
|
||||
|
||||
print(translation[resp.json()[0]["status"]])
|
||||
j = resp.json()
|
||||
|
||||
if len(j) == 0:
|
||||
print_and_exit("failed")
|
||||
|
||||
if "Running" in j[0]["status"]:
|
||||
print_and_exit("running")
|
||||
|
||||
print_and_exit(translation[resp.json()[0]["status"]])
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import sys
|
||||
import requests
|
||||
from os import environ
|
||||
|
||||
jobscript = sys.argv[1]
|
||||
|
||||
@@ -10,6 +11,7 @@ resp = requests.post(
|
||||
json=[
|
||||
{"cmd": jobscript},
|
||||
],
|
||||
headers={"cookie": environ["ZOIDBERG_SECRET"]},
|
||||
)
|
||||
assert resp.ok, "http request failed"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user