Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boilerplate simplification #5134

Merged
merged 10 commits into from
Mar 29, 2024
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: 1 addition & 0 deletions Dockerfile.datacatalog
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.11 && \

WORKDIR /go/src/github.com/flyteorg/datacatalog

COPY boilerplate ../boilerplate
COPY datacatalog .
COPY flyteadmin ../flyteadmin
COPY flytecopilot ../flytecopilot
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.flyteadmin
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.11 && \

WORKDIR /go/src/github.com/flyteorg/flyteadmin

COPY boilerplate ../boilerplate
COPY datacatalog ../datacatalog
COPY flyteadmin .
COPY flytecopilot ../flytecopilot
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.flytecopilot
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apk add git openssh-client make curl

WORKDIR /go/src/github.com/flyteorg/flytecopilot

COPY boilerplate ../boilerplate
COPY datacatalog ../datacatalog
COPY flyteadmin ../flyteadmin
COPY flytecopilot .
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.flytepropeller
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apk add git openssh-client make curl

WORKDIR /go/src/github.com/flyteorg/flytepropeller

COPY boilerplate ../boilerplate
COPY datacatalog ../datacatalog
COPY flyteadmin ../flyteadmin
COPY flytecopilot ../flytecopilot
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.flytescheduler
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN mkdir /artifacts

WORKDIR /go/src/github.com/flyteorg/flyteadmin

COPY boilerplate ../boilerplate
COPY datacatalog ../datacatalog
COPY flyteadmin .
COPY flytecopilot ../flytecopilot
Expand Down
10 changes: 7 additions & 3 deletions boilerplate/flyte/golang_test_targets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

.PHONY: download_tooling
download_tooling: #download dependencies (including test deps) for the package
@boilerplate/flyte/golang_test_targets/download_tooling.sh
@../boilerplate/flyte/golang_test_targets/download_tooling.sh

.PHONY: generate
generate: download_tooling #generate go code
@boilerplate/flyte/golang_test_targets/go-gen.sh
@../boilerplate/flyte/golang_test_targets/go-gen.sh

.PHONY: lint
lint: download_tooling #lints the package for common code smells
Expand Down Expand Up @@ -50,8 +50,12 @@ test_unit_cover:
test_unit_visual:
go test ./... -coverprofile /tmp/cover.out -covermode=count
go tool cover -html=/tmp/cover.out

.PHONY: test_unit_codecov
test_unit_codecov:
go test ./... -race -coverprofile=coverage.txt -covermode=atomic
curl -s https://codecov.io/bash > codecov_bash.sh && bash codecov_bash.sh

.PHONY: go-tidy
go-tidy:
go mod tidy
24 changes: 13 additions & 11 deletions boilerplate/flyte/golang_test_targets/download_tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ set -e
# List of tools to go get
# In the format of "<cli>:<package>" or ":<package>" if no cli
tools=(
"github.com/EngHabu/mockery/cmd/mockery"
"github.com/flyteorg/flytestdlib/cli/pflags@latest"
"github.com/golangci/golangci-lint/cmd/golangci-lint"
"github.com/daixiang0/gci"
"github.com/alvaroloes/enumer"
"github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
"github.com/EngHabu/mockery/cmd/mockery"
"github.com/golangci/golangci-lint/cmd/golangci-lint"
"github.com/daixiang0/gci"
"github.com/alvaroloes/enumer"
"github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
)

# This ensures pflags are up to date.
make -C $REPO_ROOT/flytestdlib compile
cp $REPO_ROOT/flytestdlib/bin/pflags $(go env GOPATH)/bin

tmp_dir=$(mktemp -d -t gotooling-XXX)
echo "Using temp directory ${tmp_dir}"
cp -R boilerplate/flyte/golang_support_tools/* $tmp_dir
cp -R ../boilerplate/flyte/golang_support_tools/* $tmp_dir
pushd "$tmp_dir"

for tool in "${tools[@]}"
do
echo "Installing ${tool}"
GO111MODULE=on go install $tool
for tool in "${tools[@]}"; do
echo "Installing ${tool}"
GO111MODULE=on go install $tool
done

popd
3 changes: 0 additions & 3 deletions boilerplate/update.cfg

This file was deleted.

18 changes: 3 additions & 15 deletions datacatalog/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
export REPOSITORY=datacatalog
include boilerplate/flyte/docker_build/Makefile
include boilerplate/flyte/golang_test_targets/Makefile

.PHONY: update_boilerplate
update_boilerplate:
@curl https://raw.githubusercontent.com/flyteorg/boilerplate/master/boilerplate/update.sh -o boilerplate/update.sh
@boilerplate/update.sh
export REPO_ROOT=..
include ../boilerplate/flyte/docker_build/Makefile
include ../boilerplate/flyte/golang_test_targets/Makefile

.PHONY: compile
compile:
Expand All @@ -17,11 +13,3 @@ linux_compile: export CGO_ENABLED ?= 0
linux_compile: export GOOS ?= linux
linux_compile:
go build -o /artifacts/datacatalog ./cmd/

.PHONY: generate
generate:
@go generate ./...

.PHONY: go-tidy
go-tidy:
go mod tidy

This file was deleted.

2 changes: 0 additions & 2 deletions datacatalog/boilerplate/flyte/code_of_conduct/README.rst

This file was deleted.

12 changes: 0 additions & 12 deletions datacatalog/boilerplate/flyte/code_of_conduct/update.sh

This file was deleted.

14 changes: 0 additions & 14 deletions datacatalog/boilerplate/flyte/end2end/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions datacatalog/boilerplate/flyte/end2end/end2end.sh

This file was deleted.

This file was deleted.

Loading
Loading