.gitlab-ci.yml 2.27 KB
Newer Older
David Trudgian's avatar
David Trudgian committed
1
2
3
stages:
    - check
    - test
Devin OKelly's avatar
Devin OKelly committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    - test_docker
    - cache_docker
    - test_singularity
    - cache_singularity




# 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
David Trudgian's avatar
David Trudgian committed
40

David Trudgian's avatar
David Trudgian committed
41
# This performs validation of the astrocyte_pkg.yml file
David Trudgian's avatar
David Trudgian committed
42
astrocyte_check:
Devin OKelly's avatar
Devin OKelly committed
43
  extends: .astrocyte
David Trudgian's avatar
David Trudgian committed
44
  stage: check
David Trudgian's avatar
David Trudgian committed
45
46
  script:
  - astrocyte_cli check "$CI_PROJECT_DIR"
Devin OKelly's avatar
Devin OKelly committed
47
  
Devin OKelly's avatar
Devin OKelly committed
48
49
50
51
52
53
nextflow_test:
  stage: test
  script:
  - module load nextflow/20.01.0 
  - module load singularity/3.5.3 
  - nextflow  -C $CI_PROJECT_DIR/workflow/configs/biohpc.config  run main.nf -with-trace -with-timeline -resume --verbose
Devin OKelly's avatar
Devin OKelly committed
54

David Trudgian's avatar
David Trudgian committed
55
56
# This runs the workflow with test data and does a simple
# check for the expected output file
David Trudgian's avatar
David Trudgian committed
57
astrocyte_test:
Devin OKelly's avatar
Devin OKelly committed
58
  extends: .astrocyte
David Trudgian's avatar
David Trudgian committed
59
  stage: test
David Trudgian's avatar
David Trudgian committed
60
  script:
Devin OKelly's avatar
Devin OKelly committed
61
  - astrocyte_cli test "$CI_PROJECT_DIR" --verbose
David Trudgian's avatar
David Trudgian committed
62
  - test -s "$CI_PROJECT_DIR/workflow/output/mobydick.txt.uppercase.tolines.wordcount"
Devin OKelly's avatar
Devin OKelly committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  
# This runs the workflow, opting to use Docker containers.
docker_astrocyte_test:
  stage: test_docker
  script:
  - echo "Run astrocyte using dockerhub/docker.io registry pulls"
 
cache_docker_image:
  stage: cache_docker
  script:
  - echo "Pull Docker image from the docker.io registry, re-tag, and push to our GitLab"
 
singularity_astrocyte_test:
  stage: test_singularity
  script:
  - echo "Run astrocyte using singularity registry pulls"

cache_singularity_image:
  stage: cache_singularity
  script:
  - echo "Pull from our gitlab OCI registry using singularity and save as SIF on the cluster"
David Trudgian's avatar
David Trudgian committed
84
85
86

# This verifies we can install the shiny vizapp dependencies
# and start the vizapp running.
David Trudgian's avatar
David Trudgian committed
87
88
astrocyte_shiny:
  stage: test
David Trudgian's avatar
David Trudgian committed
89
90
91
92
93
94
95
96
97
  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"