Skip to content

Commit

Permalink
fix: update image build and push to handle tags, fixes RHOAIENG-2300 (k…
Browse files Browse the repository at this point in the history
…ubeflow#276)

* chore: rename directory doc to docs

* fix: update image build and push to handle tags, fixes RHOAIENG-2300

* fix: fix links to docs
  • Loading branch information
dhirajsb authored Jan 27, 2024
1 parent 9787f7c commit 6456367
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 57 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Container image build and tag

on:
push:
branches:
- 'main'
tags:
- 'v*'
paths-ignore:
- 'LICENSE*'
- '**.gitignore'
- '**.md'
- '**.txt'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- 'docs/**'

env:
QUAY_ORG: opendatahub
QUAY_IMG_REPO: model-registry
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
PUSH_IMAGE: true

jobs:
build-image:
runs-on: ubuntu-latest
steps:
# Assign context variable for various action contexts (tag, main, CI)
- name: Assigning tag context
if: github.head_ref == '' && startsWith(github.ref, 'refs/tags/v')
run: echo "BUILD_CONTEXT=tag" >> $GITHUB_ENV
- name: Assigning main context
if: github.head_ref == '' && github.ref == 'refs/heads/main'
run: echo "BUILD_CONTEXT=main" >> $GITHUB_ENV
# checkout branch
- uses: actions/checkout@v4
# set image version
- name: Set main-branch environment
if: env.BUILD_CONTEXT == 'main'
run: |
commit_sha=${{ github.event.after }}
tag=main-${commit_sha:0:7}
echo "VERSION=${tag}" >> $GITHUB_ENV
- name: Set tag environment
if: env.BUILD_CONTEXT == 'tag'
run: |
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Build and Push Image
shell: bash
run: ./scripts/build_deploy.sh
- name: Tag Latest
if: env.BUILD_CONTEXT == 'main'
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.QUAY_IMG_REPO }}
BUILD_IMAGE: false
run: |
docker tag ${{ env.IMG }}:$VERSION ${{ env.IMG }}:latest
# BUILD_IMAGE=false skip the build
./scripts/build_deploy.sh
- name: Tag Main
if: env.BUILD_CONTEXT == 'main'
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.QUAY_IMG_REPO }}
BUILD_IMAGE: false
run: |
docker tag ${{ env.IMG }}:$VERSION ${{ env.IMG }}:main
# BUILD_IMAGE=false skip the build
./scripts/build_deploy.sh
53 changes: 0 additions & 53 deletions .github/workflows/build-image-main.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ As all the wheels are x86 specific: https://pypi.org/project/ml-metadata/1.14.0/

So it's not even possible to receive code assists. However, after clicking to re-open the project inside an (emulated) DevContainer:

![](doc/Screenshot%202023-11-29%20at%2014.08.12.png)
![](docs/Screenshot%202023-11-29%20at%2014.08.12.png)

Then with the given setup MLMD is already installed inside the DevContainer:

![](doc/Screenshot%202023-11-29%20at%2014.10.14.png)
![](docs/Screenshot%202023-11-29%20at%2014.10.14.png)

At this point Poetry is already installed as well and can be used to build and run test of the Model Registry Python client.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It provides a model registry domain-specific [api](internal/core/api.go) that is

### Model registry library

For more background on Model Registry Go core library and instructions on using it, please check [getting started guide](./doc/mr_go_library.md).
For more background on Model Registry Go core library and instructions on using it, please check [getting started guide](./docs/mr_go_library.md).

## Development

Expand Down Expand Up @@ -114,7 +114,7 @@ When shutting down the docker compose, you might want to clean-up the SQLite db

The following diagram illustrate testing strategy for the several components in Model Registry project:

![](/doc/Model%20Registry%20Testing%20areas.png)
![](/docs/Model%20Registry%20Testing%20areas.png)

Go layers components are tested with Unit Tests written in Go, as well as Integration Tests leveraging Testcontainers.
This allows to verify the expected "Core layer" of logical data mapping developed implemented in Go, matches technical expectations.
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit 6456367

Please sign in to comment.