primitive 0.1.69__py3-none-any.whl → 0.1.70__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 +29 -25
- {primitive-0.1.69.dist-info → primitive-0.1.70.dist-info}/METADATA +1 -1
- {primitive-0.1.69.dist-info → primitive-0.1.70.dist-info}/RECORD +7 -7
- {primitive-0.1.69.dist-info → primitive-0.1.70.dist-info}/WHEEL +0 -0
- {primitive-0.1.69.dist-info → primitive-0.1.70.dist-info}/entry_points.txt +0 -0
- {primitive-0.1.69.dist-info → primitive-0.1.70.dist-info}/licenses/LICENSE.txt +0 -0
primitive/__about__.py
CHANGED
primitive/agent/runner.py
CHANGED
@@ -49,6 +49,7 @@ class AgentRunner:
|
|
49
49
|
job_slug: str,
|
50
50
|
max_log_size: int = 10 * 1024 * 1024,
|
51
51
|
log_to_file: bool = True,
|
52
|
+
job: Optional[JobDescription] = None,
|
52
53
|
) -> None:
|
53
54
|
self.primitive = primitive
|
54
55
|
self.source_dir = source_dir
|
@@ -70,33 +71,36 @@ class AgentRunner:
|
|
70
71
|
)
|
71
72
|
|
72
73
|
# Attempt to load job from file
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
self.
|
83
|
-
|
84
|
-
|
74
|
+
if not job:
|
75
|
+
logger.info(f"Scanning directory for job file {self.job_slug}")
|
76
|
+
yaml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yaml")
|
77
|
+
yml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yml")
|
78
|
+
|
79
|
+
if yaml_file.exists() and yml_file.exists():
|
80
|
+
logger.error(
|
81
|
+
f"Found two job descriptions with the same slug: {self.job_slug}"
|
82
|
+
)
|
83
|
+
self.primitive.jobs.job_run_update(
|
84
|
+
self.job_id, status="request_completed", conclusion="failure"
|
85
|
+
)
|
86
|
+
raise FileExistsError
|
87
|
+
|
88
|
+
if yaml_file.exists():
|
89
|
+
self.job = yaml.load(open(yaml_file, "r"), Loader=Loader)
|
90
|
+
elif yml_file.exists():
|
91
|
+
self.job = yaml.load(open(yml_file, "r"), Loader=Loader)
|
92
|
+
else:
|
93
|
+
logger.error(
|
94
|
+
f"No job description with matching slug '{self.job_slug}' found"
|
95
|
+
)
|
96
|
+
self.primitive.jobs.job_run_update(
|
97
|
+
self.job_id, status="request_completed", conclusion="failure"
|
98
|
+
)
|
99
|
+
raise FileNotFoundError
|
85
100
|
|
86
|
-
|
87
|
-
self.job = yaml.load(open(yaml_file, "r"), Loader=Loader)
|
88
|
-
elif yml_file.exists():
|
89
|
-
self.job = yaml.load(open(yml_file, "r"), Loader=Loader)
|
101
|
+
logger.info(f"Found job description for {self.job_slug}")
|
90
102
|
else:
|
91
|
-
|
92
|
-
f"No job description with matching slug '{self.job_slug}' found"
|
93
|
-
)
|
94
|
-
self.primitive.jobs.job_run_update(
|
95
|
-
self.job_id, status="request_completed", conclusion="failure"
|
96
|
-
)
|
97
|
-
raise FileNotFoundError
|
98
|
-
|
99
|
-
logger.info(f"Found job description for {self.job_slug}")
|
103
|
+
self.job = job
|
100
104
|
|
101
105
|
@staticmethod
|
102
106
|
def log_serializer() -> Callable:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.70
|
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=-U2lYL3xVMRxRRI2Jc3j5nMPLun6XNvp118ovjwO1R8,130
|
2
2
|
primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
|
3
3
|
primitive/cli.py,sha256=CiI60bG3UZyNFuLTpchr0KeJRG5SALj455Ob11CegGE,2412
|
4
4
|
primitive/client.py,sha256=PPyIQRvKKSqCF9RRF5mJJ4Vqqolpzy1YXqffNLKIvAA,2390
|
@@ -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=7o8axjJ1OauKaFBL0jbZL9tGlZdZbDCXAdT5F-S_XQ8,2541
|
9
9
|
primitive/agent/provision.py,sha256=rmwnro1K5F8mwtd45XAq7RVQmpDWnbBCQ8X_qgWhm3M,1546
|
10
|
-
primitive/agent/runner.py,sha256=
|
10
|
+
primitive/agent/runner.py,sha256=WHmlfSRHngY6mNwpykIe90LxYGoIMTBB-F2h5KVV-VE,8504
|
11
11
|
primitive/agent/uploader.py,sha256=CRy928vI4z22PcJ-i8BOwAZnvut-jit64XM741xbDxM,2947
|
12
12
|
primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
primitive/auth/actions.py,sha256=MPsG9LcKcOPwA7gZ9Ewk0PZJhTQvIrGfODdz4GxSzgA,999
|
@@ -90,8 +90,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
|
|
90
90
|
primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
|
91
91
|
primitive/utils/shell.py,sha256=j7E1YwgNWw57dFHVfEbqRNVcPHX0xDefX2vFSNgeI_8,1648
|
92
92
|
primitive/utils/verible.py,sha256=Zb5NUISvcaIgEvgCDBWr-GCoceMa79Tcwvr5Wl9lfnA,2252
|
93
|
-
primitive-0.1.
|
94
|
-
primitive-0.1.
|
95
|
-
primitive-0.1.
|
96
|
-
primitive-0.1.
|
97
|
-
primitive-0.1.
|
93
|
+
primitive-0.1.70.dist-info/METADATA,sha256=i8Xfzp2x0MeOgBQWBq5oPABDrKf0oBS5XrDy5auHxQY,3806
|
94
|
+
primitive-0.1.70.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
95
|
+
primitive-0.1.70.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
|
96
|
+
primitive-0.1.70.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
|
97
|
+
primitive-0.1.70.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|