Skip to content

Commit

Permalink
Merge pull request #8 from KIT-CMS/add_hash_PR
Browse files Browse the repository at this point in the history
Add short commit hash to built image names to keep them apart
  • Loading branch information
tvoigtlaender authored Jul 13, 2024
2 parents 3e231e6 + 8188fce commit 31eb58c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 21 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/deploy-base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: Build base (with ROOT) Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
paths:
- KingMaker_envs/Base_env.yml
- '*/Dockerfile'
branches:
- '**'

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -27,6 +26,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -46,7 +48,7 @@ jobs:
context: .
file: centos7/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-RHEL9:
Expand All @@ -57,6 +59,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -76,7 +81,7 @@ jobs:
context: .
file: rhel9/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-Ubuntu2204:
Expand All @@ -87,6 +92,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -106,5 +114,5 @@ jobs:
context: .
file: ubuntu2204/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}
20 changes: 14 additions & 6 deletions .github/workflows/deploy-kingmaker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: Build kingmaker Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
paths:
- 'KingMaker_envs/KingMaker_env.yml'
- '*/Dockerfile'
branches:
- '**'

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -27,6 +26,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -46,7 +48,7 @@ jobs:
context: .
file: centos7/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-RHEL9:
Expand All @@ -57,6 +59,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -76,7 +81,7 @@ jobs:
context: .
file: rhel9/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-Ubuntu2204:
Expand All @@ -87,6 +92,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -106,5 +114,5 @@ jobs:
context: .
file: ubuntu2204/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}
20 changes: 14 additions & 6 deletions .github/workflows/deploy-ml_law-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: Build ml-law Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
paths:
- KingMaker_envs/ML_LAW_env.yml
- '*/Dockerfile'
branches:
- '**'

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -27,6 +26,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -46,7 +48,7 @@ jobs:
context: .
file: centos7/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-RHEL9:
Expand All @@ -57,6 +59,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -76,7 +81,7 @@ jobs:
context: .
file: rhel9/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}

Build-Ubuntu2204:
Expand All @@ -87,6 +92,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get short hash of the current commit
id: get_short_hash
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -106,5 +114,5 @@ jobs:
context: .
file: ubuntu2204/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}_${{ steps.get_short_hash.outputs.short_hash }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions KingMaker_envs/KingMaker_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,4 @@ dependencies:
- werkzeug==3.0.3
- yarl==1.9.4
- zipp==3.19.2

2 changes: 1 addition & 1 deletion centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ RUN echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate ${ENV_NAME}" >


ENTRYPOINT ["tini", "--"]
CMD [ "/bin/bash" ]
CMD [ "/bin/bash" ]
2 changes: 1 addition & 1 deletion rhel9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ RUN echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate ${ENV_NAME}" >


ENTRYPOINT ["tini", "--"]
CMD [ "/bin/bash" ]
CMD [ "/bin/bash" ]
2 changes: 1 addition & 1 deletion ubuntu2204/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ RUN echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate ${ENV_NAME}" >
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate ${ENV_NAME}" >> ~/.bashrc

ENTRYPOINT ["tini", "--"]
CMD [ "/bin/bash" ]
CMD [ "/bin/bash" ]

0 comments on commit 31eb58c

Please sign in to comment.