diff --git a/boilerplate/flyte/end2end/Makefile b/boilerplate/flyte/end2end/Makefile deleted file mode 100644 index 3ca4fc5bbe..0000000000 --- a/boilerplate/flyte/end2end/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -.PHONY: end2end_execute -end2end_execute: - ./boilerplate/flyte/end2end/end2end.sh - \ No newline at end of file diff --git a/boilerplate/flyte/end2end/end2end.sh b/boilerplate/flyte/end2end/end2end.sh deleted file mode 100755 index b2492de01c..0000000000 --- a/boilerplate/flyte/end2end/end2end.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -OUT="${DIR}/tmp" -rm -rf ${OUT} -git clone https://github.com/flyteorg/flyte.git "${OUT}" - -pushd ${OUT} - -if [ ! -z "$IMAGE" ]; -then - kind load docker-image ${IMAGE} - if [ ${IMAGE_NAME} -eq "flytepropeller" ] - then - sed -i.bak -e "s_${IMAGE_NAME}:.*_${IMAGE}_g" ${OUT}/kustomize/base/propeller/deployment.yaml - fi - - if [ ${IMAGE} -eq "flyteadmin" ] - then - sed -i.bak -e "s_${IMAGE_NAME}:.*_${IMAGE}_g" ${OUT}/kustomize/base/admindeployment/deployment.yaml - fi -fi - -make kustomize -make end2end_execute -popd diff --git a/boilerplate/flyte/flyte_golang_compile/Readme.rst b/boilerplate/flyte/flyte_golang_compile/Readme.rst deleted file mode 100644 index e6b56dd16e..0000000000 --- a/boilerplate/flyte/flyte_golang_compile/Readme.rst +++ /dev/null @@ -1,16 +0,0 @@ -Flyte Golang Compile -~~~~~~~~~~~~~~~~~~~~ - -Common compile script for Flyte golang services. - -**To Enable:** - -Add ``flyteorg/flyte_golang_compile`` to your ``boilerplate/update.cfg`` file. - -Add the following to your Makefile - -:: - - .PHONY: compile_linux - compile_linux: - PACKAGES={{ *your packages }} OUTPUT={{ /path/to/output }} ./boilerplate/flyte/flyte_golang_compile.sh diff --git a/boilerplate/flyte/flyte_golang_compile/flyte_golang_compile.Template b/boilerplate/flyte/flyte_golang_compile/flyte_golang_compile.Template deleted file mode 100644 index f587e971be..0000000000 --- a/boilerplate/flyte/flyte_golang_compile/flyte_golang_compile.Template +++ /dev/null @@ -1,26 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -if [ -z "$PACKAGES" ]; then - echo "PACKAGES environment VAR not set" - exit 1 -fi - -if [ -z "$OUTPUT" ]; then - echo "OUTPUT environment VAR not set" - exit 1 -fi - -# get the GIT_SHA and RELEASE_SEMVER - -GIT_SHA=$(git rev-parse HEAD) -RELEASE_SEMVER=$(git describe --tags --exact-match $GIT_SHA 2>/dev/null) - -CURRENT_PKG=github.com/flyteorg/{{ REPOSITORY }} -VERSION_PKG="${CURRENT_PKG}/vendor/github.com/flyteorg/flytestdlib" - -LDFLAGS="-X ${VERSION_PKG}/version.Build=${GIT_SHA} -X ${VERSION_PKG}/version.Version=${RELEASE_SEMVER}" - -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUTPUT" "$PACKAGES" diff --git a/boilerplate/flyte/flyte_golang_compile/update.sh b/boilerplate/flyte/flyte_golang_compile/update.sh deleted file mode 100755 index b1e6101c2b..0000000000 --- a/boilerplate/flyte/flyte_golang_compile/update.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -echo " - generating ${DIR}/flyte_golang_compile.sh" -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/flyte_golang_compile.Template > ${DIR}/flyte_golang_compile.sh diff --git a/boilerplate/flyte/github_workflows/Readme.rst b/boilerplate/flyte/github_workflows/Readme.rst deleted file mode 100644 index 905ddd81d8..0000000000 --- a/boilerplate/flyte/github_workflows/Readme.rst +++ /dev/null @@ -1,22 +0,0 @@ -Golang Github Actions -~~~~~~~~~~~~~~~~~ - -Provides a two github actions workflows. - -**To Enable:** - -Add ``flyteorg/github_workflows`` to your ``boilerplate/update.cfg`` file. - -Add a github secret ``package_name`` with the name to use for publishing (e.g. ``flytepropeller``). Typicaly, this will be the same name as the repository. - -*Note*: If you are working on a fork, include that prefix in your package name (``myfork/flytepropeller``). - -The actions will push to 2 repos: - - 1. ``docker.pkg.github.com/flyteorg//`` - 2. ``docker.pkg.github.com/flyteorg//-stages`` : this repo is used to cache build stages to speed up iterative builds after. - -There are two workflows that get deployed: - - 1. A workflow that runs on Pull Requests to build and push images to github registy tagged with the commit sha. - 2. A workflow that runs on master merges that bump the patch version of release tag, builds and pushes images to github registry tagged with the version, commit sha as well as "latest" diff --git a/boilerplate/flyte/github_workflows/master.yml b/boilerplate/flyte/github_workflows/master.yml deleted file mode 100644 index a8eab5af0e..0000000000 --- a/boilerplate/flyte/github_workflows/master.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Master - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - fetch-depth: '0' - - name: Bump version and push tag - id: bump-version - uses: anothrNick/github-tag-action@1.17.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true - DEFAULT_BUMP: patch - - name: Push Docker Image to Github Registry - uses: whoan/docker-build-with-cache-action@v5 - with: - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - image_name: ${{ secrets.package_name }} - image_tag: latest,${{ github.sha }},${{ steps.bump-version.outputs.tag }} - push_git_tag: true - registry: docker.pkg.github.com - build_extra_args: "--compress=true" diff --git a/boilerplate/flyte/github_workflows/pull_request.yml b/boilerplate/flyte/github_workflows/pull_request.yml deleted file mode 100644 index 932400bc4f..0000000000 --- a/boilerplate/flyte/github_workflows/pull_request.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Pull Request - -on: - pull_request - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Push Docker Image to Github Registry - uses: whoan/docker-build-with-cache-action@v5 - with: - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - image_name: ${{ secrets.package_name }} - image_tag: ${{ github.sha }} - push_git_tag: true - registry: docker.pkg.github.com diff --git a/boilerplate/flyte/github_workflows/update.sh b/boilerplate/flyte/github_workflows/update.sh deleted file mode 100755 index d5a74a4fc0..0000000000 --- a/boilerplate/flyte/github_workflows/update.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -mkdir -p ${DIR}/../../../.github/workflows - -echo " - generating github action workflows in root directory." -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/master.yml > ${DIR}/../../../.github/workflows/master.yml -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/pull_request.yml > ${DIR}/../../../.github/workflows/pull_request.yml diff --git a/boilerplate/flyte/golang_dockerfile/Dockerfile.GoTemplate b/boilerplate/flyte/golang_dockerfile/Dockerfile.GoTemplate deleted file mode 100644 index 2b5b775c62..0000000000 --- a/boilerplate/flyte/golang_dockerfile/Dockerfile.GoTemplate +++ /dev/null @@ -1,32 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -FROM golang:1.13.3-alpine3.10 as builder -RUN apk add git openssh-client make curl - -# COPY only the go mod files for efficient caching -COPY go.mod go.sum /go/src/github.com/flyteorg/{{REPOSITORY}}/ -WORKDIR /go/src/github.com/flyteorg/{{REPOSITORY}} - -# Pull dependencies -RUN go mod download - -# COPY the rest of the source code -COPY . /go/src/github.com/flyteorg/{{REPOSITORY}}/ - -# This 'linux_compile' target should compile binaries to the /artifacts directory -# The main entrypoint should be compiled to /artifacts/{{REPOSITORY}} -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.10 -COPY --from=builder /artifacts /bin - -RUN apk --update add ca-certificates - -CMD ["{{REPOSITORY}}"] diff --git a/boilerplate/flyte/golang_dockerfile/Readme.rst b/boilerplate/flyte/golang_dockerfile/Readme.rst deleted file mode 100644 index dba3b34f60..0000000000 --- a/boilerplate/flyte/golang_dockerfile/Readme.rst +++ /dev/null @@ -1,16 +0,0 @@ -Golang Dockerfile -~~~~~~~~~~~~~~~~~ - -Provides a Dockerfile that produces a small image. - -**To Enable:** - -Add ``flyteorg/golang_dockerfile`` to your ``boilerplate/update.cfg`` file. - -Create and configure a ``make linux_compile`` target that compiles your go binaries to the ``/artifacts`` directory :: - - .PHONY: linux_compile - linux_compile: - RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts {{ packages }} - -All binaries compiled to ``/artifacts`` will be available at ``/bin`` in your final image. diff --git a/boilerplate/flyte/golang_dockerfile/update.sh b/boilerplate/flyte/golang_dockerfile/update.sh deleted file mode 100755 index 5439bada4f..0000000000 --- a/boilerplate/flyte/golang_dockerfile/update.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -echo " - generating Dockerfile in root directory." -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/Dockerfile.GoTemplate > ${DIR}/../../../Dockerfile diff --git a/boilerplate/flyte/golangci_file/.golangci.yml b/boilerplate/flyte/golangci_file/.golangci.yml deleted file mode 100644 index 5d53f35295..0000000000 --- a/boilerplate/flyte/golangci_file/.golangci.yml +++ /dev/null @@ -1,30 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -run: - skip-dirs: - - pkg/client - -linters: - disable-all: true - enable: - - deadcode - - errcheck - - gas - - goconst - - goimports - - golint - - gosimple - - govet - - ineffassign - - misspell - - nakedret - - staticcheck - - structcheck - - typecheck - - unconvert - - unparam - - unused - - varcheck diff --git a/boilerplate/flyte/golangci_file/Readme.rst b/boilerplate/flyte/golangci_file/Readme.rst deleted file mode 100644 index e4cbd18b96..0000000000 --- a/boilerplate/flyte/golangci_file/Readme.rst +++ /dev/null @@ -1,8 +0,0 @@ -GolangCI File -~~~~~~~~~~~~~ - -Provides a ``.golangci`` file with the linters we've agreed upon. - -**To Enable:** - -Add ``flyteorg/golangci_file`` to your ``boilerplate/update.cfg`` file. diff --git a/boilerplate/flyte/golangci_file/update.sh b/boilerplate/flyte/golangci_file/update.sh deleted file mode 100755 index ab2f85c680..0000000000 --- a/boilerplate/flyte/golangci_file/update.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -# Clone the .golangci file -echo " - copying ${DIR}/.golangci to the root directory." -cp ${DIR}/.golangci.yml ${DIR}/../../../.golangci.yml diff --git a/boilerplate/flyte/Readme.rst b/boilerplate/flyte/welcome_bot/Readme.rst similarity index 100% rename from boilerplate/flyte/Readme.rst rename to boilerplate/flyte/welcome_bot/Readme.rst diff --git a/boilerplate/flyte/config.yml b/boilerplate/flyte/welcome_bot/config.yml similarity index 100% rename from boilerplate/flyte/config.yml rename to boilerplate/flyte/welcome_bot/config.yml diff --git a/boilerplate/flyte/update.sh b/boilerplate/flyte/welcome_bot/update.sh similarity index 88% rename from boilerplate/flyte/update.sh rename to boilerplate/flyte/welcome_bot/update.sh index c04debde54..2db64ac3f1 100755 --- a/boilerplate/flyte/update.sh +++ b/boilerplate/flyte/welcome_bot/update.sh @@ -11,4 +11,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # Clone the config.yml file echo " - copying ${DIR}/config.yml to the root directory." -cp "${DIR}"/config.yml "${DIR}"/../../.github/config.yml +cp "${DIR}"/config.yml "${DIR}"/../../../.github/config.yml + diff --git a/boilerplate/update.cfg b/boilerplate/update.cfg index b7e9a8cdc1..6eb17e23c8 100755 --- a/boilerplate/update.cfg +++ b/boilerplate/update.cfg @@ -2,4 +2,4 @@ flyte/golang_test_targets flyte/golang_support_tools flyte/pull_request_template flyte/docker_build -flyte/ +flyte/welcome_bot diff --git a/boilerplate/update.sh b/boilerplate/update.sh index 73de4dc91c..9173b662de 100755 --- a/boilerplate/update.sh +++ b/boilerplate/update.sh @@ -70,4 +70,4 @@ while read -r directory junk; do fi echo "***********************************************************************************" echo "" -done < "$CONFIG_FILE" +done < "$CONFIG_FILE" \ No newline at end of file