-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(csi): restructure the CSI as different mr executable (#601)
* Restructure the CSI as different executable Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com> * Move csi under /cmd Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com> --------- Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
- Loading branch information
Showing
24 changed files
with
111 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,9 @@ readme.txt | |
|
||
#OSX files | ||
**/.DS_Store | ||
|
||
# CSI executable | ||
mr-storage-initializer | ||
|
||
# KServe manifests | ||
istio-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Build the model-registry CSI binary | ||
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.22 AS builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY ["go.mod", "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 | ||
|
||
USER root | ||
# default NodeJS 14 is not enough for openapi-generator-cli, switch to Node JS currently supported | ||
RUN yum remove -y nodejs npm | ||
RUN yum module -y reset nodejs | ||
RUN yum module -y enable nodejs:18 | ||
# install npm and java for openapi-generator-cli | ||
RUN yum install -y nodejs npm java-11 python3 | ||
|
||
# Copy the go source | ||
COPY ["Makefile", "main.go", ".openapi-generator-ignore", "openapitools.json", "./"] | ||
|
||
# Copy rest of the source | ||
COPY cmd/ cmd/ | ||
COPY api/ api/ | ||
COPY internal/ internal/ | ||
COPY scripts/ scripts/ | ||
COPY pkg/ pkg/ | ||
COPY patches/ patches/ | ||
COPY templates/ templates/ | ||
|
||
# Download tools | ||
RUN make deps | ||
|
||
# NOTE: The two instructions below are effectively equivalent to 'make clean build' | ||
# DO NOT REMOVE THE 'build/prepare' TARGET!!! | ||
# It ensures consitent repeatable Dockerfile builds | ||
|
||
# prepare the build in a separate layer | ||
RUN make clean build/prepare/csi | ||
# compile separately to optimize multi-platform builds | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make build/compile/csi | ||
|
||
# Use distroless as minimal base image to package the model-registry binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest | ||
WORKDIR / | ||
# copy the storage initializer binary | ||
COPY --from=builder /workspace/mr-storage-initializer . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/mr-storage-initializer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.