Skip to content

Commit

Permalink
use flyteidl repo
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Sep 29, 2023
1 parent d586b44 commit 4afbd5c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
43 changes: 43 additions & 0 deletions flyteartifacts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM --platform=${BUILDPLATFORM} golang:1.19-alpine3.16 as builder

ARG TARGETARCH
ENV GOARCH "${TARGETARCH}"
ENV GOOS linux

RUN apk add git openssh-client make curl

# Create the artifacts directory
RUN mkdir /artifacts


# COPY only the go mod files for efficient caching
COPY go.mod go.sum /go/src/github.com/flyteorg/flyte/flyteartifacts/
WORKDIR /go/src/github.com/flyteorg/flyte/flyteartifacts/


# Pull dependencies
RUN go mod download

# COPY the rest of the source code
COPY . /go/src/github.com/flyteorg/flyte/flyteartifacts/

# This 'linux_compile' target should compile binaries to the /artifacts directory
# The main entrypoint should be compiled to /artifacts/flyteadmin
RUN make linux_compile

# update the PATH to include the /artifacts directory
ENV PATH="/artifacts:${PATH}"

# This will eventually move to centurylink/ca-certs:latest for minimum possible image size
FROM alpine:3.16
LABEL org.opencontainers.image.source https://github.com/flyteorg/flyte/

COPY --from=builder /artifacts /bin

# Ensure the latest CA certs are present to authenticate SSL connections.
RUN apk --update add ca-certificates

RUN addgroup -S flyte && adduser -S flyte -G flyte
USER flyte

CMD ["artifacts"]
6 changes: 6 additions & 0 deletions flyteartifacts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.PHONY: linux_compile
linux_compile: export CGO_ENABLED ?= 0
linux_compile: export GOOS ?= linux
linux_compile:
go build -o /artifacts/flyteadmin -ldflags=$(LD_FLAGS) ./cmd/
2 changes: 1 addition & 1 deletion flyteartifacts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ require (
google.golang.org/protobuf v1.30.0 // indirect
)

replace github.com/flyteorg/flyteidl => ../flyteidl
replace github.com/flyteorg/flyteidl => github.com/flyteorg/flyteidl v1.5.14-0.20230928230632-4854ce7ad143
2 changes: 2 additions & 0 deletions flyteartifacts/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/flyteorg/flyteidl v1.5.14-0.20230928230632-4854ce7ad143 h1:H8SEoRv2bgdXPIAxQS2iHUkmd8YW38uTUtfl3a4LKu4=
github.com/flyteorg/flyteidl v1.5.14-0.20230928230632-4854ce7ad143/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
Expand Down

0 comments on commit 4afbd5c

Please sign in to comment.