fix(sdk): make executor output writer more permissive [sdk v2] (#8607)

This commit is contained in:
Connor McCarthy 2022-12-20 16:23:13 -08:00 committed by GitHub
parent 8414c73f61
commit f64348f29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -273,12 +273,11 @@ class Executor():
write_file = True
CLUSTER_SPEC_ENV_VAR_NAME = 'CLUSTER_SPEC'
CHEIF_NODE_LABEL = 'workerpool0'
cluster_spec_string = os.environ.get(CLUSTER_SPEC_ENV_VAR_NAME)
if cluster_spec_string:
cluster_spec = json.loads(cluster_spec_string)
chief_node_label = CHEIF_NODE_LABEL
write_file = cluster_spec['task']['type'] == chief_node_label
CHIEF_NODE_LABELS = {'workerpool0', 'chief', 'master'}
write_file = cluster_spec['task']['type'] in CHIEF_NODE_LABELS
if write_file:
executor_output_path = self._input['outputs']['outputFile']