Skip to content

Commit

Permalink
Merge branch 'community-main' into odh/main
Browse files Browse the repository at this point in the history
  • Loading branch information
spolti committed Jan 22, 2024
2 parents d08d355 + a2ce947 commit cccb1ab
Show file tree
Hide file tree
Showing 32 changed files with 287 additions and 259 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
.DS_Store
.dev
.dockerignore
.env
.github
.idea
.pre-commit.log
.tekton
.vscode
Dockerfile
devbuild
docs
fvt
temp
7 changes: 4 additions & 3 deletions .github/workflows/fvt-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.20'

- name: Start Minikube
uses: medyagh/[email protected]
Expand All @@ -59,15 +59,16 @@ jobs:
kubectl get pods -n kube-system
- name: Set controller image tag
run: echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV
run: |
echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV
- name: Update configs
# Update the image tag and reduce some resource request amounts to allow FVTs to run
# on reduced resource environments. The RollingUpdate strategy for Runtime deployments
# is also adjusted for these environments.
# Disable the torchserve ServingRuntime for now (insufficient resources to run them all).
run: |
sed -i 's/newTag:.*$/newTag: '"${{ env.IMAGE_TAG }}"'/' config/manager/kustomization.yaml
sed -i 's/newTag:.*$/newTag: "'${{ env.IMAGE_TAG }}'"/' config/manager/kustomization.yaml
sed -i '0,/cpu:.*$/s/cpu:.*$/cpu: 100m/' \
config/default/config-defaults.yaml \
config/runtimes/mlserver-1.x.yaml \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ kustomize/
.temp_new_modelmesh_manifests
kfctl*
bin
.pre-commit.log
5 changes: 1 addition & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,13 @@ linters:
fast: false
enable:
# These are the defaults for golangci-lint
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck

# Also enable these
- goconst
Expand Down Expand Up @@ -248,7 +245,7 @@ issues:
- lll
source: "^//go:generate "

# Independently from option `exclude` we use default exclude patterns,
# Independent of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
Expand Down
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
# limitations under the License.
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.48.0
rev: v1.51.2
hooks:
- id: golangci-lint
entry: golangci-lint run
exclude: ^(generated/)
args:
- --skip-dirs='^(generated/)'
log_file: .pre-commit.log
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1
hooks:
- id: prettier
exclude: ^(.github/|.tekton/)
args:
- --no-bracket-spacing
log_file: .pre-commit.log
11 changes: 1 addition & 10 deletions .tekton/listener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ spec:
- name: region
description: the ibmcloud registry region
default: us-south
- name: org
description: organization
- name: space
description: space
default: dev
- name: resource-group
description: resource group
default: default
default: Default
- name: docker-username
description: ibm container registry username
default: iamapikey
Expand Down Expand Up @@ -112,10 +107,6 @@ spec:
value: $(params.dockersandbox-namespace)
- name: resource-group
value: $(params.resource-group)
- name: org
value: $(params.org)
- name: space
value: $(params.space)
- name: kubernetes-cluster
value: $(params.kubernetes-cluster)
- name: serving-ns
Expand Down
14 changes: 1 addition & 13 deletions .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ spec:
description: dockersandbox namespace
- name: resource-group
description: resource group
default: default
- name: org
description: organization
default: Default
- name: region
description: region
- name: space
description: space
- name: serving-ns
description: modelmesh serving namespace
default: modelmesh-serving
Expand Down Expand Up @@ -80,12 +76,8 @@ spec:
value: $(params.docker-password)
- name: resource-group
value: $(params.resource-group)
- name: org
value: $(params.org)
- name: region
value: $(params.region)
- name: space
value: $(params.space)
workspaces:
- name: task-pvc
workspace: pipeline-pvc
Expand Down Expand Up @@ -260,12 +252,8 @@ spec:
value: $(params.serving-ns)
- name: resource-group
value: $(params.resource-group)
- name: org
value: $(params.org)
- name: region
value: $(params.region)
- name: space
value: $(params.space)
- name: test-commands
value: |
kubectl get ns
Expand Down
39 changes: 12 additions & 27 deletions .tekton/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ spec:
description: iam api key
- name: resource-group
description: resource group
default: default
- name: org
description: organization
default: Default
- name: region
description: region
- name: space
description: space
default: us-south
- name: archive-dir
description: archive directory
default: "."
Expand All @@ -35,7 +32,7 @@ spec:
mountPath: /artifacts
steps:
- name: run-setup-script
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: DOCKER_USERNAME
value: $(params.docker-username)
Expand All @@ -47,10 +44,6 @@ spec:
value: $(params.repository)
- name: REGION
value: $(params.region)
- name: ORG
value: $(params.org)
- name: SPACE
value: $(params.space)
- name: RESOURCE_GROUP
value: $(params.resource-group)
- name: GIT_BRANCH
Expand Down Expand Up @@ -116,13 +109,12 @@ spec:
description: docker sandbox namespace
- name: publish-tag
description: image publish tag

workspaces:
- name: task-pvc
mountPath: /artifacts
steps:
- name: process-image
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: DOCKER_USERNAME
value: $(params.docker-username)
Expand Down Expand Up @@ -243,7 +235,7 @@ spec:
mountPath: /artifacts
steps:
- name: deploy-modelmesh-serving
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: DOCKER_USERNAME
value: $(params.docker-username)
Expand Down Expand Up @@ -295,7 +287,7 @@ spec:
mountPath: /artifacts
steps:
- name: run-test
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: IBM_CLOUD_API_KEY
value: $(params.apikey)
Expand Down Expand Up @@ -347,7 +339,7 @@ spec:
mountPath: /artifacts
steps:
- name: run-performance-test
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: SERVING_KUBERNETES_CLUSTER_NAME
value: $(params.kubernetes-cluster)
Expand Down Expand Up @@ -384,7 +376,7 @@ spec:
mountPath: /artifacts
steps:
- name: undeploy-modelmesh-serving
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: SERVING_KUBERNETES_CLUSTER_NAME
value: $(params.kubernetes-cluster)
Expand Down Expand Up @@ -415,13 +407,10 @@ spec:
default: kubeflow
- name: resource-group
description: resource group
default: default
- name: org
description: organization
default: Default
- name: region
description: region
- name: space
description: space
default: us-south
- name: archive-dir
description: archive directory
default: "."
Expand All @@ -433,7 +422,7 @@ spec:
mountPath: /artifacts
steps:
- name: run-cleanup-script
image: docker.io/aipipeline/pipeline-base-image:1.2
image: docker.io/aipipeline/pipeline-base-image:1.5
env:
- name: IBM_CLOUD_API_KEY
value: $(params.apikey)
Expand All @@ -445,10 +434,6 @@ spec:
value: $(params.serving-ns)
- name: REGION
value: $(params.region)
- name: ORG
value: $(params.org)
- name: SPACE
value: $(params.space)
- name: RESOURCE_GROUP
value: $(params.resource-group)
- name: PIPELINE_URL
Expand Down Expand Up @@ -481,7 +466,7 @@ spec:
# Set up kubernetes config
retry 3 3 ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" --no-region
retry 3 3 ibmcloud target -r "$REGION" -o "$ORG" -s "$SPACE" -g "$RESOURCE_GROUP"
retry 3 3 ibmcloud target -r "$REGION" -g "$RESOURCE_GROUP"
retry 3 3 ibmcloud ks cluster config -c "$SERVING_KUBERNETES_CLUSTER_NAME"
$(params.test-commands)
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1.3

# Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: for syntax, either use "experimental" or "1.3" (or later) to enable multi-arch build with mount option
# see https://hub.docker.com/r/docker/dockerfile (https://github.com/moby/buildkit/releases/tag/dockerfile%2F1.3.0)

###############################################################################
# Stage 1: Run the go build with go compiler native to the build platform
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
Expand Down Expand Up @@ -47,7 +52,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
###############################################################################
# Stage 2: Copy build assets to create the smallest final runtime image
###############################################################################
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 AS runtime
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 AS runtime

ARG USER=2000
ARG IMAGE_VERSION
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1.3

# Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,17 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: for syntax, either use "experimental" or "1.3" (or later) to enable multi-arch build with mount option
# see https://hub.docker.com/r/docker/dockerfile (https://github.com/moby/buildkit/releases/tag/dockerfile%2F1.3.0)

###############################################################################
# Create the develop, test, and build environment
###############################################################################
FROM registry.access.redhat.com/ubi8/go-toolset:1.19
FROM registry.access.redhat.com/ubi8/go-toolset:1.20

# 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 OPENSHIFT_VERSION=4.12
ARG KUSTOMIZE_VERSION=4.5.2
ARG KUBEBUILDER_VERSION=v3.11.0
Expand Down Expand Up @@ -116,7 +121,7 @@ RUN true \
# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA)
RUN true \
&& go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \
&& setup-envtest use 1.23 \
&& setup-envtest use 1.26 \
&& true

# For GitHub Action 'lint', work around error "detected dubious ownership in repository at '/workspace'"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copied from https://github.com/kserve/kserve/blob/v0.11.1/config/crd/serving.kserve.io_clusterservingruntimes.yaml
# Copied from https://github.com/kserve/kserve/blob/v0.11.2/config/crd/serving.kserve.io_clusterservingruntimes.yaml
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/serving.kserve.io_inferenceservices.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copied from https://github.com/kserve/kserve/blob/v0.11.1/config/crd/serving.kserve.io_inferenceservices.yaml
# Copied from https://github.com/kserve/kserve/blob/v0.11.2/config/crd/serving.kserve.io_inferenceservices.yaml
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/serving.kserve.io_servingruntimes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copied from https://github.com/kserve/kserve/blob/v0.11.1/config/crd/serving.kserve.io_servingruntimes.yaml
# Copied from https://github.com/kserve/kserve/blob/v0.11.2/config/crd/serving.kserve.io_servingruntimes.yaml
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
2 changes: 1 addition & 1 deletion controllers/config/templating.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func templateSource(r io.Reader, context interface{}) mf.Source {
if err != nil {
panic(err)
}
t, err := template.New("foo").Parse(string(b))
t, err := template.New("ModelMeshTemplate").Parse(string(b))
if err != nil {
panic(err)
}
Expand Down
Loading

0 comments on commit cccb1ab

Please sign in to comment.