Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Infer GOOS and GOARCH from environment #550

Merged
merged 3 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}


push-docker-image-flytescheduler:
name: Build & Push Flytescheduler Image
needs: [ bump_version ]
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ docker_build_scheduler:
docker build -t $$FLYTE_SCHEDULER_REPOSITORY:$(GIT_HASH) -f Dockerfile.scheduler .

.PHONY: integration
integration: export CGO_ENABLED ?= 0
integration: export GOFLAGS ?= -count=1
integration:
CGO_ENABLED=0 GOFLAGS="-count=1" go test -v -tags=integration ./tests/...
go test -v -tags=integration ./tests/...

.PHONY: k8s_integration
k8s_integration:
Expand Down Expand Up @@ -51,12 +53,16 @@ compile_scheduler_debug:


.PHONY: linux_compile
linux_compile: export CGO_ENABLED ?= 0
linux_compile: export GOOS ?= linux
linux_compile:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flyteadmin -ldflags=$(LD_FLAGS) ./cmd/
go build -o /artifacts/flyteadmin -ldflags=$(LD_FLAGS) ./cmd/

.PHONY: linux_compile_scheduler
linux_compile_scheduler: export CGO_ENABLED ?= 0
linux_compile_scheduler: export GOOS ?= linux
linux_compile_scheduler:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flytescheduler -ldflags=$(LD_FLAGS) ./cmd/scheduler/
go build -o /artifacts/flytescheduler -ldflags=$(LD_FLAGS) ./cmd/scheduler/


.PHONY: server
Expand All @@ -77,4 +83,3 @@ seed_projects:
go run cmd/main.go migrate seed-projects project admintests flytekit --server.kube-config ~/.kube/config --config flyteadmin_config.yaml

all: compile

7 changes: 6 additions & 1 deletion scheduler.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst

FROM golang:1.18-alpine3.15 as builder
FROM --platform=${BUILDPLATFORM} golang:1.18-alpine3.15 as builder

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

RUN apk add git openssh-client make curl

# COPY only the go mod files for efficient caching
Expand Down