Skip to content

Commit cae8f82

Browse files
committed
Add relative outputs path to global context
1 parent 774ff13 commit cae8f82

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

cli/polyaxon/_compiler/contexts/contexts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def resolve_globals_contexts(
9595
}
9696

9797
plugins = V1Plugins.get_or_create(plugins)
98+
resolved_contexts[ctx_sections.GLOBALS][ctx_keys.RUN_RELATIVE_OUTPUTS_PATH] = (
99+
"{}/outputs".format(run_path)
100+
)
98101
if plugins.collect_artifacts:
99102
run_artifacts_path = ctx_paths.CONTEXT_MOUNT_ARTIFACTS_FORMAT.format(run_path)
100103
run_outputs_path = ctx_paths.CONTEXT_MOUNT_RUN_OUTPUTS_FORMAT.format(run_path)

cli/polyaxon/_contexts/keys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
RUN_ARTIFACTS_PATH = "run_artifacts_path"
1515
RUN_OUTPUTS_PATH = "run_outputs_path"
16+
RUN_RELATIVE_OUTPUTS_PATH = "run_relative_outputs_path"
1617
RUN_INFO = "run_info"
1718
STATUS = "status"
1819
CONDITION = "condition"

cli/tests/test_compiler/test_contexts.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def test_resolver_default_contexts(self):
7474
"store_path": "",
7575
"username": "user",
7676
"user_email": "user@local.com",
77+
"run_relative_outputs_path": "test/outputs",
7778
},
7879
"init": {},
7980
"connections": {},
@@ -140,6 +141,7 @@ def test_resolver_init_and_connections_contexts(self):
140141
"artifacts_path": "{}/artifacts".format(context_root),
141142
"run_artifacts_path": "/claim/path/test",
142143
"run_outputs_path": "/claim/path/test/outputs",
144+
"run_relative_outputs_path": "test/outputs",
143145
"namespace": "test",
144146
"iteration": 12,
145147
"run_info": "user.project.runs.uuid",
@@ -218,6 +220,7 @@ def test_resolver_outputs_collections(self):
218220
"artifacts_path": "{}/artifacts".format(context_root),
219221
"run_artifacts_path": "{}/artifacts/test".format(context_root),
220222
"run_outputs_path": "{}/artifacts/test/outputs".format(context_root),
223+
"run_relative_outputs_path": "test/outputs",
221224
"namespace": "test",
222225
"iteration": 12,
223226
"created_at": None,
@@ -294,6 +297,7 @@ def test_resolver_mount_artifacts_store(self):
294297
"artifacts_path": "{}/artifacts".format(context_root),
295298
"run_artifacts_path": "{}/artifacts/test".format(context_root),
296299
"run_outputs_path": "{}/artifacts/test/outputs".format(context_root),
300+
"run_relative_outputs_path": "test/outputs",
297301
"namespace": "test",
298302
"iteration": 12,
299303
"created_at": None,
@@ -361,6 +365,7 @@ def test_resolver_default_service_ports(self):
361365
"artifacts_path": "{}/artifacts".format(context_root),
362366
"run_artifacts_path": "{}/artifacts/test".format(context_root),
363367
"run_outputs_path": "{}/artifacts/test/outputs".format(context_root),
368+
"run_relative_outputs_path": "test/outputs",
364369
"namespace": "test",
365370
"iteration": 12,
366371
"ports": [1212, 1234],

0 commit comments

Comments
 (0)