Skip to content

Commit 022a241

Browse files
committed
update prod build process
1 parent 105bcac commit 022a241

File tree

1 file changed

+17
-53
lines changed

1 file changed

+17
-53
lines changed

.github/workflows/build-image.yml

+17-53
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,21 @@ on:
88
- 'mlflow-server/**'
99

1010
jobs:
11-
12-
build:
13-
name: Build Image
14-
runs-on: ubuntu-latest
15-
env:
16-
BASE_IMAGE: 'registry.access.redhat.com/ubi9/python-311:latest'
17-
REGISTRY: quay.io/troyer
18-
IMAGE_NAME: mlflow-server
19-
MAIN_TAG: latest-dev
20-
21-
steps:
22-
23-
- name: Checkout
24-
uses: actions/checkout@v2
25-
26-
# Setup S2i and Build container image
27-
- name: Setup and Build
28-
id: build_image
29-
uses: redhat-actions/s2i-build@v2
30-
with:
31-
path_context: 'mlflow-server'
32-
builder_image: ${{ env.BASE_IMAGE }}
33-
image: ${{ env.IMAGE_NAME }}
34-
tags: ${{ env.MAIN_TAG }}
11+
get-version:
12+
uses: ./.github/workflows/workflow-get-package-version.yaml
13+
with:
14+
context: "mlflow-server"
15+
package: mlflow
3516

36-
- name: Retrieve version
37-
uses: addnab/docker-run-action@v3
38-
with:
39-
image: ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }}
40-
run: |
41-
FULL_VERSION=$(pip show mlflow | grep -i version | awk '{print $2}')
42-
major=`echo $FULL_VERSION | cut -d. -f1`
43-
minor=`echo $FULL_VERSION | cut -d. -f2`
44-
revision=`echo $FULL_VERSION | cut -d. -f3`
45-
MINOR_VERSION=$(echo "$major.$minor")
46-
echo "::set-output name=FULL_VERSION::${FULL_VERSION}"
47-
echo "::set-output name=MINOR_VERSION::${MINOR_VERSION}"
48-
id: version
49-
50-
- name: Add tags
51-
run: |
52-
docker tag ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }} ${{ env.IMAGE_NAME }}:latest
53-
docker tag ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }} ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.FULL_VERSION }}
54-
docker tag ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }} ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.MINOR_VERSION }}
55-
56-
# Push Image to Quay registry
57-
- name: Push To Quay Action
58-
uses: redhat-actions/push-to-registry@v2
59-
with:
60-
image: ${{ steps.build_image.outputs.image }}
61-
tags: ${{ steps.build_image.outputs.tags }} latest ${{ steps.version.outputs.FULL_VERSION }} ${{ steps.version.outputs.MINOR_VERSION }}
62-
registry: ${{ env.REGISTRY }}
63-
username: ${{ secrets.QUAY_USERNAME }}
64-
password: ${{ secrets.QUAY_PASSWORD }}
17+
build:
18+
uses: ./.github/workflows/workflow-build-image.yaml
19+
needs: get-version
20+
with:
21+
registry: quay.io/troyer
22+
image-name: mlflow-server
23+
context: "mlflow-server"
24+
version-tag: ${{ needs.get-version.outputs.package-version }}
25+
tag-suffix: ""
26+
secrets:
27+
registry-username: ${{ secrets.QUAY_USERNAME }}
28+
registry-password: ${{ secrets.QUAY_PASSWORD }}

0 commit comments

Comments
 (0)