Skip to content

Commit

Permalink
add docker network to nextflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlinLiao committed Dec 16, 2023
1 parent 9392d7a commit bece9ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/workflow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spatialprofilingtoolbox/workflow/assets/nextflow.config.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
1 change: 1 addition & 0 deletions test/workflow/module_tests/.workflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ merge_rois = true
upload_importances = false
cuda = false
random_seed = 0
network = workflow_isolated_temporary_test
6 changes: 3 additions & 3 deletions test/workflow/module_tests/no_docker_test_cggnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/

0 comments on commit bece9ef

Please sign in to comment.