Skip to content

Commit cbc406f

Browse files
committed
push staging images on tags/release
change image names to be standards fix nvcr dockerfile Signed-off-by: Dushyant Behl <dushyantbehl@in.ibm.com>
1 parent d4999cb commit cbc406f

5 files changed

Lines changed: 51 additions & 28 deletions

File tree

.github/workflows/dev-image.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: ./.github/actions/free-up-disk-space
1515
- name: Build NVCR dev Image
1616
run: |
17-
docker build -t fms-hf-tuning-dev:latest . -f build/nvcr.Dockerfile
17+
docker build -t fms-hf-tuning:main-nvcr-latest . -f build/nvcr.Dockerfile
1818
- name: Login to Quay.io
1919
if: github.event_name == 'push'
2020
uses: docker/login-action@v3
@@ -25,4 +25,4 @@ jobs:
2525
- name: Push docker image for every commit to Quay.io as dev images
2626
if: github.event_name == 'push'
2727
run: |
28-
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning-dev:latest
28+
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:main-nvcr-latest

.github/workflows/release-image.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ jobs:
1414
uses: ./.github/actions/free-up-disk-space
1515
- name: Build UBI9 Prod Image
1616
run: |
17-
docker build -t fms-hf-tuning:latest . -f build/Dockerfile
17+
docker build \
18+
-t fms-hf-tuning:ubi9-latest \
19+
-t fms-hf-tuning:release-ubi9-latest \
20+
-f build/Dockerfile .
1821
- name: Login to Quay.io
1922
if: github.event_name == 'push'
2023
uses: docker/login-action@v3
@@ -25,4 +28,5 @@ jobs:
2528
- name: Push docker image to Quay.io
2629
if: github.event_name == 'push'
2730
run: |
28-
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:latest
31+
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:ubi9-latest
32+
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:release-ubi9-latest
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: dev-image
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: "Free up disk space"
15+
uses: ./.github/actions/free-up-disk-space
16+
- name: Determine image tag
17+
id: tag
18+
run: |
19+
if [ "${{ github.event_name }}" = "release" ]; then
20+
TAG="${{ github.event.release.tag_name }}"
21+
elif [ "${{ github.ref_type }}" = "tag" ]; then
22+
TAG="${GITHUB_REF_NAME}"
23+
else
24+
TAG="dev"
25+
fi
26+
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
27+
- name: Build image
28+
run: |
29+
docker build \
30+
-t fms-hf-tuning:${IMAGE_TAG}-nvcr \
31+
-t fms-hf-tuning:staging-nvcr-latest \
32+
-f build/nvcr.Dockerfile .
33+
- name: Login to Quay.io
34+
uses: docker/login-action@v3
35+
with:
36+
registry: quay.io
37+
username: ${{ secrets.QUAY_USERNAME }}
38+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
39+
- name: Push docker image to Quay.io
40+
run: |
41+
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:staging-nvcr-latest
42+
docker push ${{ env.QUAY_REPOSITORY }}/fms-hf-tuning:${IMAGE_TAG}-nvcr

build/nvcr.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ RUN pip install --upgrade --force-reinstall torch torchaudio torchvision --index
4848
COPY . ${SOURCE_DIR}
4949
RUN cd ${SOURCE_DIR}
5050

51+
RUN pip install --upgrade pip setuptools wheel
5152
RUN pip install --no-cache-dir ${SOURCE_DIR}
5253
RUN pip install --user --no-build-isolation ${SOURCE_DIR}[flash-attn]
5354

0 commit comments

Comments
 (0)