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

Dockerfile tests and cleanup imputation/PRS #202

Merged
merged 37 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
56e5107
bump ubuntu versions
kachulis Nov 14, 2024
57b2ca4
.
kachulis Jan 9, 2025
94e135e
init dockerfile tests
kachulis Feb 4, 2025
2f25449
.
kachulis Feb 4, 2025
88ecaf4
.
kachulis Feb 4, 2025
37a5e4a
.
kachulis Feb 4, 2025
7d951d7
.
kachulis Feb 4, 2025
7249556
changed dockerfiles
kachulis Feb 4, 2025
80b6cda
context
kachulis Feb 4, 2025
5dc93d3
context
kachulis Feb 4, 2025
ea9b2f8
all files
kachulis Feb 4, 2025
60e746b
all files
kachulis Feb 4, 2025
5bd81d7
all files
kachulis Feb 4, 2025
ebc7fa3
all files
kachulis Feb 4, 2025
07351ee
all files
kachulis Feb 4, 2025
17b39a2
list dockerfiles
kachulis Feb 4, 2025
c648202
**/Dockerfile
kachulis Feb 4, 2025
812c9c9
bzip
kachulis Feb 4, 2025
d3c0c19
zlib, don't fail-fast
kachulis Feb 4, 2025
303b2ac
don't fail-fast
kachulis Feb 4, 2025
512ceeb
build-essential
kachulis Feb 4, 2025
8d65391
test all this branch
kachulis Feb 5, 2025
baca1d4
.
kachulis Feb 5, 2025
4f300ef
.
kachulis Feb 5, 2025
352925d
fix dockers, remove Imputation
kachulis Feb 6, 2025
081438f
ImputationPipeline --> PRS
kachulis Feb 6, 2025
b925a91
move glimpse docker tests to separate
kachulis Feb 6, 2025
4574716
.
kachulis Feb 6, 2025
de9da7c
cache
kachulis Feb 6, 2025
2c86515
setup docker buildx
kachulis Feb 6, 2025
98fd217
remove caching
kachulis Feb 6, 2025
0075958
set github.ref check back to refs/heads/main
kachulis Feb 6, 2025
4c7ab82
ubuntu versions
kachulis Feb 12, 2025
c97b2e9
.
kachulis Feb 12, 2025
ad16ebf
PRS/ScoreBGE/requirements.txt
kachulis Feb 12, 2025
c53227e
ImputationPipeline --> PRS
kachulis Feb 12, 2025
c9806bc
cupcake comment
kachulis Feb 12, 2025
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
32 changes: 10 additions & 22 deletions .dockstore.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
version: 1.2
workflows:
- name: ImputationWorkflow
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/Imputation.wdl
- name: PRScoringWorkflow
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/ScoringPart.wdl
- name: EndToEndPipeline
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/EndToEndPipeline.wdl
primaryDescriptorPath: /PRS/ScoringPart.wdl
- name: PerformPopulationPCA
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/PerformPopulationPCA.wdl
primaryDescriptorPath: /PRS/PerformPopulationPCA.wdl
- name: BenchmarkVCFs
subclass: WDL
primaryDescriptorPath: /BenchmarkVCFs/BenchmarkVCFs.wdl
Expand All @@ -21,15 +15,9 @@ workflows:
- name: BenchmarkAndCompareVCFs
subclass: WDL
primaryDescriptorPath: /BenchmarkVCFs/BenchmarkAndCompareVCFs.wdl
- name: ValidateImputation
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/Validation/ValidateImputation.wdl
- name: ValidateScoring
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/Validation/ValidateScoring.wdl
- name: FullImputationPRSValidation
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/Validation/FullImputationPRSValidation.wdl
primaryDescriptorPath: /PRS/Validation/ValidateScoring.wdl
- name: FindSamplesAndBenchmark
subclass: WDL
primaryDescriptorPath: /BenchmarkVCFs/FindSamplesAndBenchmark.wdl
Expand All @@ -47,19 +35,19 @@ workflows:
primaryDescriptorPath: /FunctionalEquivalence/FunctionalEquivalence.wdl
- name: PRSWrapper
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/PRSWrapper.wdl
primaryDescriptorPath: /PRS/PRSWrapper.wdl
- name: CKDRiskAdjustment
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/CKDRiskAdjustment.wdl
primaryDescriptorPath: /PRS/CKDRiskAdjustment.wdl
- name: CollectBenchmarkSucceeded
subclass: WDL
primaryDescriptorPath: /Utilities/WDLs/CollectBenchmarkSucceeded.wdl
- name: AggregatePRSResults
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/AggregatePRSResults.wdl
primaryDescriptorPath: /PRS/AggregatePRSResults.wdl
- name: TrainAncestryAdjustmentModel
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/TrainAncestryAdjustmentModel.wdl
primaryDescriptorPath: /PRS/TrainAncestryAdjustmentModel.wdl
- name: Glimpse1Imputation
subclass: WDL
primaryDescriptorPath: /GlimpseImputationPipeline/Glimpse1Imputation.wdl
Expand Down Expand Up @@ -140,13 +128,13 @@ workflows:
primaryDescriptorPath: /Utilities/WDLs/PRSQC.wdl
- name: PCARE
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/PCARE.wdl
primaryDescriptorPath: /PRS/PCARE.wdl
- name: PCAREAndQC
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/PCAREAndQC.wdl
primaryDescriptorPath: /PRS/PCAREAndQC.wdl
- name: ScoreBGE
subclass: WDL
primaryDescriptorPath: /ImputationPipeline/ScoreBGE/ScoreBGE.wdl
primaryDescriptorPath: /PRS/ScoreBGE/ScoreBGE.wdl
- name: BenchmarkSVs
subclass: WDL
primaryDescriptorPath: /BenchmarkSVs/BenchmarkSVs.wdl
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
python -m pip install --upgrade pip
- name: ScoreBGE Unit tests
run: |
pip install -r ImputationPipeline/ScoreBGE/requirements.txt
cd ImputationPipeline/ScoreBGE/tests
pip install -r PRS/ScoreBGE/requirements.txt
cd PRS/ScoreBGE/tests
export PYTHONPATH=$GITHUB_WORKSPACE
python -m unittest test_ScoreBGE.py
96 changes: 96 additions & 0 deletions .github/workflows/test_dockerfiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Dockerfile tests
on:
push:
branches:
- main
pull_request:
paths:
- '**/Dockerfile'
schedule:
- cron: '23 2 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
define_changed_dockerfile_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-dockerfiles.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v4
-
name: Get Changed Dockerfiles
id: changed-dockerfiles
uses: tj-actions/changed-files@v44
with:
matrix: true
files: '**/Dockerfile'
files_ignore: '**/GlimpseImputationPipeline/glimpse_docker/Dockerfile'
- name: List dockerfiles
run: echo '${{ steps.changed-dockerfiles.outputs.all_changed_files}}'

define_all_dockerfile_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.all-dockerfiles.outputs.files}}
steps:
- uses: actions/checkout@v4
-
name: Get all Dockerfiles
id: all-dockerfiles
run: |
{
echo 'files<<EOF'
find . -name "Dockerfile" ! -path "*/GlimpseImputationPipeline/glimpse_docker/*" | jq -R . | jq -s .
echo EOF
} >> "$GITHUB_OUTPUT"
- name: List dockerfiles
run: echo '${{ steps.all-dockerfiles.outputs.files}}'

test_builds:
runs-on: ubuntu-latest
needs: [define_changed_dockerfile_matrix, define_all_dockerfile_matrix]
strategy:
matrix:
dockerfile: ${{ github.ref != 'refs/heads/main' && fromJSON(needs.define_changed_dockerfile_matrix.outputs.matrix) || fromJSON(needs.define_all_dockerfile_matrix.outputs.matrix) }}
fail-fast: false

steps:
- uses: actions/checkout@v4
-
name: Get context
id: get-context
run: |
echo "context=$(dirname ${{ matrix.dockerfile }})" >> $GITHUB_OUTPUT
-
name: Build
uses: docker/build-push-action@v6
with:
context: ${{ steps.get-context.outputs.context }}
file: ${{ matrix.dockerfile }}

test_glimpse_docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
name: Check if Dockerfile has changed
id: check-if-changed
if: ${{ github.ref != 'refs/heads/main' }}
uses: tj-actions/changed-files@v44
with:
files: '**/GlimpseImputationPipeline/glimpse_docker/Dockerfile'
-
name: Build main GLIMPSE Docker
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of testing the build of the docker image? Presumably to test any changes made in the pipeline, one would have to build the docker, upload it, and run the WDL already, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I follow? All of these docker tests are just to make sure they build, not to test whether the build work correctly in the pipelines. The one difference here is that we need to build the glimpse tool docker on it's own and then build the glimpse pipeline docker from that. I believe the reason for doing that was basically to not have to duplicate the glimpse tool docker in our pipeline docker, but still be able to add things to it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I had a hard time understanding the use case where you'd want to update a docker image but not test it actually works or does the updated thing in your pipeline, which seems to be the case this test would help verify. For example, I'm imagining if the image needed an updated version / new tool, wouldn't you also test at the same time that the pipeline still works? Or are you decoupling this check from e.g. just bumping versions of dependencies from time to time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree testing that an updated docker actually does what you want would be even better, but I think that would require automatic build-push (easy) and associated wdl update (more complex but intriguing). For the moment I'm just thinking of this as both a check to catch obvious mistakes, and a check against external changes breaking our Dockerfiles.

if: ${{ github.ref == 'refs/heads/main' || steps.check-if-changed.outputs.all_changed_files_count > 0 }}
run: |
cd GlimpseImputationPipeline/glimpse_docker
./build_base_and_extension_docker.sh -r https://github.com/odelaneau/GLIMPSE.git -t test -b master -y
-
name: Build Extract Num Sites Docker
if: ${{ github.ref == 'refs/heads/main' || steps.check-if-changed.outputs.all_changed_files_count > 0 }}
run: |
cd GlimpseImputationPipeline/glimpse_docker
./build_extract_num_sites_from_reference_chunk_docker.sh -y -r https://github.com/michaelgatzen/GLIMPSE.git -t test -b master


113 changes: 0 additions & 113 deletions ImputationPipeline/EndToEndPipeline.wdl

This file was deleted.

Loading
Loading