diff --git a/.aci.yml b/.aci.yml new file mode 100644 index 0000000000..47e0132a06 --- /dev/null +++ b/.aci.yml @@ -0,0 +1,33 @@ +version: "1.5" + +stages: + - 代码检查 + +静态扫描: + stage: 代码检查 + plugin: CMD + pluginConfig: + encoding: UTF-8 + taskKind: CMD_GOLANGCI_LINT + +构建Namespaced Controller镜像: + stage: 代码检查 + plugin: ANT-BUILD + passEnv: true + pluginConfig: + image: reg.docker.alibaba-inc.com/antsigma/golang-dev:1.13.12 + inputs: + params: + - name: DOCKERFILE + value: ./ray-operator/Dockerfile.manager + - name: DIRECTORY + value: ./ray-operator + outputs: + ### TODO(user): modify to your image repo addr + ### TODO(user): 镜像推送时,如遇到授权问题,请将账号admin.for.antb 添加授权并设置为读写权限之上; + ### more info: https://yuque.antfin-inc.com/docs/share/786cf0fb-e070-4484-b7a8-979991f23af9#bc90917b + - name: "ray-operator-manager" + namespace: ray_deploy + repository: reg.docker.alibaba-inc.com + type: image + desc: "manager image of ray-operator" diff --git a/ray-operator/Dockerfile.manager b/ray-operator/Dockerfile.manager new file mode 100644 index 0000000000..520f650478 --- /dev/null +++ b/ray-operator/Dockerfile.manager @@ -0,0 +1,31 @@ +# cat Dockerfile_ant +# Build the manager binary +FROM reg.docker.alibaba-inc.com/antsigma/golang-dev:1.13.12 as builder + +WORKDIR /go/src/github.com/ray-project/kuberay/ray-operator +# Copy the Go Modules manifests +COPY go.mod go.mod +COPY go.sum go.sum +# cache deps before building and copying source so that we don't need to re-download as much +# and so that source changes don't invalidate our downloaded layer +#RUN go mod download + +# Copy the go source +COPY main.go main.go +COPY api/ api/ +COPY controllers/ controllers/ +COPY vendor/ vendor/ + +# Build +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=off go build -a -o manager main.go + +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +FROM reg.docker.alibaba-inc.com/alibase/alios7u2-min +WORKDIR / +COPY --from=builder /go/src/github.com/ray-project/kuberay/ray-operator/manager . +USER 65532:65532 + +ENTRYPOINT ["/manager"] + + diff --git a/ray-operator/vendor/modules.txt b/ray-operator/vendor/modules.txt index 03dffb5a09..432329fd3b 100644 --- a/ray-operator/vendor/modules.txt +++ b/ray-operator/vendor/modules.txt @@ -5,10 +5,10 @@ github.com/PuerkitoBio/purell ## explicit github.com/PuerkitoBio/urlesc # github.com/beorn7/perks v1.0.1 -## explicit; go 1.11 +## explicit github.com/beorn7/perks/quantile # github.com/cespare/xxhash/v2 v2.1.1 -## explicit; go 1.11 +## explicit github.com/cespare/xxhash/v2 # github.com/davecgh/go-spew v1.1.1 ## explicit @@ -21,79 +21,79 @@ github.com/emicklei/go-restful/log ## explicit github.com/evanphx/json-patch # github.com/fsnotify/fsnotify v1.4.9 -## explicit; go 1.13 +## explicit github.com/fsnotify/fsnotify # github.com/go-logr/logr v0.3.0 -## explicit; go 1.14 +## explicit github.com/go-logr/logr # github.com/go-logr/zapr v0.2.0 -## explicit; go 1.12 +## explicit github.com/go-logr/zapr # github.com/go-openapi/jsonpointer v0.19.3 -## explicit; go 1.13 +## explicit github.com/go-openapi/jsonpointer # github.com/go-openapi/jsonreference v0.19.3 -## explicit; go 1.13 +## explicit github.com/go-openapi/jsonreference # github.com/go-openapi/spec v0.19.3 -## explicit; go 1.13 +## explicit github.com/go-openapi/spec # github.com/go-openapi/swag v0.19.5 ## explicit github.com/go-openapi/swag # github.com/gogo/protobuf v1.3.2 -## explicit; go 1.15 +## explicit github.com/gogo/protobuf/proto github.com/gogo/protobuf/sortkeys # github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 ## explicit github.com/golang/groupcache/lru # github.com/golang/protobuf v1.4.2 -## explicit; go 1.9 +## explicit github.com/golang/protobuf/proto github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp # github.com/google/go-cmp v0.5.2 -## explicit; go 1.8 +## explicit github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value # github.com/google/gofuzz v1.1.0 -## explicit; go 1.12 +## explicit github.com/google/gofuzz # github.com/google/uuid v1.1.1 ## explicit github.com/google/uuid # github.com/googleapis/gnostic v0.5.1 -## explicit; go 1.12 +## explicit github.com/googleapis/gnostic/compiler github.com/googleapis/gnostic/extensions github.com/googleapis/gnostic/jsonschema github.com/googleapis/gnostic/openapiv2 # github.com/hashicorp/golang-lru v0.5.4 -## explicit; go 1.12 +## explicit github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru # github.com/imdario/mergo v0.3.10 -## explicit; go 1.13 +## explicit github.com/imdario/mergo # github.com/json-iterator/go v1.1.10 -## explicit; go 1.12 +## explicit github.com/json-iterator/go # github.com/konsorten/go-windows-terminal-sequences v1.0.3 ## explicit github.com/konsorten/go-windows-terminal-sequences # github.com/mailru/easyjson v0.7.0 -## explicit; go 1.12 +## explicit github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer github.com/mailru/easyjson/jwriter # github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 -## explicit; go 1.9 +## explicit github.com/matttproud/golang_protobuf_extensions/pbutil # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd ## explicit @@ -102,14 +102,14 @@ github.com/modern-go/concurrent ## explicit github.com/modern-go/reflect2 # github.com/nxadm/tail v1.4.4 -## explicit; go 1.13 +## explicit github.com/nxadm/tail github.com/nxadm/tail/ratelimiter github.com/nxadm/tail/util github.com/nxadm/tail/watch github.com/nxadm/tail/winfile # github.com/onsi/ginkgo v1.14.1 -## explicit; go 1.13 +## explicit github.com/onsi/ginkgo github.com/onsi/ginkgo/config github.com/onsi/ginkgo/internal/codelocation @@ -152,40 +152,40 @@ github.com/pkg/errors ## explicit github.com/pmezard/go-difflib/difflib # github.com/prometheus/client_golang v1.7.1 -## explicit; go 1.11 +## explicit github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.2.0 -## explicit; go 1.9 +## explicit github.com/prometheus/client_model/go # github.com/prometheus/common v0.10.0 -## explicit; go 1.11 +## explicit github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg github.com/prometheus/common/model # github.com/prometheus/procfs v0.1.3 -## explicit; go 1.12 +## explicit github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util # github.com/sirupsen/logrus v1.6.0 -## explicit; go 1.13 +## explicit github.com/sirupsen/logrus # github.com/spf13/pflag v1.0.5 -## explicit; go 1.12 +## explicit github.com/spf13/pflag # github.com/stretchr/testify v1.5.1 -## explicit; go 1.13 +## explicit github.com/stretchr/testify/assert # go.uber.org/atomic v1.6.0 -## explicit; go 1.13 +## explicit go.uber.org/atomic # go.uber.org/multierr v1.5.0 -## explicit; go 1.12 +## explicit go.uber.org/multierr # go.uber.org/zap v1.15.0 -## explicit; go 1.13 +## explicit go.uber.org/zap go.uber.org/zap/buffer go.uber.org/zap/internal/bufferpool @@ -193,14 +193,14 @@ go.uber.org/zap/internal/color go.uber.org/zap/internal/exit go.uber.org/zap/zapcore # golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 -## explicit; go 1.11 +## explicit golang.org/x/crypto/ssh/terminal # golang.org/x/mod v0.3.0 -## explicit; go 1.12 +## explicit golang.org/x/mod/module golang.org/x/mod/semver # golang.org/x/net v0.0.0-20201110031124-69a78807bb2b -## explicit; go 1.11 +## explicit golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/html @@ -211,16 +211,16 @@ golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna # golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 -## explicit; go 1.11 +## explicit golang.org/x/oauth2 golang.org/x/oauth2/internal # golang.org/x/sys v0.0.0-20201112073958-5cba982894dd -## explicit; go 1.12 +## explicit golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.3 -## explicit; go 1.11 +## explicit golang.org/x/text/encoding golang.org/x/text/encoding/charmap golang.org/x/text/encoding/htmlindex @@ -246,7 +246,7 @@ golang.org/x/text/width ## explicit golang.org/x/time/rate # golang.org/x/tools v0.0.0-20210106214847-113979e3529a -## explicit; go 1.12 +## explicit golang.org/x/tools/go/ast/astutil golang.org/x/tools/imports golang.org/x/tools/internal/event @@ -258,14 +258,14 @@ golang.org/x/tools/internal/gocommand golang.org/x/tools/internal/gopathwalk golang.org/x/tools/internal/imports # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 -## explicit; go 1.11 +## explicit golang.org/x/xerrors golang.org/x/xerrors/internal # gomodules.xyz/jsonpatch/v2 v2.1.0 -## explicit; go 1.12 +## explicit gomodules.xyz/jsonpatch/v2 # google.golang.org/appengine v1.6.6 -## explicit; go 1.11 +## explicit google.golang.org/appengine/internal google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore @@ -274,7 +274,7 @@ google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch # google.golang.org/protobuf v1.24.0 -## explicit; go 1.9 +## explicit google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt @@ -318,7 +318,7 @@ gopkg.in/yaml.v2 ## explicit gopkg.in/yaml.v3 # k8s.io/api v0.19.14 -## explicit; go 1.15 +## explicit k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 k8s.io/api/admissionregistration/v1 @@ -363,7 +363,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 # k8s.io/apiextensions-apiserver v0.19.2 -## explicit; go 1.15 +## explicit k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 @@ -372,7 +372,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 # k8s.io/apimachinery v0.19.14 -## explicit; go 1.15 +## explicit k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -419,7 +419,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect # k8s.io/client-go v0.19.14 -## explicit; go 1.15 +## explicit k8s.io/client-go/discovery k8s.io/client-go/discovery/fake k8s.io/client-go/dynamic @@ -497,7 +497,7 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/workqueue # k8s.io/code-generator v0.19.14 -## explicit; go 1.15 +## explicit k8s.io/code-generator k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen/args @@ -532,7 +532,7 @@ k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util k8s.io/code-generator/third_party/forked/golang/reflect # k8s.io/component-base v0.19.2 -## explicit; go 1.15 +## explicit k8s.io/component-base/config k8s.io/component-base/config/v1alpha1 # k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 @@ -548,10 +548,10 @@ k8s.io/gengo/namer k8s.io/gengo/parser k8s.io/gengo/types # k8s.io/klog/v2 v2.2.0 -## explicit; go 1.13 +## explicit k8s.io/klog/v2 # k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 -## explicit; go 1.12 +## explicit k8s.io/kube-openapi/cmd/openapi-gen/args k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/generators @@ -559,13 +559,13 @@ k8s.io/kube-openapi/pkg/generators/rules k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/sets # k8s.io/utils v0.0.0-20200912215256-4140de9c8800 -## explicit; go 1.12 +## explicit k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace # sigs.k8s.io/controller-runtime v0.7.2 -## explicit; go 1.15 +## explicit sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/pkg/builder sigs.k8s.io/controller-runtime/pkg/cache @@ -610,8 +610,8 @@ sigs.k8s.io/controller-runtime/pkg/webhook/conversion sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics # sigs.k8s.io/structured-merge-diff/v4 v4.1.2 -## explicit; go 1.13 +## explicit sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 -## explicit; go 1.12 +## explicit sigs.k8s.io/yaml