-
Notifications
You must be signed in to change notification settings - Fork 3
training pipeline reorder #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9051318
ignore train-workflow.yaml since it's generated by train-workflow.py
Hadar301 71c3b99
add new container file and explanations why it's needed
Hadar301 736bae6
change images
Hadar301 f784dcc
use the commit as a tag and push to quay.io/ecosystem-appeng/rec-sys…
Hadar301 ab538f2
reformat the code with ruff
Hadar301 68c94f7
Update README.md
Hadar301 85957c4
Update build-and-push.yml
Hadar301 ed2ec82
Update build-and-push.yml
Hadar301 dd43af2
update build and push and create a new ci for the new image under oc-…
Hadar301 b078ed3
work with rh-ai-kickstart organization on quay.io
Hadar301 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Build and push - model registry image | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| PROJECT_DIR: "." | ||
|
|
||
| jobs: | ||
| build-and-push-image: | ||
| name: Build and Push container image | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - name: rec-sys-model-registry | ||
| context: oc-tools | ||
| image-name: rec-sys-model-registry | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Quay.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: quay.io | ||
| username: ${{ secrets.QUAY_USERNAME }} | ||
| password: ${{ secrets.QUAY_PASSWORD }} | ||
|
|
||
| - name: Set version from last commit hash | ||
| id: version | ||
| run: | | ||
| echo "tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build and push ${{ matrix.name }} | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ${{ matrix.context }} | ||
| file: Containerfile | ||
| push: true | ||
| tags: | | ||
| quay.io/rh-ai-kickstart/${{ matrix.image-name }}:${{ steps.version.outputs.tag }} | ||
| quay.io/rh-ai-kickstart/${{ matrix.image-name }}:latest | ||
| build-args: | | ||
| IMAGE_TAG=${{ steps.version.outputs.tag }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| FROM python:3.11-slim | ||
| WORKDIR /app | ||
| # Install curl and tar for downloading oc, then install oc CLI | ||
| RUN apt-get update && \ | ||
| apt-get install -y curl tar jq && \ | ||
| curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz | tar -xz -C /usr/local/bin oc && \ | ||
| chmod +x /usr/local/bin/oc && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
| # Install Python dependencies | ||
| RUN pip install --upgrade pip && \ | ||
| pip install --no-cache-dir model_registry==0.2.21 | ||
|
Hadar301 marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # OpenShift CLI Tools Container | ||
|
|
||
| This container image provides OpenShift CLI tools and utilities needed for cluster credential management in the recommendation system workflow. | ||
|
|
||
| ## Purpose | ||
|
|
||
| This specialized image is used by the `fetch_cluster_credentials` component in the Kubeflow pipeline to: | ||
| - Authenticate with the OpenShift cluster | ||
| - Retrieve user tokens and cluster information | ||
| - Get Model Registry service endpoints | ||
| - Extract routing information for external services | ||
|
|
||
| ## Contents | ||
|
|
||
| ### Tools Included | ||
| - **OpenShift CLI (`oc`)** - Latest version from OpenShift mirror | ||
| - **jq** - JSON processor for parsing API responses | ||
| - **curl** - For downloading the OpenShift CLI | ||
| - **tar** - For extracting downloaded archives | ||
|
|
||
| ### Python Base | ||
| - **Python 3.11-slim** - Minimal Python runtime | ||
| - **model_registry** - Python package for model registry operations (installed via pip at runtime) | ||
|
|
||
| ## Usage in Pipeline | ||
|
|
||
| This image is used by the `fetch_cluster_credentials()` function in `train-workflow.py` | ||
|
|
||
| ## Building the Image | ||
|
|
||
| ```bash | ||
| # From the oc-tools/ directory | ||
| podman build --platform linux/amd64 -t quay.io/ecosystem-appeng/model-registry . | ||
| # Push to registry | ||
| podman push quay.io/ecosystem-appeng/model-registry:latest | ||
| ``` | ||
|
|
||
| ## Why Separate from Base Image? | ||
|
|
||
| This image is kept separate from the main `BASE_IMAGE` because: | ||
|
|
||
| 1. **Security Isolation** - OpenShift CLI tools have cluster access privileges | ||
| 2. **Image Size** - ML workloads don't need cluster management tools | ||
| 3. **Separation of Concerns** - Infrastructure operations vs. ML operations | ||
| 4. **Maintenance** - Can update OC tools independently of ML dependencies | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| The component using this image expects these environment variables: | ||
| - `MODEL_REGISTRY_NAMESPACE` - Namespace where model registry is deployed | ||
| - `MODEL_REGISTRY_CONTAINER` - Name of the model registry service | ||
|
|
||
| ## Dependencies | ||
|
|
||
| This image requires the pod to have: | ||
| - ServiceAccount with cluster read permissions | ||
| - Access to the OpenShift API server | ||
| - Network connectivity to model registry services | ||
|
|
||
| ## Related Components | ||
|
|
||
| - `registry_model_to_model_registry()` - Consumes the credentials from this component | ||
| - `train_model()` - Provides model artifacts to be registered |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you changed the
Containerfilelocation, you will need to update the build path in the CI as well.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a change in the
Containerfilelocation, it's a new one, the thing is, that this image does not rely on our code or anything from our repo, we simply need an image that has openshift client with additional properties. |Do you think we should build it each time the build and push is triggered?