Skip to content

"Community and custom models" section should be hidden if there are no catalog sources without labels #5649

"Community and custom models" section should be hidden if there are no catalog sources without labels

"Community and custom models" section should be hidden if there are no catalog sources without labels #5649

Workflow file for this run

name: Python workflows
on:
push:
branches:
- "main"
workflow_dispatch:
pull_request:
paths-ignore:
- "LICENSE*"
- "**.gitignore"
- "**.md"
- "**.txt"
- ".github/ISSUE_TEMPLATE/**"
- ".github/dependabot.yml"
- "docs/**"
permissions: # set contents: read at top-level, per OpenSSF ScoreCard rule TokenPermissionsID
contents: read
jobs:
lint:
name: ${{ matrix.session }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12"]
session: [lint, mypy]
env:
NOXSESSION: ${{ matrix.session }}
FORCE_COLOR: "1"
steps:
- name: Check out the repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Install Poetry
# use absolute path as recommended with: https://github.com/pypa/pipx/issues/1331
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
nox --version
- name: Nox lint
working-directory: clients/python
run: |
if [[ ${{ matrix.session }} == "mypy" ]]; then
nox --python=${{ matrix.python }} ||\
echo "::error title='mypy failure'::Check the logs for more details"
else
nox --python=${{ matrix.python }}
fi
check-autogen:
name: Check autogenerated code is in sync
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12"]
nodejs: ["20"]
steps:
- name: Check out the repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.nodejs }}
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install openapi-generator-cli
run: |
make bin/openapi-generator-cli
- name: Generate Python client
working-directory: clients/python
run: |
make clean install tidy
- name: Check if there are uncommitted file changes
run: |
clean=$(git status --porcelain)
if [[ -z "$clean" ]]; then
echo "Empty git status --porcelain: $clean"
else
echo "Uncommitted file changes detected: $clean"
git diff
exit 1
fi
test:
name: E2E Py ${{ matrix.python }} K8s ${{ matrix.kubernetes-version }} DB ${{ matrix.manifest-db }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12"] # see below for versions 3.9-3.11
kubernetes-version:
["v1.27.11", "v1.28.7", "v1.29.2", "v1.30.6", "v1.31.0"]
manifest-db: ["db", "postgres"] # subdirectory of manifests/kustomize/overlays to select which database: 'db' (MySQL) or 'postgres'
exclude: # on main merges (not PRs), use also different K8s versions for E2E testing
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.28.7' }}
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.29.2' }}
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.30.6' }}
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.31.0' }}
include: # test Py versions only with a reference K8s version, designated currently to kubernetes-version: v1.27.11
- python: "3.11"
kubernetes-version: "v1.27.11"
manifest-db: "db"
- python: "3.10"
kubernetes-version: "v1.27.11"
manifest-db: "db"
- python: "3.9"
kubernetes-version: "v1.27.11"
manifest-db: "db"
env:
FORCE_COLOR: "1"
IMG_REGISTRY: ghcr.io
IMG_ORG: kubeflow
IMG_REPO: model-registry
DEPLOY_MANIFEST_DB: "${{ matrix.manifest-db }}"
steps:
- name: Check out the repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Install Poetry
# use absolute path as recommended with: https://github.com/pypa/pipx/issues/1331
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
nox --version
- name: Install Storage Clients
# Oras should be available in the GH Action CI by default
# See: https://oras.land/docs/installation/#runner-machine-of-azure-devops-and-github-actions
run: |
sudo apt-get -y install skopeo
- name: Nox test
working-directory: clients/python
run: |
nox --python=${{ matrix.python }} --session=tests
- name: Generate Tag
shell: bash
id: tags
run: |
commit_sha=${{ github.event.after }}
tag=main-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build Image
shell: bash
env:
IMG_VERSION: ${{ steps.tags.outputs.tag }}
run: make image/build
- name: Start Kind Cluster
uses: helm/kind-action@v1.13.0
with:
node_image: kindest/node:${{ matrix.kubernetes-version }}
cluster_name: chart-testing-py-${{ matrix.python }}
kubectl_version: ${{ matrix.kubernetes-version }}
- name: Remove AppArmor profile for mysql in KinD on GHA # https://github.com/kubeflow/manifests/issues/2507
run: |
set -x
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: Load Local Registry Test Image
env:
IMG: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}"
run: |
kind load docker-image -n chart-testing-py-${{ matrix.python }} ${IMG}
- name: Deploy Model Registry using manifests
env:
IMG: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}"
run: ./scripts/deploy_on_kind.sh
- name: Deploy Minio using manifests
run: |
./scripts/deploy_minio_on_kind.sh
cat ./scripts/manifests/minio/.env >> $GITHUB_ENV
- name: Deploy OCI Registry using manifests
run: ./scripts/deploy_local_kind_registry.sh
- name: Nox test end-to-end
working-directory: clients/python
run: |
kubectl port-forward -n kubeflow service/model-registry-service 8080:8080 &
kubectl port-forward -n minio svc/minio 9000:9000 &
kubectl port-forward service/distribution-registry-test-service 5001:5001 &
sleep 2
nox --python=${{ matrix.python }} --session=e2e -- --cov-report=xml
- name: Nox test fuzz (main only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
working-directory: clients/python
run: |
kubectl port-forward -n kubeflow service/model-registry-service 8080:8080 &
kubectl port-forward -n minio svc/minio 9000:9000 &
kubectl port-forward service/distribution-registry-test-service 5001:5001 &
sleep 2
nox --python=${{ matrix.python }} --session=fuzz
docs-build:
name: ${{ matrix.session }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12"]
session: [docs-build]
env:
NOXSESSION: ${{ matrix.session }}
FORCE_COLOR: "1"
steps:
- name: Check out the repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Install Poetry
# use absolute path as recommended with: https://github.com/pypa/pipx/issues/1331
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
nox --version
- name: Run Nox
working-directory: clients/python
run: |
nox --python=${{ matrix.python }}
poetry build
- name: Upload dist
uses: actions/upload-artifact@v5
with:
name: py-dist
path: clients/python/dist
- name: Upload documentation
uses: actions/upload-artifact@v5
with:
name: py-docs
path: clients/python/docs/_build