Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress: CircleCI inline orbs #385

Open
wants to merge 7 commits into
base: v1.10.3rc
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 91 additions & 52 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,68 @@
version: 2
version: 2.1

orbs:
lcdb-wf:
commands:
deploy-clone:
parameters:
flavor:
default: "full"
type: string
steps:
- run:
name: Deploy to a new directory, cloning to a temp dir
command: |
source /opt/mambaforge/etc/profile.d/conda.sh
conda activate $LCDBWF_ENV
conda info --envs
conda config --show

# Copy the deploy script to a different location to simulate the
# suggested deployment method of downloading just the script.
cp deploy.py /tmp/deploy.py
cd /tmp/

# Deploy to the new directory, so we are testing the real-world case of post-deployment.
# Note that $DEPLOY is set in the "set-paths" step configured above.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Note that $DEPLOY is set in the "set-paths" step configured above.
# Note that $DEPLOY is set in the "set-paths" step configured below.

python deploy.py --flavor <<parameters.flavor>> --dest $DEPLOY --branch $CIRCLE_BRANCH --clone
get-data:
parameters:
kind:
default: "all"
type: enum
enum: ["all", "rnaseq", "chipseq"]
workflow:
type: string
steps:
- run:
name: Download example data
command: |
set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tree stuff left over from my debugging on the last PR, I could go either way with keeping it. I guess it doesn't cost anything.

tree $DEPLOY
tree $ORIG
set +x

# Separately copy over some test-specific files

cp $ORIG/workflows/<<parameters.workflow>>/run_test.sh $DEPLOY/workflows/<<parameters.workflow>>/run_test.sh

if [[ "<<parameters.workflow>>" = "rnaseq" ]]; then
cp $ORIG/workflows/rnaseq/run_downstream_test.sh $DEPLOY/workflows/rnaseq/run_downstream_test.sh
fi

mkdir $DEPLOY/ci
mkdir $DEPLOY/test
cp $ORIG/test/lcdb-wf-test $DEPLOY/test/lcdb-wf-test
cp $ORIG/test/workflow_test_params.yaml $DEPLOY/test/workflow_test_params.yaml
cp $ORIG/ci/get-data.py $DEPLOY/ci/get-data.py

# the ./run_test.sh scripts run this
cp $ORIG/ci/preprocessor.py $DEPLOY/ci/preprocessor.py

# download example data
cd $DEPLOY
test/lcdb-wf-test data --kind=<<parameters.kind>> --verbose


variables:

Expand Down Expand Up @@ -121,51 +185,6 @@ variables:
time mamba env create -n $LCDBWF_ENV_R --file env-r.yml
fi

# --------------------------------------------------------------------------
# Deploy into a new directory and get the test data.
get-data: &get-data
run:
name: Download example data
command: |
source /opt/mambaforge/etc/profile.d/conda.sh
conda activate $LCDBWF_ENV
conda info --envs
conda config --show

# Copy the deploy script to a different location to simulate the
# suggested deployment method of downloading just the script.
cp deploy.py /tmp/deploy.py
cd /tmp/

# Deploy to the new directory, so we are testing the real-world case of post-deployment.
# Note that $DEPLOY is set in the "set-paths" step configured above.
python deploy.py --flavor full --dest $DEPLOY --branch $CIRCLE_BRANCH --clone

set -x
tree $DEPLOY
tree $ORIG
set +x

# Separately copy over some test-specific files
cp $ORIG/workflows/chipseq/run_test.sh $DEPLOY/workflows/chipseq/run_test.sh
cp $ORIG/workflows/rnaseq/run_test.sh $DEPLOY/workflows/rnaseq/run_test.sh
cp $ORIG/workflows/rnaseq/run_downstream_test.sh $DEPLOY/workflows/rnaseq/run_downstream_test.sh
cp $ORIG/workflows/colocalization/run_test.sh $DEPLOY/workflows/references/run_test.sh
cp $ORIG/workflows/colocalization/run_test.sh $DEPLOY/workflows/colocalization/run_test.sh

mkdir $DEPLOY/ci
mkdir $DEPLOY/test
cp $ORIG/test/lcdb-wf-test $DEPLOY/test/lcdb-wf-test
cp $ORIG/test/workflow_test_params.yaml $DEPLOY/test/workflow_test_params.yaml
cp $ORIG/ci/get-data.py $DEPLOY/ci/get-data.py

# the ./run_test.sh scripts run this
cp $ORIG/ci/preprocessor.py $DEPLOY/ci/preprocessor.py

# download example data
cd $DEPLOY
test/lcdb-wf-test data --kind=all --verbose

# --------------------------------------------------------------------------
# Run the doctests across the included modules
pytest-step: &pytest-step
Expand Down Expand Up @@ -362,7 +381,11 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone:
flavor: chipseq
- lcdb-wf/get-data:
kind: chipseq
workflow: chipseq
- *chipseq-step
- store_artifacts:
path: /tmp/lcdb-wf-test/workflows/chipseq/data/chipseq_aggregation/multiqc.html
Expand All @@ -373,7 +396,11 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone:
flavor: chipseq
- lcdb-wf/get-data:
kind: chipseq
workflow: chipseq
- *chipseq-misc-step

rnaseq:
Expand All @@ -382,7 +409,11 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone:
flavor: rnaseq
- lcdb-wf/get-data:
kind: rnaseq
workflow: rnaseq
- *rnaseq-step
- store_artifacts:
path: /tmp/downstream.tar.gz
Expand All @@ -407,7 +438,11 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone:
flavor: rnaseq
- lcdb-wf/get-data:
kind: rnaseq
workflow: rnaseq
- *rnaseq-misc-step

colocalization:
Expand All @@ -416,7 +451,9 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone
- lcdb-wf/get-data:
workflow: colocalization
- *colocalization-step

references:
Expand All @@ -425,7 +462,9 @@ jobs:
- checkout
- *restore_cache
- *set-path
- *get-data
- lcdb-wf/deploy-clone
- lcdb-wf/get-data:
workflow: references
- *references-step

build-docs:
Expand Down