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

Update fvt toolchain (#463) #464

Merged
merged 18 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 15 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
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
2 changes: 1 addition & 1 deletion .github/workflows/fvt-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# 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
3 changes: 0 additions & 3 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
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.1
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)
5 changes: 5 additions & 0 deletions 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
5 changes: 5 additions & 0 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,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)

###############################################################################
# Create the develop, test, and build environment
###############################################################################
Expand Down
15 changes: 0 additions & 15 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@
// 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.
/*


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.
*/

package controllers

Expand Down
28 changes: 13 additions & 15 deletions pkg/predictor_source/inferenceservice_registry.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*
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.
*/
// 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.

package predictor_source

Expand Down
16 changes: 10 additions & 6 deletions scripts/deploy/iks/build-image-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ set -xe
# The following envs could be loaded from `build.properties` that
# `run-setup.sh` generates.
# - REGION: cloud region (us-south as default)
# - ORG: target organization (dev-advo as default)
# - SPACE: target space (dev as default)
# - GIT_BRANCH: git branch
# - GIT_COMMIT: git commit hash
# - GIT_COMMIT_SHORT: git commit hash short

REGION=${REGION:-"us-south"}
ORG=${ORG:-"dev-advo"}
SPACE=${SPACE:-"dev"}
RUN_TASK=${RUN_TASK:-"build"}

export DOCKER_BUILDKIT=1

retry() {
local max=$1; shift
local interval=$1; shift
Expand All @@ -39,19 +37,25 @@ retry() {
}

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"


######################################################################################
# Build image #
######################################################################################
build_image() {
echo "=======================Build modelmesh controller image======================="
echo "=======================Build ModelMesh controller image======================="
# Will build develop and then runtime images.

docker version
# docker pull docker/dockerfile:experimental # syntax=docker/dockerfile:experimental
docker pull docker/dockerfile:1.3 # syntax=docker/dockerfile:1.3

echo "==============================Build dev image ================================"
make build.develop
docker images
docker inspect "kserve/modelmesh-controller-develop:latest"

echo "==========================Build runtime image ================================"
make build
docker images
Expand Down
Loading