primitive 0.1.21__py3-none-any.whl → 0.1.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- primitive/__about__.py +1 -1
- primitive/agent/actions.py +38 -5
- primitive/hardware/actions.py +4 -0
- {primitive-0.1.21.dist-info → primitive-0.1.22.dist-info}/METADATA +1 -1
- {primitive-0.1.21.dist-info → primitive-0.1.22.dist-info}/RECORD +8 -8
- {primitive-0.1.21.dist-info → primitive-0.1.22.dist-info}/WHEEL +0 -0
- {primitive-0.1.21.dist-info → primitive-0.1.22.dist-info}/entry_points.txt +0 -0
- {primitive-0.1.21.dist-info → primitive-0.1.22.dist-info}/licenses/LICENSE.txt +0 -0
primitive/__about__.py
CHANGED
primitive/agent/actions.py
CHANGED
@@ -21,15 +21,40 @@ class Agent(BaseAction):
|
|
21
21
|
sys.exit(1)
|
22
22
|
|
23
23
|
try:
|
24
|
+
active_reservation_id = None
|
25
|
+
active_reservation_pk = None
|
26
|
+
|
24
27
|
while True:
|
25
28
|
hardware = self.primitive.hardware.get_own_hardware_details()
|
29
|
+
if hardware["activeReservation"]:
|
30
|
+
if (
|
31
|
+
hardware["activeReservation"]["id"] != active_reservation_id
|
32
|
+
or hardware["activeReservation"]["pk"] != active_reservation_pk
|
33
|
+
):
|
34
|
+
logger.warning("New reservation for this hardware.")
|
35
|
+
active_reservation_id = hardware["activeReservation"]["id"]
|
36
|
+
active_reservation_pk = hardware["activeReservation"]["pk"]
|
37
|
+
logger.debug("Active Reservation:")
|
38
|
+
logger.debug(f"Node ID: {active_reservation_id}")
|
39
|
+
logger.debug(f"PK: {active_reservation_pk}")
|
40
|
+
else:
|
41
|
+
if (
|
42
|
+
hardware["activeReservation"] is None
|
43
|
+
and active_reservation_id is not None
|
44
|
+
and hardware["isAvailable"]
|
45
|
+
):
|
46
|
+
logger.debug("Previous Reservation is Complete:")
|
47
|
+
logger.debug(f"Node ID: {active_reservation_id}")
|
48
|
+
logger.debug(f"PK: {active_reservation_pk}")
|
49
|
+
active_reservation_id = None
|
50
|
+
active_reservation_pk = None
|
26
51
|
|
27
|
-
active_reservation_id = None
|
28
|
-
if hardware.get("activeReservation"):
|
29
|
-
active_reservation_id = hardware["activeReservation"]["id"]
|
30
52
|
if not active_reservation_id:
|
31
|
-
|
32
|
-
|
53
|
+
sleep_amount = 5
|
54
|
+
logger.debug(
|
55
|
+
f"No active reservation found... [sleeping {sleep_amount} seconds]"
|
56
|
+
)
|
57
|
+
sleep(sleep_amount)
|
33
58
|
continue
|
34
59
|
|
35
60
|
job_runs_data = self.primitive.jobs.get_job_runs(
|
@@ -40,6 +65,14 @@ class Agent(BaseAction):
|
|
40
65
|
edge["node"] for edge in job_runs_data["jobRuns"]["edges"]
|
41
66
|
]
|
42
67
|
|
68
|
+
if not pending_job_runs:
|
69
|
+
sleep_amount = 5
|
70
|
+
logger.debug(
|
71
|
+
f"Waiting for Job Runs... [sleeping {sleep_amount} seconds]"
|
72
|
+
)
|
73
|
+
sleep(sleep_amount)
|
74
|
+
continue
|
75
|
+
|
43
76
|
for job_run in pending_job_runs:
|
44
77
|
logger.debug("Found pending Job Run")
|
45
78
|
logger.debug(f"Job Run ID: {job_run['id']}")
|
primitive/hardware/actions.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.22
|
4
4
|
Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
|
5
5
|
Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
|
6
6
|
Project-URL: Source, https://github.com//primitivecorp/primitive-cli
|
@@ -1,8 +1,8 @@
|
|
1
|
-
primitive/__about__.py,sha256=
|
1
|
+
primitive/__about__.py,sha256=GLbyQLa84sxg9eRnmnWkVVauDFJZS0FGa5ocDebd_3g,129
|
2
2
|
primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
|
3
3
|
primitive/cli.py,sha256=VQPSewC6ouGdEG9W1gllawGJTydpOY0Lzg7LURXcqQg,2374
|
4
4
|
primitive/client.py,sha256=SFPG4H2wJao8euGdnYp-l7dk_fDpWeVn2aT2WNJUAqo,2370
|
5
|
-
primitive/agent/actions.py,sha256=
|
5
|
+
primitive/agent/actions.py,sha256=uTT3Ke95BTL9haAHFhPJPasZEDlqDuC2uEF03Omap7E,7020
|
6
6
|
primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
|
7
7
|
primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
primitive/auth/actions.py,sha256=N2bGcwXNsB89pzs66gF9A5_WzUScY5fhfOyWixqo2y8,1054
|
@@ -18,7 +18,7 @@ primitive/git/actions.py,sha256=fepcl5529w_hsaC6fBw9f-QHeyqNjGXz8HI5ebzbZMs,1386
|
|
18
18
|
primitive/git/commands.py,sha256=64B2STTOn0dwVDmJHqEwekmIqKMfSyBBFwKg29Wt8Aw,1230
|
19
19
|
primitive/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
primitive/graphql/sdk.py,sha256=BhCGmDtc4sNnH8CxbQSJyFwOZ-ZSqMtjsxMB3JRBhPw,1456
|
21
|
-
primitive/hardware/actions.py,sha256=
|
21
|
+
primitive/hardware/actions.py,sha256=JJXEeW35QzVGcLN4ym5gYZwY71hxLzM1GYPXWaObEts,18893
|
22
22
|
primitive/hardware/commands.py,sha256=QE7LLeFdfOqlvz3JwdwJJRZAY3fHI1zB9kYmmDajpq0,1477
|
23
23
|
primitive/jobs/actions.py,sha256=1Mc-bg4nCd5qiKC-hPODveTPZwwo0Kztl5BuidLr-Sc,7718
|
24
24
|
primitive/jobs/commands.py,sha256=MxPCkBEYW_eLNqgCRYeyj7ZcLOFAWfpVZlqDR2Y_S0o,830
|
@@ -41,8 +41,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
|
|
41
41
|
primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
|
42
42
|
primitive/utils/shell.py,sha256=-7UjQaBqSGHzEEyX8pNjeYFFP0P3lVnDV0OkgPz1qHU,1050
|
43
43
|
primitive/utils/verible.py,sha256=QYczN1IvxODfj4jeq0nqjFuF0Oi0Zdx-Q32ySOJgcw8,2205
|
44
|
-
primitive-0.1.
|
45
|
-
primitive-0.1.
|
46
|
-
primitive-0.1.
|
47
|
-
primitive-0.1.
|
48
|
-
primitive-0.1.
|
44
|
+
primitive-0.1.22.dist-info/METADATA,sha256=O1FnkxZf7VZ8cu575Na1xlA2-6z6esA-sqgWp-0sWtc,1818
|
45
|
+
primitive-0.1.22.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
46
|
+
primitive-0.1.22.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
|
47
|
+
primitive-0.1.22.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
|
48
|
+
primitive-0.1.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|