diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 374fe8150b..6b718c627c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -29,3 +29,14 @@ jobs: push_git_tag: true registry: docker.pkg.github.com build_extra_args: "--compress=true" + - uses: engineerd/setup-kind@v0.4.0 + - name: End2End + env: + DOCKER_USERNAME: ${{ github.actor }} + DOCKER_PASSWORD: "${{ secrets.GITHUB_TOKEN }}" + run: | + kubectl cluster-info + kubectl get pods -n kube-system + echo "current-context:" $(kubectl config current-context) + echo "environment-kubeconfig:" ${KUBECONFIG} + PROPELLER=${{ secrets.flytegithub_repo }}/operator:${{ github.sha }} make end2end_execute diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b87963a5f1..725668e051 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,6 +6,10 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + go-version: [1.13] steps: - uses: actions/checkout@v1 - name: Push Docker Image to Github Registry @@ -17,3 +21,14 @@ jobs: image_tag: ${{ github.sha }} push_git_tag: true registry: docker.pkg.github.com + - uses: engineerd/setup-kind@v0.4.0 + - name: End2End + env: + DOCKER_USERNAME: ${{ github.actor }} + DOCKER_PASSWORD: "${{ secrets.GITHUB_TOKEN }}" + run: | + kubectl cluster-info + kubectl get pods -n kube-system + echo "current-context:" $(kubectl config current-context) + echo "environment-kubeconfig:" ${KUBECONFIG} + PROPELLER=${{ secrets.flytegithub_repo }}/operator:${{ github.sha }} make end2end_execute diff --git a/.gitignore b/.gitignore index 9ccd65b879..426b90e2df 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vendor bin .DS_Store _test +boilerplate/lyft/end2end/tmp diff --git a/Makefile b/Makefile index 04e0ca1964..45a6447858 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ export REPOSITORY=flytepropeller include boilerplate/lyft/docker_build/Makefile include boilerplate/lyft/golang_test_targets/Makefile +include boilerplate/lyft/end2end/Makefile .PHONY: update_boilerplate update_boilerplate: diff --git a/boilerplate/lyft/end2end/Makefile b/boilerplate/lyft/end2end/Makefile new file mode 100644 index 0000000000..1d8397f230 --- /dev/null +++ b/boilerplate/lyft/end2end/Makefile @@ -0,0 +1,8 @@ +# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. +# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: +# +# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst + +.PHONY: end2end_execute +end2end_execute: + ./boilerplate/lyft/end2end/end2end.sh diff --git a/boilerplate/lyft/end2end/end2end.sh b/boilerplate/lyft/end2end/end2end.sh new file mode 100755 index 0000000000..2096b16084 --- /dev/null +++ b/boilerplate/lyft/end2end/end2end.sh @@ -0,0 +1,28 @@ +#!/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 'LYFT/BOILERPLATE' REPOSITORY: +# +# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/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/lyft/flyte.git "${OUT}" + +# TODO: load all images +echo "Loading github docker images into 'kind' cluster to workaround this issue: https://github.com/containerd/containerd/issues/3291#issuecomment-631746985" +docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD} docker.pkg.github.com +docker pull docker.pkg.github.com/${PROPELLER} +kind load docker-image docker.pkg.github.com/${PROPELLER} + +pushd ${OUT} +# TODO: Only replace propeller if it's passed in +# TODO: Support replacing other images too +sed -i.bak -e "s_docker.io/lyft/flytepropeller:.*_docker.pkg.github.com/${PROPELLER}_g" ${OUT}/kustomize/base/propeller/deployment.yaml +make kustomize +make end2end_execute +popd