Skip to content

Commit 538e44a

Browse files
authored
Merge branch 'opendatahub-io:main' into main
2 parents 84aa29f + 9fe8c0e commit 538e44a

73 files changed

Lines changed: 4850 additions & 1046 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ reviews:
3232
auto_review:
3333
enabled: true
3434
auto_incremental_review: true
35-
ignore_title_keywords: []
35+
ignore_title_keywords: ['wip', 'do not merge', 'do not review',
36+
'lock file maintenance', 'pre-commit autoupdate']
3637
labels: []
3738
drafts: false
3839
base_branches: []

.github/workflows/scripts/constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
f"{LABEL_PREFIX}{LGTM_LABEL_STR}",
1919
f"{LABEL_PREFIX}{VERIFIED_LABEL_STR}",
2020
f"{LABEL_PREFIX}{HOLD_LABEL_STR}",
21+
f"{LABEL_PREFIX}build-push-pr-image",
22+
f"{LABEL_PREFIX}cherry-pick",
2123
}
2224

2325
CANCEL_ACTION: str = "cancel"
@@ -38,7 +40,7 @@
3840
`verified` label removed on each new commit push.
3941
* To Cherry-pick a merged PR `/cherry-pick <target_branch_name>` to the PR. If <target_branch_name> is valid,
4042
and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
41-
* To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
43+
* To build and push image to quay, add `/build-push-pr-image` in a comment. This would create an image with tag
4244
pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
4345
4446
<details>

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: check-toml
2020

2121
- repo: https://github.com/PyCQA/flake8
22-
rev: "7.2.0"
22+
rev: "7.3.0"
2323
hooks:
2424
- id: flake8
2525
args: [--config=.flake8]
@@ -35,7 +35,7 @@ repos:
3535
- id: detect-secrets
3636

3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.11.13
38+
rev: v0.12.0
3939
hooks:
4040
- id: ruff
4141
- id: ruff-format
@@ -54,7 +54,7 @@ repos:
5454
- id: gitleaks
5555

5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: v1.16.0
57+
rev: v1.16.1
5858
hooks:
5959
- id: mypy
6060
additional_dependencies: ["types-PyYAML", "types-requests"]

Dockerfile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ RUN apt-get update \
1717
&& apt-get autoremove --yes \
1818
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
1919

20-
# Install the Rosa CLI
21-
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output /tmp/rosa-linux.tar.gz \
22-
&& tar xvf /tmp/rosa-linux.tar.gz --no-same-owner \
23-
&& mv rosa /usr/bin/rosa \
24-
&& chmod +x /usr/bin/rosa \
25-
&& rosa version
26-
27-
# Install the OpenShift CLI (OC)
28-
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz --output /tmp/openshift-client-linux.tar.gz \
29-
&& tar xvf /tmp/openshift-client-linux.tar.gz --no-same-owner \
30-
&& mv oc /usr/bin/oc \
31-
&& chmod +x /usr/bin/oc
32-
3320
# Install grpcurl
3421
RUN curl -sSL "https://github.com/fullstorydev/grpcurl/releases/download/v1.9.2/grpcurl_1.9.2_linux_x86_64.tar.gz" --output /tmp/grpcurl_1.2.tar.gz \
3522
&& tar xvf /tmp/grpcurl_1.2.tar.gz --no-same-owner \

conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
collect_rhoai_must_gather,
3333
get_base_dir,
3434
)
35-
3635
from kubernetes.dynamic import DynamicClient
3736
from utilities.infra import get_operator_distribution, get_dsci_applications_namespace, get_data_science_cluster
3837
from ocp_resources.resource import get_client
3938

39+
4040
LOGGER = logging.getLogger(name=__name__)
4141
BASIC_LOGGER = logging.getLogger(name="basic")
4242

@@ -106,6 +106,11 @@ def pytest_addoption(parser: Parser) -> None:
106106
default=os.environ.get("VLLM_RUNTIME_IMAGE"),
107107
help="Specify the runtime image to use for the tests",
108108
)
109+
runtime_group.addoption(
110+
"--mlserver-runtime-image",
111+
default=os.environ.get("MLSERVER_RUNTIME_IMAGE"),
112+
help="Specify the runtime image to use for the tests",
113+
)
109114

110115
# Upgrade options
111116
upgrade_group.addoption(

tests/conftest.py

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import pytest
88
import shortuuid
99
import yaml
10+
from _pytest._py.path import LocalPath
11+
from _pytest.legacypath import TempdirFactory
1012
from _pytest.tmpdir import TempPathFactory
1113
from ocp_resources.config_map import ConfigMap
1214
from ocp_resources.dsc_initialization import DSCInitialization
@@ -32,6 +34,7 @@
3234
create_ns,
3335
login_with_user_password,
3436
get_openshift_token,
37+
download_oc_console_cli,
3538
)
3639
from utilities.constants import (
3740
AcceleratorType,
@@ -41,6 +44,7 @@
4144
Protocols,
4245
)
4346
from utilities.infra import update_configmap_data
47+
from utilities.logger import RedactedString
4448
from utilities.minio import create_minio_data_connection_secret
4549
from utilities.operator_utils import get_csv_related_images
4650

@@ -65,7 +69,7 @@ def tests_tmp_dir(request: FixtureRequest, tmp_path_factory: TempPathFactory) ->
6569

6670
@pytest.fixture(scope="session")
6771
def current_client_token(admin_client: DynamicClient) -> str:
68-
return get_openshift_token()
72+
return RedactedString(value=get_openshift_token())
6973

7074

7175
@pytest.fixture(scope="session")
@@ -217,6 +221,14 @@ def vllm_runtime_image(pytestconfig: pytest.Config) -> str | None:
217221
return runtime_image
218222

219223

224+
@pytest.fixture(scope="session")
225+
def mlserver_runtime_image(pytestconfig: pytest.Config) -> str | None:
226+
runtime_image = pytestconfig.option.mlserver_runtime_image
227+
if not runtime_image:
228+
return None
229+
return runtime_image
230+
231+
220232
@pytest.fixture(scope="session")
221233
def use_unprivileged_client(pytestconfig: pytest.Config) -> bool:
222234
_use_unprivileged_client = py_config.get("use_unprivileged_client")
@@ -490,8 +502,7 @@ def junitxml_plugin(
490502
return record_testsuite_property if request.config.pluginmanager.has_plugin("junitxml") else None
491503

492504

493-
@pytest.fixture(scope="session", autouse=True)
494-
@pytest.mark.early(order=0)
505+
@pytest.fixture(scope="session")
495506
def cluster_sanity_scope_session(
496507
request: FixtureRequest,
497508
nodes: list[Node],
@@ -525,3 +536,40 @@ def related_images_refs(admin_client: DynamicClient) -> set[str]:
525536
related_images = get_csv_related_images(admin_client=admin_client)
526537
related_images_refs = {img["image"] for img in related_images}
527538
return related_images_refs
539+
540+
541+
@pytest.fixture(scope="session")
542+
def os_path_environment() -> str:
543+
return os.environ["PATH"]
544+
545+
546+
@pytest.fixture(scope="session")
547+
def bin_directory(tmpdir_factory: TempdirFactory) -> LocalPath:
548+
return tmpdir_factory.mktemp(basename="bin")
549+
550+
551+
@pytest.fixture(scope="session")
552+
def bin_directory_to_os_path(os_path_environment: str, bin_directory: LocalPath, oc_binary_path: str) -> None:
553+
LOGGER.info(f"OC binary path: {oc_binary_path}")
554+
LOGGER.info(f"Adding {bin_directory} to $PATH")
555+
os.environ["PATH"] = f"{bin_directory}:{os_path_environment}"
556+
557+
558+
@pytest.fixture(scope="session")
559+
def oc_binary_path(bin_directory: LocalPath) -> str:
560+
installed_oc_binary_path = os.getenv("OC_BINARY_PATH")
561+
if installed_oc_binary_path:
562+
LOGGER.warning(f"Using previously installed: {installed_oc_binary_path}")
563+
return installed_oc_binary_path
564+
565+
return download_oc_console_cli(tmpdir=bin_directory)
566+
567+
568+
@pytest.fixture(scope="session", autouse=True)
569+
@pytest.mark.early(order=0)
570+
def autouse_fixtures(
571+
bin_directory_to_os_path: None,
572+
cluster_sanity_scope_session: None,
573+
) -> None:
574+
"""Fixture to control the order of execution of some of the fixtures"""
575+
return

0 commit comments

Comments
 (0)