diff --git a/build/workflow/Makefile b/build/workflow/Makefile index 81ff9617b..6dbe56821 100644 --- a/build/workflow/Makefile +++ b/build/workflow/Makefile @@ -101,7 +101,7 @@ ${STANDALONE_MODULE_TEST}: ${MODULE_TESTS} if [[ "$$extension" == "py" ]]; then executor=python; fi ; \ if [[ "$$extension" == "sh" ]]; then executor=bash; fi ; \ cd ../../${TEST_LOCATION}/${MODULE_NAME}/ ; \ - $$executor $$filename; \ + $$executor $$filename ${DOCKER_ORG_NAME}-development/${DOCKER_REPO_PREFIX}-development:latest ; \ echo "$$?" > status_code >@${MESSAGE} end "Passed." "Failed." >@rm -f status_code diff --git a/spatialprofilingtoolbox/workflow/assets/nextflow.config.jinja b/spatialprofilingtoolbox/workflow/assets/nextflow.config.jinja index 049ac1cb8..250799a97 100644 --- a/spatialprofilingtoolbox/workflow/assets/nextflow.config.jinja +++ b/spatialprofilingtoolbox/workflow/assets/nextflow.config.jinja @@ -95,3 +95,9 @@ env.cuda_ = '{{ cuda }}'{% endif %} {%- if random_seed is defined %} env.random_seed_ = '{{ random_seed }}'{% endif %} + +{%- if workflow == 'cggnn' and network is not none %} +docker { + runOptions = '--network {{ network }}' +} +{%- endif %} diff --git a/test/workflow/module_tests/.workflow.config b/test/workflow/module_tests/.workflow.config index c7e04981c..c736a6999 100644 --- a/test/workflow/module_tests/.workflow.config +++ b/test/workflow/module_tests/.workflow.config @@ -16,3 +16,4 @@ merge_rois = true upload_importances = false cuda = false random_seed = 0 +network = workflow_isolated_temporary_test diff --git a/test/workflow/module_tests/no_docker_test_cggnn.sh b/test/workflow/module_tests/no_docker_test_cggnn.sh index 5e16879cd..637d01593 100755 --- a/test/workflow/module_tests/no_docker_test_cggnn.sh +++ b/test/workflow/module_tests/no_docker_test_cggnn.sh @@ -4,8 +4,8 @@ source env/bin/activate pip install ../..[workflow] # Run the workflow -spt workflow configure --local --workflow='cggnn' --study-name='Melanoma intralesional IL2' --database-config-file=module_tests/.spt_db.config.container --workflow-config-file=module_tests/.workflow.config -nextflow run . -with-docker +spt workflow configure --local --workflow='cggnn' --study-name='Melanoma intralesional IL2' --database-config-file=../db/.spt_db.config.container --workflow-config-file=module_tests/.workflow.config +nextflow run . -with-docker $1 # Check if the workflow ran successfully and if the expected output files exist if [ $? -ne 0 ] || [ ! -e "results/model/model_best_validation_accuracy.pt" ] || [ ! -e "results/model/model_best_validation_loss.pt" ] || [ ! -e "results/model/model_best_validation_weighted_f1_score.pt" ] || [ ! -e "results/importances.csv" ] || [ ! -e "results/feature_names.txt" ] || [ ! -e "results/graphs.pkl" ]; then @@ -68,6 +68,6 @@ else fi # Clean up -rm -f .nextflow.log*; rm -rf .nextflow/; rm -f configure.sh; rm -f run.sh; rm -f main.nf; rm -f nextflow.config; rm -f top_100_structures.txt; rm -f top_100_reference.txt; rm -rf results/ +rm -f .nextflow.log*; rm -rf .nextflow/; rm -f configure.sh; rm -f run.sh; rm -f main.nf; rm -f nextflow.config; rm -f top_100_structures.txt; rm -f top_100_reference.txt; # rm -rf results/ deactivate rm -rf env/