Skip to content

Commit 307bff4

Browse files
authored
Merge pull request #8 from opendatahub-io/develop
Add Dockerfile/go.sum/go.mod for odh-manifests e2e fvt test
2 parents 2c9fcb5 + 45c0d83 commit 307bff4

File tree

4 files changed

+1655
-1
lines changed

4 files changed

+1655
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ RUN git init && \
6969
# Download dependiencies before copying the source so they will be cached
7070
COPY go.mod go.sum ./
7171
RUN go mod download
72-
RUN go mod vendor
7372

7473

7574
###############################################################################
@@ -82,6 +81,9 @@ LABEL image="build"
8281
# Copy the source
8382
COPY . ./
8483

84+
# Copy packages into vendor
85+
RUN go mod vendor
86+
8587
# Build the binaries
8688
RUN go build -o puller model-serving-puller/main.go
8789
RUN go build -o triton-adapter model-mesh-triton-adapter/main.go

Dockerfile.develop

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2021 IBM Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
###############################################################################
16+
# Create the develop, test, and build environment
17+
###############################################################################
18+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7
19+
20+
ARG GOLANG_VERSION=1.18.9
21+
ARG OPENSHIFT_VERSION=4.9
22+
ARG KUSTOMIZE_VERSION=4.5.2
23+
ARG KUBEBUILDER_VERSION=v3.3.0
24+
ARG CONTROLLER_GEN_VERSION=v0.8.0
25+
ENV PATH=/usr/local/go/bin:$PATH:/usr/local/kubebuilder/bin:
26+
27+
USER root
28+
29+
WORKDIR /workspace
30+
31+
# Copy the Go Modules manifests
32+
COPY .pre-commit-config.yaml ./
33+
COPY go.mod.develop ./go.mod
34+
COPY go.sum.develop ./go.sum
35+
36+
# Install gcc
37+
RUN microdnf install \
38+
diffutils \
39+
gcc-c++ \
40+
make \
41+
wget \
42+
tar \
43+
vim \
44+
git \
45+
findutils \
46+
python38 \
47+
nodejs && \
48+
pip3 install pre-commit && \
49+
# Install go
50+
set -eux; \
51+
wget -qO go.tgz "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \
52+
# sha256sum *go.tgz; \
53+
tar -C /usr/local -xzf go.tgz; \
54+
go version && rm go.tgz && \
55+
# Download and initialize the pre-commit environments before copying the source so they will be cached
56+
git init && \
57+
pre-commit install-hooks && \
58+
rm -rf .git && \
59+
# Download kubebuilder
60+
true \
61+
# First download and extract older dist of kubebuilder which includes required etcd, kube-apiserver and kubectl binaries
62+
&& curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.2/kubebuilder_2.3.2_linux_amd64.tar.gz | tar -xz -C /tmp/ \
63+
&& mv /tmp/kubebuilder_*_linux_amd64 /usr/local/kubebuilder \
64+
# Then download and overwrite kubebuilder binary with desired/latest version
65+
&& curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/${KUBEBUILDER_VERSION}/kubebuilder_linux_amd64 -o /usr/local/kubebuilder/bin/kubebuilder \
66+
&& true && \
67+
# download openshift-cli
68+
curl -sSLf --output /tmp/oc_client.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-${OPENSHIFT_VERSION}/openshift-client-linux.tar.gz \
69+
&& tar -xvf /tmp/oc_client.tar.gz -C /tmp \
70+
&& mv /tmp/oc /usr/local/bin \
71+
&& mv /tmp/kubectl /usr/local/bin \
72+
&& chmod a+x /usr/local/bin/oc /usr/local/bin/kubectl \
73+
&& rm -f /tmp/oc_client.tar.gz && \
74+
# download kustomize
75+
curl -sSLf --output /tmp/kustomize.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz \
76+
&& tar -xvf /tmp/kustomize.tar.gz -C /tmp \
77+
&& mv /tmp/kustomize /usr/local/bin \
78+
&& chmod a+x /usr/local/bin/kustomize \
79+
&& rm -v /tmp/kustomize.tar.gz && \
80+
# cache deps before building and copying source so that we don't need to re-download as much
81+
# and so that source changes don't invalidate our downloaded layer
82+
go mod download && \
83+
# Install controller-gen
84+
mkdir /tmp/controller-gen-tmp && cd /tmp/controller-gen-tmp \
85+
&& go mod init tmp && go get sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} && go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} \
86+
&& rm -rf /tmp/controller-gen-tmp
87+
88+
RUN go install github.com/onsi/ginkgo/v2/ginkgo
89+
ENV PATH=/root/go/bin/:$PATH

go.mod.develop

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
module github.com/kserve/modelmesh-serving
2+
3+
go 1.18
4+
5+
require (
6+
github.com/dereklstinson/cifar v0.0.0-20200421171932-5722a3b6a0c7
7+
github.com/go-logr/logr v1.2.3
8+
github.com/golang/protobuf v1.5.2
9+
github.com/google/go-cmp v0.5.8
10+
github.com/kserve/kserve v0.10.0
11+
github.com/manifestival/controller-runtime-client v0.4.0
12+
github.com/manifestival/manifestival v0.7.1
13+
github.com/moverest/mnist v0.0.0-20160628192128-ec5d9d203b59
14+
github.com/onsi/ginkgo/v2 v2.1.3
15+
github.com/onsi/gomega v1.18.1
16+
github.com/operator-framework/operator-lib v0.10.0
17+
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.55.0
18+
github.com/spf13/viper v1.10.1
19+
github.com/stretchr/testify v1.8.0
20+
github.com/tommy351/goldga v0.5.0
21+
go.etcd.io/etcd/api/v3 v3.5.3
22+
go.etcd.io/etcd/client/v3 v3.5.3
23+
go.uber.org/atomic v1.9.0
24+
google.golang.org/grpc v1.48.0
25+
google.golang.org/protobuf v1.28.1
26+
k8s.io/api v0.23.9
27+
k8s.io/apimachinery v0.23.9
28+
k8s.io/client-go v0.23.9
29+
knative.dev/pkg v0.0.0-20220818004048-4a03844c0b15
30+
sigs.k8s.io/controller-runtime v0.11.2
31+
sigs.k8s.io/yaml v1.3.0
32+
)
33+
34+
require (
35+
cloud.google.com/go v0.102.1 // indirect
36+
cloud.google.com/go/compute v1.7.0 // indirect
37+
cloud.google.com/go/iam v0.4.0 // indirect
38+
cloud.google.com/go/storage v1.22.1 // indirect
39+
github.com/BurntSushi/toml v1.0.0 // indirect
40+
github.com/PuerkitoBio/purell v1.1.1 // indirect
41+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
42+
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect
43+
github.com/aws/aws-sdk-go v1.36.30 // indirect
44+
github.com/beorn7/perks v1.0.1 // indirect
45+
github.com/blendle/zapdriver v1.3.1 // indirect
46+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
47+
github.com/coreos/go-semver v0.3.0 // indirect
48+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
49+
github.com/davecgh/go-spew v1.1.1 // indirect
50+
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
51+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
52+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
53+
github.com/fsnotify/fsnotify v1.5.1 // indirect
54+
github.com/go-logr/zapr v1.2.0 // indirect
55+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
56+
github.com/go-openapi/jsonreference v0.19.5 // indirect
57+
github.com/go-openapi/swag v0.19.15 // indirect
58+
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
59+
github.com/gogo/protobuf v1.3.2 // indirect
60+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
61+
github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387 // indirect
62+
github.com/google/gofuzz v1.2.0 // indirect
63+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
64+
github.com/google/uuid v1.3.0 // indirect
65+
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
66+
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
67+
github.com/googleapis/gnostic v0.5.5 // indirect
68+
github.com/googleapis/go-type-adapters v1.0.0 // indirect
69+
github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 // indirect
70+
github.com/hashicorp/hcl v1.0.0 // indirect
71+
github.com/imdario/mergo v0.3.12 // indirect
72+
github.com/jmespath/go-jmespath v0.4.0 // indirect
73+
github.com/josharian/intern v1.0.0 // indirect
74+
github.com/json-iterator/go v1.1.12 // indirect
75+
github.com/logrusorgru/aurora/v3 v3.0.0 // indirect
76+
github.com/magiconair/properties v1.8.5 // indirect
77+
github.com/mailru/easyjson v0.7.7 // indirect
78+
github.com/mattn/go-isatty v0.0.14 // indirect
79+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
80+
github.com/mitchellh/mapstructure v1.4.3 // indirect
81+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
82+
github.com/modern-go/reflect2 v1.0.2 // indirect
83+
github.com/pelletier/go-toml v1.9.4 // indirect
84+
github.com/pkg/errors v0.9.1 // indirect
85+
github.com/pmezard/go-difflib v1.0.0 // indirect
86+
github.com/prometheus/client_golang v1.14.0 // indirect
87+
github.com/prometheus/client_model v0.3.0 // indirect
88+
github.com/prometheus/common v0.39.0 // indirect
89+
github.com/prometheus/procfs v0.8.0 // indirect
90+
github.com/sergi/go-diff v1.2.0 // indirect
91+
github.com/spf13/afero v1.6.0 // indirect
92+
github.com/spf13/cast v1.4.1 // indirect
93+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
94+
github.com/spf13/pflag v1.0.5 // indirect
95+
github.com/subosito/gotenv v1.2.0 // indirect
96+
go.etcd.io/etcd/client/pkg/v3 v3.5.3 // indirect
97+
go.opencensus.io v0.23.0 // indirect
98+
go.uber.org/multierr v1.6.0 // indirect
99+
go.uber.org/zap v1.19.1 // indirect
100+
golang.org/x/net v0.4.0 // indirect
101+
golang.org/x/oauth2 v0.3.0 // indirect
102+
golang.org/x/sys v0.3.0 // indirect
103+
golang.org/x/term v0.3.0 // indirect
104+
golang.org/x/text v0.5.0 // indirect
105+
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
106+
golang.org/x/tools v0.1.12 // indirect
107+
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
108+
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
109+
google.golang.org/api v0.93.0 // indirect
110+
google.golang.org/appengine v1.6.7 // indirect
111+
google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 // indirect
112+
gopkg.in/inf.v0 v0.9.1 // indirect
113+
gopkg.in/ini.v1 v1.66.2 // indirect
114+
gopkg.in/yaml.v2 v2.4.0 // indirect
115+
gopkg.in/yaml.v3 v3.0.1 // indirect
116+
k8s.io/apiextensions-apiserver v0.23.9 // indirect
117+
k8s.io/component-base v0.23.9 // indirect
118+
k8s.io/klog/v2 v2.70.2-0.20220707122935-0990e81f1a8f // indirect
119+
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
120+
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
121+
knative.dev/networking v0.0.0-20220818010248-e51df7cdf571 // indirect
122+
knative.dev/serving v0.34.0 // indirect
123+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
124+
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
125+
)
126+
127+
replace (
128+
// Update go-restful library to avoid CVE-2022-1996
129+
github.com/emicklei/go-restful => github.com/emicklei/go-restful v2.16.0+incompatible
130+
131+
// Update prometheus client to avoid CVE-2022-21698
132+
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.1
133+
)

0 commit comments

Comments
 (0)