]> git.arvados.org - arvados.git/commit
CWL SDK: Do not hard-code default storage class in command-line tool
authorZoë Ma <zoe.ma@curii.com>
Mon, 1 Jul 2024 07:34:33 +0000 (15:34 +0800)
committerBrett Smith <brett.smith@curii.com>
Tue, 4 Feb 2025 20:16:46 +0000 (15:16 -0500)
commitd3b34ee1641ee9069d56fee9c85399e9ee058240
tree9db6647c7e2d3afebebd45c40ee36560446a51d2
parent533daa46a6e31c58b523853baf6d9d9af112daa6
CWL SDK: Do not hard-code default storage class in command-line tool

For arvados-cwl-runner, the options --storage-classes and
--intermediate-storage-classes used the hard-coded string `"default"`
internally as the stand-in for the storage class when none was given
when the tool was invoked.

This works when the storage class named "default" is the only default
storage class configured (i.e. with `Default: True` property). However,
this could be confusing, because, for example, there can be more than
one default storage classes in addition to the one _named_ "default".
Furthermore, the it's possible that the class named "default" may not
have the `Default: True` property (although the latter is certainly not
recommended).

By using the empty string, instead of the hard-coded "default", to
indicate that "no valid storage class is explicitly specified", testing
for the condition "we should use default storage classes" is actually
simplified, because the empty string is not ambiguous.

With this change, the decision about default intermediate storage
classes is made when container is requested. This can be beneficial, for
example, when the stages are run on different clusters with different
storage class configurations.

In addition, like in 8cb5ef17 (for Python SDK), the input option value
(comma-separated list of storage classes) is subjected to more robust
validation, to filter out any duplicate or empty values.

Arvados-DCO-1.1-Signed-off-by: Zoë Ma <zoe.ma@curii.com>
sdk/cwl/arvados_cwl/__init__.py
sdk/cwl/arvados_cwl/arvcontainer.py
sdk/cwl/arvados_cwl/context.py
sdk/cwl/arvados_cwl/executor.py
sdk/cwl/tests/test_submit.py
sdk/python/arvados/util.py