stages: - check - test - test_docker - cache_docker - test_singularity - cache_singularity variables: GIT_STRATEGY: clone # Execute this script for everybody. YAML anchor. .all-script-before: &all-script-before - pwd - env - ls -laht - whoami ### All base jobs. # Astrocyte jobs, assumed to need to run on the cluster where they have access to the module lists. .astrocyte: before_script: - *all-script-before - module load astrocyte/0.4.0 tags: - cluster_node .docker: before_script: - *all-script-before - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY ### Setup scripts before_script: - *all-script-before # This performs validation of the astrocyte_pkg.yml file astrocyte_check: extends: .astrocyte stage: check script: - astrocyte_cli check "$CI_PROJECT_DIR" nextflow_test_docker: stage: test script: - module load nextflow/20.01.0 - module load singularity/3.5.3 - cd $CI_PROJECT_DIR/workflow - nextflow -C $CI_PROJECT_DIR/workflow/configs/biohpc_docker.config run main.nf -with-trace -with-timeline -resume --verbose -bg artifacts: paths: - $CI_PROJECT_DIR/workflow/.nextflow.log tags: - cluster_node nextflow_test_singularity: stage: test script: - module load nextflow/20.01.0 - module load singularity/3.5.3 - cd $CI_PROJECT_DIR/workflow - nextflow -C $CI_PROJECT_DIR/workflow/configs/biohpc_singularity.config run main.nf -with-trace -with-timeline -resume --verbose -bg artifacts: paths: - $CI_PROJECT_DIR/workflow/.nextflow.log tags: - cluster_node # This runs the workflow with test data and does a simple # check for the expected output file astrocyte_test: extends: .astrocyte stage: test script: - astrocyte_cli run "$CI_PROJECT_DIR" --option=q - test -s "$CI_PROJECT_DIR/workflow/output/mobydick.txt.uppercase.tolines.wordcount" artifacts: paths: - $CI_PROJECT_DIR/workflow/.nextflow.log # This runs the workflow, opting to use Docker containers. docker_astrocyte_test: stage: test_docker variables: config_path : "workflow/configs/" config_filename : "biohpc_docker.config" script: - sed -i "s|nextflow_config\x3A \x27biohpc.config\x27|nextflow_config\x3A \x27${config_filename}\x27|" astrocyte_pkg.yml - echo "Run astrocyte using dockerhub/docker.io registry pulls" - nextflow -C ./${config_path}/${config_filename} config -flat - astrocyte_cli run "$CI_PROJECT_DIR" --option=q - test -s "$CI_PROJECT_DIR/workflow/output/mobydick.txt.uppercase.tolines.wordcount" tags: - cluster_node cache_docker_image: stage: cache_docker script: - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - echo "Pull Docker image from the docker.io registry, re-tag, and push to our GitLab" - docker - echo "Need to know what the docker image is ahead of time" singularity_astrocyte_test: stage: test_singularity script: # Note the biohpc_singularity.config replacement. - sed -i 's|nextflow_config\x3A \x27biohpc.config\x27|nextflow_config\x3A \x27biohpc_singularity.config\x27|' astrocyte_pkg.yml - echo "Run astrocyte using singularity with dockerhub/docker.io registry pulls" - astrocyte_cli run "$CI_PROJECT_DIR" --option=q - test -s "$CI_PROJECT_DIR/workflow/output/mobydick.txt.uppercase.tolines.wordcount" cache_singularity_image: stage: cache_singularity script: - echo "Pull from our gitlab OCI registry using singularity and save as SIF on the cluster" # This verifies we can install the shiny vizapp dependencies # and start the vizapp running. astrocyte_shiny: stage: test script: - astrocyte_cli shiny-prepare "$CI_PROJECT_DIR" - 'timeout 10 astrocyte_cli shiny "$CI_PROJECT_DIR" &' - 'SHINY_PID=$!' - sleep 5 - unset http_proxy - unset all_proxy - wget "http://127.0.0.1:8123"