primitive 0.1.66__py3-none-any.whl → 0.1.68__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/runner.py +18 -1
- {primitive-0.1.66.dist-info → primitive-0.1.68.dist-info}/METADATA +1 -1
- {primitive-0.1.66.dist-info → primitive-0.1.68.dist-info}/RECORD +7 -7
- {primitive-0.1.66.dist-info → primitive-0.1.68.dist-info}/WHEEL +0 -0
- {primitive-0.1.66.dist-info → primitive-0.1.68.dist-info}/entry_points.txt +0 -0
- {primitive-0.1.66.dist-info → primitive-0.1.68.dist-info}/licenses/LICENSE.txt +0 -0
primitive/__about__.py
CHANGED
primitive/agent/runner.py
CHANGED
@@ -47,6 +47,7 @@ class AgentRunner:
|
|
47
47
|
job_id: str,
|
48
48
|
job_slug: str,
|
49
49
|
max_log_size: int = 10 * 1024 * 1024,
|
50
|
+
job: Optional[JobDescription] = None,
|
50
51
|
) -> None:
|
51
52
|
self.primitive = primitive
|
52
53
|
self.source_dir = source_dir
|
@@ -61,7 +62,13 @@ class AgentRunner:
|
|
61
62
|
logger.enable("primitive")
|
62
63
|
self.swap_logs(label="init")
|
63
64
|
|
64
|
-
|
65
|
+
if job:
|
66
|
+
self.job = job
|
67
|
+
else:
|
68
|
+
self.load_job_from_file()
|
69
|
+
|
70
|
+
def load_job_from_file(self) -> JobDescription:
|
71
|
+
logger.info(f"Scanning directory for job file {self.job_slug}")
|
65
72
|
|
66
73
|
# Look for job based on slug
|
67
74
|
yaml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yaml")
|
@@ -189,10 +196,20 @@ class AgentRunner:
|
|
189
196
|
# Remove Handle
|
190
197
|
if self.logger_handle:
|
191
198
|
logger.remove(self.logger_handle)
|
199
|
+
|
200
|
+
# Custom format for UTC time
|
201
|
+
logger_format = (
|
202
|
+
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS!UTC}</green> | "
|
203
|
+
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
|
204
|
+
"<level>{level: <8}</level> | "
|
205
|
+
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - "
|
206
|
+
"<level>{message}</level>"
|
207
|
+
)
|
192
208
|
|
193
209
|
self.logger_handle = logger.add(
|
194
210
|
Path(self.logs_dir / f"{label}_{{time}}.primitive.log"),
|
195
211
|
rotation=self.max_log_size,
|
212
|
+
format=logger_format
|
196
213
|
)
|
197
214
|
|
198
215
|
def provision(self) -> Optional[Dict]:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.68
|
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,4 +1,4 @@
|
|
1
|
-
primitive/__about__.py,sha256=
|
1
|
+
primitive/__about__.py,sha256=HwbDpGY94x-5mM9iqNDH53F3G8OAv0XgJ3P44BhArVQ,130
|
2
2
|
primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
|
3
3
|
primitive/cli.py,sha256=CGmWiqqCLMHtHGOUPuf3tVO6VvChBZ1VdSwCCglnBgA,2582
|
4
4
|
primitive/client.py,sha256=P7cCDperMu3pxlmRAP-H2owM-cj1kRlZWrqujxnWa4o,2473
|
@@ -7,7 +7,7 @@ primitive/agent/actions.py,sha256=Hosy2o2FntfBtcNqqHuMFq9dm99EVfySy0v2JGeufvc,64
|
|
7
7
|
primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
|
8
8
|
primitive/agent/process.py,sha256=LVI-RB4a0YEuXUTYMXKL5Xi9euNwUI2nxj00mv8EFOg,2253
|
9
9
|
primitive/agent/provision.py,sha256=rmwnro1K5F8mwtd45XAq7RVQmpDWnbBCQ8X_qgWhm3M,1546
|
10
|
-
primitive/agent/runner.py,sha256=
|
10
|
+
primitive/agent/runner.py,sha256=URCyk9Di423tTWAT6ObQcT62F-n27Q2MFGTcTNCPU8Y,7754
|
11
11
|
primitive/agent/uploader.py,sha256=W-aXUgKZvcm9LbTXq8su_cgBl_mFrmcFfkkU9t8W04Q,3002
|
12
12
|
primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
primitive/auth/actions.py,sha256=MPsG9LcKcOPwA7gZ9Ewk0PZJhTQvIrGfODdz4GxSzgA,999
|
@@ -93,8 +93,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
|
|
93
93
|
primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
|
94
94
|
primitive/utils/shell.py,sha256=j7E1YwgNWw57dFHVfEbqRNVcPHX0xDefX2vFSNgeI_8,1648
|
95
95
|
primitive/utils/verible.py,sha256=Zb5NUISvcaIgEvgCDBWr-GCoceMa79Tcwvr5Wl9lfnA,2252
|
96
|
-
primitive-0.1.
|
97
|
-
primitive-0.1.
|
98
|
-
primitive-0.1.
|
99
|
-
primitive-0.1.
|
100
|
-
primitive-0.1.
|
96
|
+
primitive-0.1.68.dist-info/METADATA,sha256=2zoWXWeqIRffEJBD8D_kzJ5zbGTJIh5H6TVe6wSEWlU,3777
|
97
|
+
primitive-0.1.68.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
98
|
+
primitive-0.1.68.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
|
99
|
+
primitive-0.1.68.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
|
100
|
+
primitive-0.1.68.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|