Skip to content

Commit

Permalink
issue-11296 - WIP - reverted Dockerfile.scheduledworkflow and added D…
Browse files Browse the repository at this point in the history
…ockerfile.scheduledworkflow.debug

Signed-off-by: Helber Belmiro <[email protected]>
  • Loading branch information
hbelmiro committed Dec 16, 2024
1 parent 9bade10 commit 8ed1796
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 16 deletions.
26 changes: 10 additions & 16 deletions backend/Dockerfile.scheduledworkflow
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ FROM golang:1.21.7-alpine3.19 as builder

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

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go install github.com/go-delve/delve/cmd/dlv@latest

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

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go mod download
RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .
Expand All @@ -31,33 +29,29 @@ COPY . .
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go build -gcflags "all=-N -l" -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
#RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow
#RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \
# diff /tmp/licenses.csv backend/third_party_licenses/swf.csv && \
# go-licenses save ./backend/src/crd/controller/scheduledworkflow --save_path /tmp/NOTICES
RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow
RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/swf.csv && \
go-licenses save ./backend/src/crd/controller/scheduledworkflow --save_path /tmp/NOTICES

FROM alpine:3.19

RUN apk --no-cache add tzdata file
RUN apk --no-cache add tzdata

RUN adduser -S appuser
USER appuser

WORKDIR /bin

COPY --from=builder /go/bin/dlv .
#COPY --from=builder /go/src/github.com/kubeflow/pipelines /go/src/github.com/kubeflow/pipelines

COPY --from=builder /bin/controller /bin/controller
# Copy licenses and notices.
#COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
#COPY --from=builder /tmp/NOTICES /third_party/NOTICES
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENV NAMESPACE ""
ENV LOG_LEVEL info

#CMD /bin/controller --logtostderr=true --namespace=${NAMESPACE} --logLevel=${LOG_LEVEL}
CMD ["dlv", "--headless=true", "--listen=:2345", "--api-version=2", "--accept-multiclient", "--log", "--log-output=debugger,rpc", "exec", "/bin/controller", "--", "--logtostderr=true", "--namespace=kubeflow", "--logLevel=info"]
CMD /bin/controller --logtostderr=true --namespace=${NAMESPACE} --logLevel=${LOG_LEVEL}
63 changes: 63 additions & 0 deletions backend/Dockerfile.scheduledworkflow.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2021 The Kubeflow Authors
#
# 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.

FROM golang:1.21.7-alpine3.19 as builder

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

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go install github.com/go-delve/delve/cmd/dlv@latest

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

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

# Needed musl-dev for github.com/mattn/go-sqlite3
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

RUN GO111MODULE=on GOOS=linux GOARCH=arm64 go build -gcflags "all=-N -l" -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
#RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow
#RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \
# diff /tmp/licenses.csv backend/third_party_licenses/swf.csv && \
# go-licenses save ./backend/src/crd/controller/scheduledworkflow --save_path /tmp/NOTICES

FROM alpine:3.19

RUN apk --no-cache add tzdata file

RUN adduser -S appuser
USER appuser

WORKDIR /bin

COPY --from=builder /go/bin/dlv .
#COPY --from=builder /go/src/github.com/kubeflow/pipelines /go/src/github.com/kubeflow/pipelines

COPY --from=builder /bin/controller /bin/controller
# Copy licenses and notices.
#COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
#COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENV NAMESPACE ""
ENV LOG_LEVEL info

#CMD /bin/controller --logtostderr=true --namespace=${NAMESPACE} --logLevel=${LOG_LEVEL}
CMD ["dlv", "--headless=true", "--listen=:2345", "--api-version=2", "--accept-multiclient", "--log", "--log-output=debugger,rpc", "exec", "/bin/controller", "--", "--logtostderr=true", "--namespace=kubeflow", "--logLevel=info"]

0 comments on commit 8ed1796

Please sign in to comment.