openjd-cli 0.4.2__tar.gz → 0.4.4__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.
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/PKG-INFO +9 -13
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/README.md +5 -10
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/_local_session/_session_manager.py +38 -9
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_version.py +2 -2
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/pyproject.toml +4 -1
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/.gitignore +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/LICENSE +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/NOTICE +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/hatch.toml +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/__main__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_check/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_check/_check_command.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_common/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_common/_job_from_template.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_common/_validation_utils.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_create_argparser.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/_local_session/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/_local_session/_actions.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/_local_session/_logs.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_run/_run_command.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_schema/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_schema/_schema_command.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_summary/__init__.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_summary/_summary_command.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/_summary/_summary_output.py +0 -0
- {openjd_cli-0.4.2 → openjd_cli-0.4.4}/openjd/cli/py.typed +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: openjd-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Provides a command-line interface for working with Open Job Description templates.
|
|
5
5
|
Project-URL: Homepage, https://github.com/OpenJobDescription/openjd-cli
|
|
6
6
|
Project-URL: Source, https://github.com/OpenJobDescription/openjd-cli
|
|
7
|
+
Author: Amazon Web Services
|
|
7
8
|
License-Expression: Apache-2.0
|
|
8
9
|
License-File: LICENSE
|
|
9
10
|
License-File: NOTICE
|
|
@@ -22,12 +23,14 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
22
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
24
|
Requires-Python: >=3.9
|
|
24
25
|
Requires-Dist: openjd-model==0.4.*
|
|
25
|
-
Requires-Dist: openjd-sessions==0.
|
|
26
|
+
Requires-Dist: openjd-sessions==0.8.*
|
|
26
27
|
Description-Content-Type: text/markdown
|
|
27
28
|
|
|
28
29
|
## Open Job Description - CLI
|
|
29
30
|
|
|
30
31
|
[](https://pypi.python.org/pypi/openjd-cli)
|
|
32
|
+
[](https://pypi.python.org/pypi/openjd-cli)
|
|
33
|
+
[](https://github.com/OpenJobDescription/openjd-cli/blob/mainline/LICENSE)
|
|
31
34
|
|
|
32
35
|
Open Job Description (OpenJD) is a flexible open specification for defining render jobs which are portable
|
|
33
36
|
between studios and render solutions. This package provides a command-line interface that can be used
|
|
@@ -44,13 +47,6 @@ This library requires:
|
|
|
44
47
|
2. Linux, MacOS, or Windows operating system;
|
|
45
48
|
3. On Linux/MacOS:
|
|
46
49
|
* `sudo`
|
|
47
|
-
4. On Windows:
|
|
48
|
-
* PowerShell 5.x
|
|
49
|
-
|
|
50
|
-
**EXPERIMENTAL** Note that compatibility with the Windows operating system is currently in active development
|
|
51
|
-
and should be considered to be experimental. We recommend that this application not be used in Windows-based
|
|
52
|
-
production environments at this time. We will remove this notice when Windows compatibility is considered
|
|
53
|
-
sufficiently stable and secure for use in Windows-based production environments.
|
|
54
50
|
|
|
55
51
|
## Versioning
|
|
56
52
|
|
|
@@ -110,7 +106,7 @@ customize the Job, as parameters can have an impact on the amount of Steps and T
|
|
|
110
106
|
|
|
111
107
|
#### Example
|
|
112
108
|
```sh
|
|
113
|
-
$ openjd
|
|
109
|
+
$ openjd summary /path/to/job.template.json \
|
|
114
110
|
--job-param JobName=SampleJob \
|
|
115
111
|
--job-param '{"FileToRender": "sample.blend"}' \
|
|
116
112
|
--job-param file://some_more_parameters.json
|
|
@@ -164,7 +160,7 @@ details on how Open Job Description's Jobs are run within Sessions.
|
|
|
164
160
|
|
|
165
161
|
#### Example
|
|
166
162
|
```sh
|
|
167
|
-
$ openjd
|
|
163
|
+
$ openjd run /path/to/job.template.json --step Step1 \
|
|
168
164
|
--job-param PingServer=amazon.com \
|
|
169
165
|
--task-param PingCount=20 \
|
|
170
166
|
--task-param PingDelay=30
|
|
@@ -193,7 +189,7 @@ Returns the Open Job Description model as a JSON schema document body.
|
|
|
193
189
|
|
|
194
190
|
#### Example
|
|
195
191
|
```sh
|
|
196
|
-
$ openjd
|
|
192
|
+
$ openjd schema --version jobtemplate-2023-09
|
|
197
193
|
|
|
198
194
|
{
|
|
199
195
|
"title": "JobTemplate",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
## Open Job Description - CLI
|
|
2
2
|
|
|
3
3
|
[](https://pypi.python.org/pypi/openjd-cli)
|
|
4
|
+
[](https://pypi.python.org/pypi/openjd-cli)
|
|
5
|
+
[](https://github.com/OpenJobDescription/openjd-cli/blob/mainline/LICENSE)
|
|
4
6
|
|
|
5
7
|
Open Job Description (OpenJD) is a flexible open specification for defining render jobs which are portable
|
|
6
8
|
between studios and render solutions. This package provides a command-line interface that can be used
|
|
@@ -17,13 +19,6 @@ This library requires:
|
|
|
17
19
|
2. Linux, MacOS, or Windows operating system;
|
|
18
20
|
3. On Linux/MacOS:
|
|
19
21
|
* `sudo`
|
|
20
|
-
4. On Windows:
|
|
21
|
-
* PowerShell 5.x
|
|
22
|
-
|
|
23
|
-
**EXPERIMENTAL** Note that compatibility with the Windows operating system is currently in active development
|
|
24
|
-
and should be considered to be experimental. We recommend that this application not be used in Windows-based
|
|
25
|
-
production environments at this time. We will remove this notice when Windows compatibility is considered
|
|
26
|
-
sufficiently stable and secure for use in Windows-based production environments.
|
|
27
22
|
|
|
28
23
|
## Versioning
|
|
29
24
|
|
|
@@ -83,7 +78,7 @@ customize the Job, as parameters can have an impact on the amount of Steps and T
|
|
|
83
78
|
|
|
84
79
|
#### Example
|
|
85
80
|
```sh
|
|
86
|
-
$ openjd
|
|
81
|
+
$ openjd summary /path/to/job.template.json \
|
|
87
82
|
--job-param JobName=SampleJob \
|
|
88
83
|
--job-param '{"FileToRender": "sample.blend"}' \
|
|
89
84
|
--job-param file://some_more_parameters.json
|
|
@@ -137,7 +132,7 @@ details on how Open Job Description's Jobs are run within Sessions.
|
|
|
137
132
|
|
|
138
133
|
#### Example
|
|
139
134
|
```sh
|
|
140
|
-
$ openjd
|
|
135
|
+
$ openjd run /path/to/job.template.json --step Step1 \
|
|
141
136
|
--job-param PingServer=amazon.com \
|
|
142
137
|
--task-param PingCount=20 \
|
|
143
138
|
--task-param PingDelay=30
|
|
@@ -166,7 +161,7 @@ Returns the Open Job Description model as a JSON schema document body.
|
|
|
166
161
|
|
|
167
162
|
#### Example
|
|
168
163
|
```sh
|
|
169
|
-
$ openjd
|
|
164
|
+
$ openjd schema --version jobtemplate-2023-09
|
|
170
165
|
|
|
171
166
|
{
|
|
172
167
|
"title": "JobTemplate",
|
|
@@ -46,7 +46,8 @@ class LocalSession:
|
|
|
46
46
|
_start_seconds: float
|
|
47
47
|
_end_seconds: float
|
|
48
48
|
_inner_session: Session
|
|
49
|
-
|
|
49
|
+
_enter_env_queue: Queue[EnterEnvironmentAction]
|
|
50
|
+
_action_queue: Queue[RunTaskAction]
|
|
50
51
|
_current_action: Optional[SessionAction]
|
|
51
52
|
_action_ended: Event
|
|
52
53
|
_path_mapping_rules: Optional[list[PathMappingRule]]
|
|
@@ -90,7 +91,8 @@ class LocalSession:
|
|
|
90
91
|
)
|
|
91
92
|
|
|
92
93
|
# Initialize the action queue
|
|
93
|
-
self.
|
|
94
|
+
self._enter_env_queue: Queue[EnterEnvironmentAction] = Queue()
|
|
95
|
+
self._action_queue: Queue[RunTaskAction] = Queue()
|
|
94
96
|
self._current_action = None
|
|
95
97
|
|
|
96
98
|
self._should_print_logs = should_print_logs
|
|
@@ -222,25 +224,52 @@ class LocalSession:
|
|
|
222
224
|
RunTaskAction(self._inner_session, step=step, parameters=param_set)
|
|
223
225
|
)
|
|
224
226
|
|
|
225
|
-
# Finally, enqueue ExitEnvironment Actions in reverse order to EnterEnvironment
|
|
226
|
-
for env_id in reversed(session_environment_ids):
|
|
227
|
-
self._action_queue.put(ExitEnvironmentAction(self._inner_session, env_id))
|
|
228
|
-
|
|
229
227
|
def run(self) -> None:
|
|
230
228
|
if self._inner_session.state != SessionState.READY:
|
|
231
229
|
raise RuntimeError("Session is not in a READY state")
|
|
232
230
|
|
|
231
|
+
environments_entered = list[str]()
|
|
232
|
+
failed_action: Optional[SessionAction] = None
|
|
233
|
+
|
|
233
234
|
self._start_seconds = time.perf_counter()
|
|
235
|
+
|
|
236
|
+
# Enter all of the Environments, and keep track of which ones we've entered
|
|
237
|
+
while not self._enter_env_queue.empty() and not self.failed:
|
|
238
|
+
self._action_ended.clear()
|
|
239
|
+
action = self._enter_env_queue.get()
|
|
240
|
+
environments_entered.append(action._id)
|
|
241
|
+
self._current_action = action
|
|
242
|
+
self._current_action.run()
|
|
243
|
+
self._action_ended.wait()
|
|
244
|
+
if self.failed:
|
|
245
|
+
failed_action = self._current_action
|
|
246
|
+
|
|
247
|
+
# Run all of the Tasks that are enqueued
|
|
234
248
|
while not self._action_queue.empty() and not self.failed:
|
|
235
249
|
self._action_ended.clear()
|
|
236
250
|
self._current_action = self._action_queue.get()
|
|
237
251
|
self._current_action.run()
|
|
238
252
|
self._action_ended.wait()
|
|
253
|
+
if self.failed:
|
|
254
|
+
failed_action = self._current_action
|
|
255
|
+
|
|
256
|
+
# Exit all environments that were entered. We always try to exit all failed environments; even
|
|
257
|
+
# if an environment-enter, task, or environment exit failed.
|
|
258
|
+
while environments_entered:
|
|
259
|
+
prev_action_failed = self.failed
|
|
260
|
+
self._action_ended.clear()
|
|
261
|
+
self._current_action = ExitEnvironmentAction(
|
|
262
|
+
self._inner_session, environments_entered.pop()
|
|
263
|
+
)
|
|
264
|
+
self._current_action.run()
|
|
265
|
+
self._action_ended.wait()
|
|
266
|
+
if self.failed and not prev_action_failed:
|
|
267
|
+
failed_action = self._current_action
|
|
239
268
|
|
|
240
269
|
if self.failed:
|
|
241
270
|
# Action encountered an error; clean up resources and end session
|
|
242
271
|
LOG.info(
|
|
243
|
-
msg=f"Open Job Description CLI: ERROR executing action: '{str(
|
|
272
|
+
msg=f"Open Job Description CLI: ERROR executing action: '{str(failed_action)}' (see Task logs for details)",
|
|
244
273
|
extra={"session_id": self.session_id},
|
|
245
274
|
)
|
|
246
275
|
|
|
@@ -347,13 +376,13 @@ class LocalSession:
|
|
|
347
376
|
if isinstance(self._current_action, RunTaskAction):
|
|
348
377
|
self.tasks_run += 1
|
|
349
378
|
self._action_ended.set()
|
|
350
|
-
if new_status.state in (ActionState.FAILED, ActionState.CANCELED):
|
|
379
|
+
if new_status.state in (ActionState.FAILED, ActionState.CANCELED, ActionState.TIMEOUT):
|
|
351
380
|
self.failed = True
|
|
352
381
|
self._action_ended.set()
|
|
353
382
|
|
|
354
383
|
def _add_environments(self, envs: list) -> list[str]:
|
|
355
384
|
ids: list[str] = []
|
|
356
385
|
for env in envs:
|
|
357
|
-
self.
|
|
386
|
+
self._enter_env_queue.put(EnterEnvironmentAction(self._inner_session, env, env.name))
|
|
358
387
|
ids.append(env.name)
|
|
359
388
|
return ids
|
|
@@ -4,6 +4,9 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "openjd-cli"
|
|
7
|
+
authors = [
|
|
8
|
+
{name = "Amazon Web Services"},
|
|
9
|
+
]
|
|
7
10
|
dynamic = ["version"]
|
|
8
11
|
readme = "README.md"
|
|
9
12
|
license = "Apache-2.0"
|
|
@@ -26,7 +29,7 @@ classifiers = [
|
|
|
26
29
|
"Intended Audience :: End Users/Desktop"
|
|
27
30
|
]
|
|
28
31
|
dependencies = [
|
|
29
|
-
"openjd-sessions == 0.
|
|
32
|
+
"openjd-sessions == 0.8.*",
|
|
30
33
|
"openjd-model == 0.4.*"
|
|
31
34
|
]
|
|
32
35
|
|
|
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
|