From b8602a93081975e3226aa4e60d87cba7580bd01d Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Thu, 2 Nov 2023 15:11:47 -0700 Subject: [PATCH] Optimize docker image build process - Run affymetrix/agilent tests in parallel - Set file permissions to 644 while copying - Set directory permissions to 755 - Exclude unnecessary files vie dockerignore --- .dockerignore | 19 +++++++------ .github/workflows/config.yml | 2 +- api/dockerfiles/Dockerfile.api | 3 +- api/dockerfiles/Dockerfile.api_base | 19 +++++++++---- common/dockerfiles/Dockerfile.base | 10 +++++-- common/dockerfiles/Dockerfile.common_tests | 13 ++++++--- common/dockerfiles/Dockerfile.migrations | 9 ++++-- foreman/dockerfiles/Dockerfile.foreman | 20 +++++++++---- workers/dockerfiles/Dockerfile.affymetrix | 28 +++++++++++------- workers/dockerfiles/Dockerfile.compendia | 28 +++++++++++------- workers/dockerfiles/Dockerfile.downloaders | 26 +++++++++++------ workers/dockerfiles/Dockerfile.illumina | 30 ++++++++++++-------- workers/dockerfiles/Dockerfile.no_op | 26 ++++++++++------- workers/dockerfiles/Dockerfile.salmon | 22 ++++++++------ workers/dockerfiles/Dockerfile.smasher | 26 ++++++++++------- workers/dockerfiles/Dockerfile.transcriptome | 20 ++++++++----- 16 files changed, 191 insertions(+), 110 deletions(-) diff --git a/.dockerignore b/.dockerignore index c2205b57e..41934125e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,15 +1,16 @@ -.git -*/batch-job-specs -*/test_volume -*/volume +**/.git +**/__pycache__ +**/*.pyc +**/batch-job-templates +**/dockerfiles +**/environments +**/test_volume +**/volume +**/volumes_postgres config/externally_supplied_metadata/metasra/*.tab config/externally_supplied_metadata/metasra/metasra_keywords.json config/externally_supplied_metadata/metasra/metasra_translated.json config/externally_supplied_metadata/metasra/SRAmetadb.sqlite dr_env env/ -infrastructure/ -terraform/ -test_volume -volume -volumes_postgres/ +infrastructure diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index bd9fe259c..7b5d96fde 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -85,7 +85,7 @@ jobs: env: IMAGES: migrations affymetrix needs: - - test_affymetrix + - test_base runs-on: ubuntu-latest-m steps: - uses: actions/checkout@v3 diff --git a/api/dockerfiles/Dockerfile.api b/api/dockerfiles/Dockerfile.api index 292d1149a..3fd03b67b 100644 --- a/api/dockerfiles/Dockerfile.api +++ b/api/dockerfiles/Dockerfile.api @@ -8,8 +8,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN <> /home/user/.gnupg/dirmngr.conf . /home/user/rvm/scripts/rvm @@ -34,13 +36,19 @@ EOF USER root # Get the latest version from the dist directory. -COPY common/dist/data-refinery-common-* common/ -RUN pip3 install --ignore-installed --no-cache-dir common/$(ls common -1 | sort --version-sort | tail -1) +COPY --chmod=644 common/dist/data-refinery-common-* common/ +RUN < /etc/identifier_refinery_url wget $ID_REFINERY_URL @@ -29,13 +29,19 @@ EOF WORKDIR /home/user # Get the latest version from the dist directory. -COPY common/dist/data-refinery-common-* common/ -RUN pip3 install --ignore-installed --no-cache-dir common/$(ls common -1 | sort --version-sort | tail -1) +COPY --chmod=644 common/dist/data-refinery-common-* common/ +RUN <