Skip to content

Commit

Permalink
Merge pull request #111 from hbelmiro/cache-images
Browse files Browse the repository at this point in the history
UPSTREAM: <carry>: Added cached layer for Go dependencies to Dockerfiles
  • Loading branch information
HumairAK authored Nov 18, 2024
2 parents e27b687 + 142df82 commit 7c3b020
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ RUN dnf install -y cmake clang openssl
COPY ${SOURCE_CODE}/go.mod ./
COPY ${SOURCE_CODE}/go.sum ./

RUN GO111MODULE=on go mod download

# Copy the source
COPY ${SOURCE_CODE}/ ./

Expand Down
9 changes: 8 additions & 1 deletion backend/Dockerfile.cacheserver
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go

# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/cache
RUN go-licenses csv ./backend/src/cache > /tmp/licenses.csv && \
Expand Down
2 changes: 2 additions & 0 deletions backend/Dockerfile.driver
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ USER root
COPY ${SOURCE_CODE}/go.mod ./
COPY ${SOURCE_CODE}/go.sum ./

RUN GO111MODULE=on go mod download

# Copy the source
COPY ${SOURCE_CODE}/ ./

Expand Down
2 changes: 2 additions & 0 deletions backend/Dockerfile.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ USER root
COPY ${SOURCE_CODE}/go.mod ./
COPY ${SOURCE_CODE}/go.sum ./

RUN GO111MODULE=on go mod download

# Copy the source
COPY ${SOURCE_CODE}/ ./

Expand Down
2 changes: 2 additions & 0 deletions backend/Dockerfile.persistenceagent
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ RUN dnf install -y bash git openssh gcc
COPY ${SOURCE_CODE}/go.mod ./
COPY ${SOURCE_CODE}/go.sum ./

RUN GO111MODULE=on go mod download

# Copy the source
COPY ${SOURCE_CODE}/ ./

Expand Down
2 changes: 2 additions & 0 deletions backend/Dockerfile.scheduledworkflow
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ RUN dnf upgrade -y && \
COPY ${SOURCE_CODE}/go.mod ./
COPY ${SOURCE_CODE}/go.sum ./

RUN GO111MODULE=on go mod download

# Copy the source
COPY ${SOURCE_CODE}/ ./

Expand Down
9 changes: 8 additions & 1 deletion backend/Dockerfile.viewercontroller
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ RUN apk update && apk upgrade
RUN apk add --no-cache git gcc musl-dev

WORKDIR /src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/viewer/*.go
# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/crd/controller/viewer
RUN go-licenses csv ./backend/src/crd/controller/viewer > /tmp/licenses.csv && \
Expand Down

0 comments on commit 7c3b020

Please sign in to comment.