Skip to content
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

chore: upgrade api-server Rock to 2.3.0 #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions api-server/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Dockerfile: https://github.com/kubeflow/pipelines/blob/2.2.0/backend/Dockerfile
# Dockerfile: https://github.com/kubeflow/pipelines/blob/2.3.0/backend/Dockerfile
name: api-server
summary: An image for using Kubeflow pipelines API
description: An image for using Kubeflow pipelines API
version: "2.2.0"
base: ubuntu@20.04
version: "2.3.0"
base: ubuntu@22.04
license: Apache-2.0
platforms:
amd64:
Expand All @@ -19,7 +19,6 @@ services:


package-repositories:
# Required for build-packages=python3.7
- type: apt
ppa: deadsnakes/ppa
priority: always
Expand All @@ -34,7 +33,7 @@ parts:
builder:
plugin: go
source: https://github.com/kubeflow/pipelines.git
source-tag: 2.2.0
source-tag: 2.3.0
build-snaps:
- go/1.21/stable
build-environment:
Expand All @@ -58,15 +57,15 @@ parts:
compiler:
plugin: nil
source: https://github.com/kubeflow/pipelines.git
source-tag: 2.2.0
source-tag: 2.3.0
build-environment:
- ARGO_VERSION: v3.4.16
- ARGO_VERSION: v3.4.17
build-packages:
- default-jdk
- python3.7
- python3.8
# required to build google-cloud-profiler wheel for pyproject.toml-based projects
- python3.7-dev
- python3.7-distutils
- python3.8-dev
- python3.8-distutils
- jq
- wget

Expand All @@ -77,12 +76,11 @@ parts:
rm -rf ./*

# Create a symbolic link so the rest of this script is like upstream
ln -s /usr/bin/python3.7 python3
ln -s /usr/bin/python3.8 python3
PATH=.:$PATH

# Setup pip
# This is required because the stage environment uses Python3.7. Do not update unless the upstream Dockerfile does.
wget https://bootstrap.pypa.io/pip/3.7/get-pip.py && python3 get-pip.py
wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py

cp $CRAFT_PART_SRC/backend/requirements.txt .
python3 -m pip install -r requirements.txt --no-cache-dir
Expand Down Expand Up @@ -111,7 +109,7 @@ parts:
after: [builder, compiler]
plugin: nil
source: https://github.com/kubeflow/pipelines.git
source-tag: 2.2.0
source-tag: 2.3.0
build-packages:
- ca-certificates
- wget
Expand Down
44 changes: 44 additions & 0 deletions api-server/tests/test_rock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
import pytest
import subprocess

from charmed_kubeflow_chisme.rock import CheckRock


@pytest.mark.abort_on_fail
def test_rock():
"""Test rock."""
check_rock = CheckRock("rockcraft.yaml")
rock_image = check_rock.get_name()
rock_version = check_rock.get_version()
LOCAL_ROCK_IMAGE = f"{rock_image}:{rock_version}"

# assert the rock contains the expected files
subprocess.run(
[
"docker",
"run",
"--rm",
"--entrypoint",
"/bin/bash",
LOCAL_ROCK_IMAGE,
"-c",
"ls -la /bin/apiserver",
],
check=True,
)

subprocess.run(
[
"docker",
"run",
"--rm",
"--entrypoint",
"/bin/bash",
LOCAL_ROCK_IMAGE,
"-c",
"ls -la /samples",
],
check=True,
)
9 changes: 5 additions & 4 deletions api-server/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ commands =

[testenv:sanity]
passenv = *
allowlist_externals =
echo
deps =
pytest
charmed-kubeflow-chisme
commands =
# TODO: Implement sanity tests
echo "WARNING: This is a placeholder test - no test is implemented here."
# run rock tests
pytest -s -v --tb native --show-capture=all --log-cli-level=INFO {posargs} {toxinidir}/tests

[testenv:integration]
passenv = *
Expand Down
Loading