From 9da5a80bf4754b38d88a9beb1c6ca92fe704f77c Mon Sep 17 00:00:00 2001 From: Trevor Royer Date: Thu, 5 Sep 2024 09:14:13 -0700 Subject: [PATCH] update dev build process --- .github/workflows/build-image-dev.yml | 68 +++++++-------------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-image-dev.yml b/.github/workflows/build-image-dev.yml index ebb90bb..c7269d7 100644 --- a/.github/workflows/build-image-dev.yml +++ b/.github/workflows/build-image-dev.yml @@ -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 }}