diff --git a/.gitignore b/.gitignore index 9cd09f206..dd73038f4 100644 --- a/.gitignore +++ b/.gitignore @@ -38,8 +38,5 @@ devbuild .cache/ kustomize/ .temp_new_modelmesh_manifests -opendatahub/scripts/manifests/params.env -opendatahub/scripts/manifests/fvt/ -opendatahub/scripts/manifests/runtimes/ kfctl* bin diff --git a/Dockerfile b/Dockerfile index 32a802f2c..54ca9dfce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,13 @@ # https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ ############################################################################### ARG DEV_IMAGE -FROM --platform=$BUILDPLATFORM $DEV_IMAGE AS build +FROM ${DEV_IMAGE} AS build # https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope # don't provide "default" values (e.g. 'ARG TARGETARCH=amd64') for non-buildx environments, # see https://github.com/docker/buildx/issues/510 -ARG TARGETOS -ARG TARGETARCH +ARG TARGETOS=linux +ARG TARGETARCH=amd64 LABEL image="build" diff --git a/Dockerfile.develop b/Dockerfile.develop index fb0a7296e..f441e6440 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -15,15 +15,16 @@ ############################################################################### # Create the develop, test, and build environment ############################################################################### -FROM registry.access.redhat.com/ubi8/go-toolset:1.19 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 # https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope # don't provide "default" values (e.g. 'ARG TARGETARCH=amd64') for non-buildx environments, # see https://github.com/docker/buildx/issues/510 -ARG TARGETOS -ARG TARGETARCH +ARG TARGETOS=linux +ARG TARGETARCH=amd64 -ARG OPENSHIFT_VERSION=4.9 +ARG GOLANG_VERSION=1.19.9 +ARG OPENSHIFT_VERSION=4.12 ARG KUSTOMIZE_VERSION=4.5.2 ARG KUBEBUILDER_VERSION=v3.3.0 ARG CONTROLLER_GEN_VERSION=v0.11.4 @@ -43,6 +44,12 @@ RUN --mount=type=cache,target=/root/.cache/dnf:rw \ nodejs \ jq +# Install go +RUN set -eux; \ + wget -qO go.tgz "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \ + tar -C /usr/local -xzf go.tgz; \ + go version && rm go.tgz + # Install pre-commit ENV PIP_CACHE_DIR=/root/.cache/pip RUN --mount=type=cache,target=/root/.cache/pip \ @@ -111,7 +118,8 @@ RUN true \ && true # For GitHub Action 'lint', work around error "detected dubious ownership in repository at '/workspace'" -RUN git config --system --add safe.directory /workspace +#RUN git config --system --add safe.directory /workspace +RUN git config --system --add safe.directory "*" # The ubi/go-toolset image doesn't define ENTRYPOINT or CMD, but we need it to run 'make develop' CMD /bin/bash diff --git a/opendatahub/scripts/manifests/fvt/fvt_templates/kustomization.yaml b/opendatahub/scripts/manifests/fvt/fvt_templates/kustomization.yaml new file mode 100644 index 000000000..9ab2d9439 --- /dev/null +++ b/opendatahub/scripts/manifests/fvt/fvt_templates/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - fvt.yaml +patchesStrategicMerge: + - remove_etcd_patch.yaml +namespace: modelmesh-serving diff --git a/opendatahub/scripts/manifests/fvt/fvt_templates/remove_etcd_patch.yaml b/opendatahub/scripts/manifests/fvt/fvt_templates/remove_etcd_patch.yaml new file mode 100644 index 000000000..8a5bebf42 --- /dev/null +++ b/opendatahub/scripts/manifests/fvt/fvt_templates/remove_etcd_patch.yaml @@ -0,0 +1,17 @@ +$patch: delete +apiVersion: v1 +kind: Service +metadata: + name: etcd +--- +$patch: delete +apiVersion: v1 +kind: Secret +metadata: + name: model-serving-etcd +--- +$patch: delete +apiVersion: apps/v1 +kind: Deployment +metadata: + name: etcd diff --git a/opendatahub/scripts/manifests/params.env b/opendatahub/scripts/manifests/params.env new file mode 100644 index 000000000..84af57528 --- /dev/null +++ b/opendatahub/scripts/manifests/params.env @@ -0,0 +1,7 @@ +monitoring-namespace=opendatahub +odh-mm-rest-proxy=quay.io/opendatahub/rest-proxy:v0.11.0-rc0 +odh-modelmesh-runtime-adapter=quay.io/opendatahub/modelmesh-runtime-adapter:v0.11.0-rc0 +odh-modelmesh=quay.io/opendatahub/modelmesh:v0.11.0-rc0 +odh-openvino=quay.io/opendatahub/openvino_model_server:2022.3-release +odh-modelmesh-controller=quay.io/opendatahub/modelmesh-controller:v0.11.0-rc0 +odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.11.0-rc0 diff --git a/opendatahub/scripts/manifests/runtimes/mlserver-1.x.yaml b/opendatahub/scripts/manifests/runtimes/mlserver-1.x.yaml new file mode 100644 index 000000000..c1e4f03fa --- /dev/null +++ b/opendatahub/scripts/manifests/runtimes/mlserver-1.x.yaml @@ -0,0 +1,75 @@ +# Copyright 2021 IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +apiVersion: serving.kserve.io/v1alpha1 +kind: ServingRuntime +metadata: + name: mlserver-1.x + labels: + name: modelmesh-serving-mlserver-1.x-SR +spec: + supportedModelFormats: + - name: sklearn + version: "0" # v0.23.1 + autoSelect: true + - name: xgboost + version: "1" # v1.1.1 + autoSelect: true + - name: lightgbm + version: "3" # v3.2.1 + autoSelect: true + + protocolVersions: + - grpc-v2 + multiModel: true + + grpcEndpoint: "port:8085" + grpcDataEndpoint: "port:8001" + + containers: + - name: mlserver + image: mlserver-1:replace + env: + - name: MLSERVER_MODELS_DIR + value: "/models/_mlserver_models/" + - name: MLSERVER_GRPC_PORT + value: "8001" + # default value for HTTP port is 8080 which conflicts with MMesh's + # Litelinks port + - name: MLSERVER_HTTP_PORT + value: "8002" + - name: MLSERVER_LOAD_MODELS_AT_STARTUP + value: "false" + # Set a dummy model name via environment so that MLServer doesn't + # error on a RepositoryIndex call when no models exist + - name: MLSERVER_MODEL_NAME + value: dummy-model-fixme + # Set server addr to localhost to ensure MLServer only listen inside the pod + - name: MLSERVER_HOST + value: "127.0.0.1" + # Increase gRPC max message size to support larger payloads + # Unlimited because it will be restricted at the model mesh layer + - name: MLSERVER_GRPC_MAX_MESSAGE_LENGTH + value: "-1" + resources: + requests: + cpu: 500m + memory: 1Gi + limits: + cpu: "5" + memory: 1Gi + builtInAdapter: + serverType: mlserver + runtimeManagementPort: 8001 + memBufferBytes: 134217728 + modelLoadingTimeoutMillis: 90000