Skip to content

Commit

Permalink
update dev build process
Browse files Browse the repository at this point in the history
  • Loading branch information
strangiato committed Sep 5, 2024
1 parent bfe62a2 commit 9da5a80
Showing 1 changed file with 17 additions and 51 deletions.
68 changes: 17 additions & 51 deletions .github/workflows/build-image-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,21 @@ on:
- 'mlflow-server/**'

jobs:

build:
name: Build Image
runs-on: ubuntu-22.04
env:
BASE_IMAGE: 'registry.access.redhat.com/ubi9/python-311:latest'
REGISTRY: quay.io/troyer
IMAGE_NAME: mlflow-server
MAIN_TAG: latest-dev

steps:

- name: Checkout
uses: actions/checkout@v2

# Setup S2i and Build container image
- name: Setup and Build
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: 'mlflow-server'
builder_image: ${{ env.BASE_IMAGE }}
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.MAIN_TAG }}
- name: Retrieve version
uses: addnab/docker-run-action@v3
with:
image: ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }}
run: |
FULL_VERSION=$(pip show mlflow | grep -i version | awk '{print $2}')
major=`echo $FULL_VERSION | cut -d. -f1`
minor=`echo $FULL_VERSION | cut -d. -f2`
revision=`echo $FULL_VERSION | cut -d. -f3`
MINOR_VERSION=$(echo "$major.$minor")
echo "::set-output name=FULL_VERSION::${FULL_VERSION}"
echo "::set-output name=MINOR_VERSION::${MINOR_VERSION}"
id: version
get-version:
uses: ./.github/workflow-get-package-version.yaml
with:
context: "mlflow-server"
package: mlflow

- name: Add tags
run: |
docker tag ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }} ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.FULL_VERSION }}-dev
docker tag ${{ env.IMAGE_NAME }}:${{ env.MAIN_TAG }} ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.MINOR_VERSION }}-dev
# Push Image to Quay registry
- name: Push To Quay Action
uses: redhat-actions/push-to-registry@v2.7
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }} ${{ steps.version.outputs.FULL_VERSION }}-dev ${{ steps.version.outputs.MINOR_VERSION }}-dev
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
build:
uses: ./.github/workflows/workflow-build-image.yaml
needs: get-version
with:
registry: quay.io/troyer
image-name: mlflow-server
context: "mlflow-server"
version: ${{ needs.get-version.outputs.package-version }}
tag-suffix: "-dev"
secrets:
registry-username: ${{ secrets.QUAY_USERNAME }}
registry-password: ${{ secrets.QUAY_PASSWORD }}

0 comments on commit 9da5a80

Please sign in to comment.