primitive 0.2.4__tar.gz → 0.2.6__tar.gz
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-0.2.4 → primitive-0.2.6}/PKG-INFO +1 -1
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/__about__.py +1 -1
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/agent/runner.py +20 -15
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/agent/uploader.py +10 -4
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/graphql/sdk.py +1 -0
- {primitive-0.2.4 → primitive-0.2.6}/.git-hooks/pre-commit +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/.gitattributes +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/.github/workflows/lint.yml +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/.github/workflows/publish.yml +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/.gitignore +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/.vscode/settings.json +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/LICENSE.txt +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/Makefile +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/README.md +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/linux setup.md +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/pyproject.toml +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/agent/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/agent/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/agent/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/auth/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/auth/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/auth/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/auth/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/auth/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/cli.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/client.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/daemons/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/daemons/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/daemons/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/daemons/launch_agents.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/daemons/launch_service.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/exec/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/exec/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/exec/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/exec/interactive.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/files/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/git/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/git/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/git/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/git/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/git/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/graphql/relay.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/graphql/utility_fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/android.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/hardware/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/jobs/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/organizations/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/projects/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/provisioning/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/provisioning/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/provisioning/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/provisioning/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/commands.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/graphql/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/graphql/fragments.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/graphql/mutations.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/reservations/graphql/queries.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/actions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/auth.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/cache.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/chunk_size.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/config.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/exceptions.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/memory_size.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/printer.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/shell.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/src/primitive/utils/text.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/tests/__init__.py +0 -0
- {primitive-0.2.4 → primitive-0.2.6}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.6
|
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
|
@@ -72,7 +72,7 @@ class Runner:
|
|
72
72
|
self.job_run = job_run
|
73
73
|
self.job_settings = job_run["jobSettings"]
|
74
74
|
self.config = None
|
75
|
-
self.source_dir = None
|
75
|
+
self.source_dir: Path = None
|
76
76
|
self.initial_env = {}
|
77
77
|
self.modified_env = {}
|
78
78
|
self.file_logger = None
|
@@ -207,9 +207,14 @@ class Runner:
|
|
207
207
|
return True
|
208
208
|
|
209
209
|
if returncode > 0 or stdout_failed or stderr_failed:
|
210
|
+
import time
|
211
|
+
|
212
|
+
start_time = time.monotonic()
|
210
213
|
await self.primitive.jobs.ajob_run_update(
|
211
214
|
self.job_run["id"], status="request_completed", conclusion="failure"
|
212
215
|
)
|
216
|
+
end_time = time.monotonic()
|
217
|
+
logger.warning(f"JOB RUN UPDATE {end_time - start_time:.2f} seconds")
|
213
218
|
|
214
219
|
if returncode > 0:
|
215
220
|
logger.error(
|
@@ -300,7 +305,13 @@ class Runner:
|
|
300
305
|
|
301
306
|
async def monitor_cmd(self, process) -> bool:
|
302
307
|
while process.returncode is None:
|
308
|
+
import time
|
309
|
+
|
310
|
+
start_time = time.monotonic()
|
303
311
|
status = await self.primitive.jobs.aget_job_status(self.job_run["id"])
|
312
|
+
end_time = time.monotonic()
|
313
|
+
logger.warning(f"GET JOB STATUS {end_time - start_time:.2f} seconds")
|
314
|
+
|
304
315
|
status_value = status.data["jobRun"]["status"]
|
305
316
|
conclusion_value = status.data["jobRun"]["conclusion"]
|
306
317
|
|
@@ -324,20 +335,14 @@ class Runner:
|
|
324
335
|
return
|
325
336
|
|
326
337
|
for glob in self.config["stores"]:
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
relative_path = PurePath(file).relative_to(self.source_dir)
|
336
|
-
destination = Path(
|
337
|
-
get_artifacts_cache(self.job_run["id"]) / relative_path
|
338
|
-
)
|
339
|
-
destination.parent.mkdir(parents=True, exist_ok=True)
|
340
|
-
Path(file).replace(destination)
|
338
|
+
# Glob relative to the source directory
|
339
|
+
matches = self.source_dir.rglob(glob)
|
340
|
+
|
341
|
+
for match in matches:
|
342
|
+
relative_path = PurePath(match).relative_to(self.source_dir)
|
343
|
+
dest = Path(get_artifacts_cache(self.job_run["id"]) / relative_path)
|
344
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
345
|
+
Path(match).replace(dest)
|
341
346
|
|
342
347
|
shutil.rmtree(path=self.source_dir)
|
343
348
|
|
@@ -45,10 +45,16 @@ class Uploader:
|
|
45
45
|
)
|
46
46
|
|
47
47
|
for file in files:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
try:
|
49
|
+
result = self.primitive.files.upload_file_direct(
|
50
|
+
path=file,
|
51
|
+
key_prefix=str(PurePath(file).relative_to(cache.parent).parent),
|
52
|
+
)
|
53
|
+
except Exception as e:
|
54
|
+
if "is empty" in str(e):
|
55
|
+
logger.warning(f"{file} is empty, skipping upload")
|
56
|
+
continue
|
57
|
+
|
52
58
|
upload_id = result.data["fileUpdate"]["id"]
|
53
59
|
|
54
60
|
if upload_id:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|