Two conformance tests require Docker container execution:
test_conformance_v1_0_dockeroutputdir— Tooldocker-output-dir.cwlusesdockerOutputDirectory: /other, runstouch /other/thing. Without Docker,/otherdoesn't exist.test_conformance_v1_0_docker_entrypoint— Tooldocker-run-cmd.cwlwithbash:4.4.12image. Command is-c 'echo moo' > cowrelying on Docker ENTRYPOINT (bash). Without Docker,-cis "command not found".
Galaxy's CWL conformance tests run without Docker enabled. Key code path:
CwlToolSource.parse_requirements()(cwl.py:304-323) extractsdocker_identifierbut discardsdockerOutputDirectoryJobProxy._ensure_cwl_job_initialized()(parser.py:377-397) creates cwltool RuntimeContext withuse_container=False- Without a container, commands run on the host directly — no
/othermount, no entrypoint
Need a way to run specific conformance tests with docker_enabled: true.
Option A: Set GALAXY_TEST_JOB_CONFIG_FILE pointing to a Docker-enabled config. May not work for API-style conformance tests.
Option B: Integration test class with handle_galaxy_config_kwds override. More reliable.
Either way, create a job config like:
runners:
local:
load: galaxy.jobs.runners.local:LocalJobRunner
workers: 1
execution:
default: local_docker
environments:
local_docker:
runner: local
docker_enabled: true
local_upload:
runner: local
tools:
- id: upload1
environment: local_uploadTests must skip if Docker is not available (CI may not have it).
Galaxy needs to map dockerOutputDirectory into the container volume/workdir.
a) Parse dockerOutputDirectory from CWL DockerRequirement:
lib/galaxy/tool_util/cwl/parser.py— Adddocker_output_directory()toCommandLineToolProxy(next todocker_identifier()at line 338)lib/galaxy/tool_util/parser/cwl.py— Addparse_docker_output_directory()toCwlToolSourcelib/galaxy/tool_util/deps/requirements.py— ExtendContainerDescriptionwith optionaldocker_output_directoryfield
b) Container command generation:
lib/galaxy/tool_util/deps/container_classes.py— InDockerContainer.containerize_command(): when tool hasdocker_output_directory, add-v <working_directory>:<docker_output_directory>:rwand set-w <docker_output_directory>
Likely works once Docker is enabled with no code changes:
CwlTool.may_use_container_entry_point = Truepasses raw command to containerdocker run bash:4.4.12 -c 'echo moo > cow'uses image's ENTRYPOINT (bash)- Galaxy's
build_docker_run_commanddoes NOT set--entrypoint, so Docker default is used
Verify first before writing code.
scripts/cwl_conformance_to_test_cases.py— Remove these fromRED_TESTS["v1.0"]- Regenerate:
make update-cwl-conformance-tests
# With Docker-enabled config
GALAXY_TEST_JOB_CONFIG_FILE=test/integration/cwl_docker_job_conf.yml \
.venv/bin/pytest -xvs lib/galaxy_test/api/cwl/test_cwl_conformance_v1_0.py \
-k "dockeroutputdir or docker_entrypoint"- Does
GALAXY_TEST_JOB_CONFIG_FILEwork for API-style conformance tests, or does it need integration test class withhandle_galaxy_config_kwds? - For entrypoint test: does Galaxy's
build_docker_run_commandpass the raw command correctly whenmay_use_container_entry_point=True? The command goes throughcommands_builder.build()which may addcd working;prefix and stdout capture — could that break the Docker entrypoint invocation? - Should
dockerOutputDirectoryvolume mount go inDockerContainer.containerize_command()or higher in_find_container()/_expand_volume_str()? - Is Docker reliably available in CI? If not, tests stay red in CI and only pass locally.
- Does
collect_outputswork correctly post-container? cwltool collects withuse_container=Falselooking in hostoutdir(working dir). Volume mount means Docker writes to host working dir — globthingshould find it there. But needs verification.