From e800fe7ada2a5f7f376b5437b1ffe06f3d234e2c Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sat, 25 Jul 2020 22:06:09 +0800 Subject: [PATCH 1/6] Create multi-stage Github Actions --- .github/workflows/code_standards.yaml | 42 ------ .github/workflows/complete.yml | 105 +++++++++++++++ .github/workflows/docker_compose_tests.yml | 15 --- .github/workflows/integration_tests.yml | 18 --- .github/workflows/master_only.yml | 50 ++++++++ .github/workflows/unit_tests.yml | 45 ------- .prow/config.yaml | 142 +-------------------- Makefile | 6 + 8 files changed, 162 insertions(+), 261 deletions(-) delete mode 100644 .github/workflows/code_standards.yaml create mode 100644 .github/workflows/complete.yml delete mode 100644 .github/workflows/docker_compose_tests.yml delete mode 100644 .github/workflows/integration_tests.yml create mode 100644 .github/workflows/master_only.yml delete mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/code_standards.yaml b/.github/workflows/code_standards.yaml deleted file mode 100644 index 92ff8effee..0000000000 --- a/.github/workflows/code_standards.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: code standards - -on: [push, pull_request] - -jobs: - lint-java: - container: gcr.io/kf-feast/feast-ci:latest - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: lint java - run: make lint-java - - lint-python: - container: gcr.io/kf-feast/feast-ci:latest - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: install dependencies - run: make install-python-ci-dependencies - - name: compile protos - run: make compile-protos-python - - name: lint python - run: make lint-python - - lint-go: - container: gcr.io/kf-feast/feast-ci:latest - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: install dependencies - run: make install-go-ci-dependencies - - name: lint go - run: make lint-go - - lint-versions: - container: gcr.io/kf-feast/feast-ci:latest - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: install dependencies - run: make lint-versions \ No newline at end of file diff --git a/.github/workflows/complete.yml b/.github/workflows/complete.yml new file mode 100644 index 0000000000..20e4742f2f --- /dev/null +++ b/.github/workflows/complete.yml @@ -0,0 +1,105 @@ +name: complete workflow + +on: [push, pull_request] + +jobs: + build-docker-images: + runs-on: [self-hosted, builder] + strategy: + matrix: + component: [core, serving] + steps: + - uses: actions/checkout@v2 + - name: build image + run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} + - name: push image + run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} + + lint-java: + container: gcr.io/kf-feast/feast-ci:latest + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: lint java + run: make lint-java + + lint-python: + container: gcr.io/kf-feast/feast-ci:latest + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: make install-python-ci-dependencies + - name: compile protos + run: make compile-protos-python + - name: lint python + run: make lint-python + + lint-go: + container: gcr.io/kf-feast/feast-ci:latest + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: make install-go-ci-dependencies + - name: lint go + run: make lint-go + + lint-versions: + container: gcr.io/kf-feast/feast-ci:latest + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: make lint-versions + + unit-test-java: + runs-on: ubuntu-latest + container: gcr.io/kf-feast/feast-ci:latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: test java + run: make test-java-with-coverage + - uses: actions/upload-artifact@v2 + with: + name: java-coverage-report + path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/ + + unit-test-python: + runs-on: ubuntu-latest + container: gcr.io/kf-feast/feast-ci:latest + steps: + - uses: actions/checkout@v2 + - name: install python + run: make install-python + - name: test python + run: make test-python + + unit-test-go: + runs-on: ubuntu-latest + container: gcr.io/kf-feast/feast-ci:latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: make compile-protos-go + - name: test go + run: make test-go + + integration-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: '11' + java-package: jdk + architecture: x64 + - name: Run integration tests + run: make test-java-integration \ No newline at end of file diff --git a/.github/workflows/docker_compose_tests.yml b/.github/workflows/docker_compose_tests.yml deleted file mode 100644 index 2984ebc37b..0000000000 --- a/.github/workflows/docker_compose_tests.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: docker compose tests - -on: - push: - branches: - - master - -jobs: - basic-redis-e2e-tests-docker-compose: - runs-on: ubuntu-latest - name: basic redis e2e tests on docker compose - steps: - - uses: actions/checkout@v2 - - name: test docker compose - run: ./infra/scripts/test-docker-compose.sh diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml deleted file mode 100644 index 699d5f63d5..0000000000 --- a/.github/workflows/integration_tests.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: integration tests - -on: [push, pull_request] - -jobs: - maven-integration-test: - runs-on: ubuntu-latest - name: integration-test-java - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: '11' - java-package: jdk - architecture: x64 - - name: Run integration tests - run: make test-java-integration \ No newline at end of file diff --git a/.github/workflows/master_only.yml b/.github/workflows/master_only.yml new file mode 100644 index 0000000000..934005baf6 --- /dev/null +++ b/.github/workflows/master_only.yml @@ -0,0 +1,50 @@ +name: master only + +on: + push: + branches: master + tags: + - 'v*.*.*' + +jobs: + + build-docker-images: + runs-on: [self-hosted, builder] + strategy: + matrix: + component: [core, serving, jupyter, ci] + steps: + - uses: actions/checkout@v2 + - name: build image + run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} + - name: push image + run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} + - name: push feast dev + run: | + if [ ${GITHUB_REF#refs/*/} == "master" ]; then + docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:dev + # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:dev + fi + - name: get version + id: get_version + run: echo ::set-output name=VERSION::${${GITHUB_REF/refs\/tags\//}:1} + - name: push versioned release + run: | + + # Build and push semver tagged commits + rx='^([0-9]+\.){0,2}(\*|[0-9]+)$' + if [[ ${{ steps.get_version.outputs.VERSION }} =~ $rx ]]; then + + docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + + # Also update "latest" image if tagged commit is pushed to stable branch + HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1) + echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG" + + if [ ${{ steps.get_version.outputs.VERSION }} == "${HIGHEST_SEMVER_TAG:1}" ] + then + docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + fi + fi \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index f71788a90b..0000000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: unit tests - -on: [push, pull_request] - -jobs: - unit-test-java: - runs-on: ubuntu-latest - container: gcr.io/kf-feast/feast-ci:latest - name: unit test java - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: test java - run: make test-java-with-coverage - - uses: actions/upload-artifact@v2 - with: - name: java-coverage-report - path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/ - - unit-test-python: - runs-on: ubuntu-latest - container: gcr.io/kf-feast/feast-ci:latest - name: unit test python - steps: - - uses: actions/checkout@v2 - - name: install python - run: make install-python - - name: test python - run: make test-python - - unit-test-go: - runs-on: ubuntu-latest - container: gcr.io/kf-feast/feast-ci:latest - name: unit test go - steps: - - uses: actions/checkout@v2 - - name: install dependencies - run: make compile-protos-go - - name: test go - run: make test-go diff --git a/.prow/config.yaml b/.prow/config.yaml index 17d3a8af56..8d4e407323 100644 --- a/.prow/config.yaml +++ b/.prow/config.yaml @@ -154,7 +154,7 @@ presubmits: memory: "6144Mi" skip_branches: - ^v0\.(3|4)-branch$ - + - name: test-end-to-end-auth decorate: true always_run: true @@ -300,55 +300,6 @@ presubmits: skip_branches: - ^v0\.(3|4)-branch$ - - name: publish-docker-images - decorate: true - always_run: true - spec: - containers: - - image: google/cloud-sdk:302.0.0 - command: - - bash - - -c - - | - infra/scripts/download-maven-cache.sh \ - --archive-uri gs://feast-templocation-kf-feast/.m2.2020-07-13.tar \ - --output-dir $PWD/ - - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-core \ - --tag ${PULL_PULL_SHA} \ - --file infra/docker/core/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-serving \ - --tag ${PULL_PULL_SHA} \ - --file infra/docker/serving/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-jupyter \ - --tag ${PULL_PULL_SHA} \ - --file infra/docker/jupyter/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - volumeMounts: - - name: docker-socket - mountPath: /var/run/docker.sock - - name: service-account - mountPath: /etc/gcloud/service-account.json - subPath: service-account.json - readOnly: true - securityContext: - privileged: true - volumes: - - name: docker-socket - hostPath: - path: /var/run/docker.sock - - name: service-account - secret: - secretName: feast-service-account - postsubmits: feast-dev/feast: - name: publish-python-sdk @@ -436,97 +387,6 @@ postsubmits: # Filter on tags with semantic versioning, prefixed with "v". v0.3 and v0.4 only. - ^v0\.(3|4)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ - - name: publish-docker-images - decorate: true - spec: - containers: - - image: google/cloud-sdk:302.0.0 - command: - - bash - - -c - - | - # Load cache to speed up builds - infra/scripts/download-maven-cache.sh \ - --archive-uri gs://feast-templocation-kf-feast/.m2.2020-07-13.tar \ - --output-dir $PWD/ - - # Build images based on SHAs - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-core \ - --tag ${PULL_BASE_SHA} \ - --file infra/docker/core/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-serving \ - --tag ${PULL_BASE_SHA} \ - --file infra/docker/serving/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - infra/scripts/publish-docker-image.sh \ - --repository gcr.io/kf-feast/feast-jupyter \ - --tag ${PULL_BASE_SHA} \ - --file infra/docker/jupyter/Dockerfile \ - --google-service-account-file /etc/gcloud/service-account.json - - # Create a "dev" image for the master branch - if [ $PULL_BASE_REF == "master" ]; then - docker tag gcr.io/kf-feast/feast-core:${PULL_BASE_SHA} gcr.io/kf-feast/feast-core:dev - docker push gcr.io/kf-feast/feast-core:dev - - docker tag gcr.io/kf-feast/feast-serving:${PULL_BASE_SHA} gcr.io/kf-feast/feast-serving:dev - docker push gcr.io/kf-feast/feast-serving:dev - fi - - # Build and push semver tagged commits - rx='^([0-9]+\.){0,2}(\*|[0-9]+)$' - if [[ ${PULL_BASE_REF:1} =~ $rx ]]; then - - docker tag gcr.io/kf-feast/feast-core:${PULL_BASE_SHA} gcr.io/kf-feast/feast-core:${PULL_BASE_REF:1} - docker push gcr.io/kf-feast/feast-core:${PULL_BASE_REF:1} - - docker tag gcr.io/kf-feast/feast-serving:${PULL_BASE_SHA} gcr.io/kf-feast/feast-serving:${PULL_BASE_REF:1} - docker push gcr.io/kf-feast/feast-serving:${PULL_BASE_REF:1} - - docker tag gcr.io/kf-feast/feast-jupyter:${PULL_BASE_SHA} gcr.io/kf-feast/feast-jupyter:${PULL_BASE_REF:1} - docker push gcr.io/kf-feast/feast-jupyter:${PULL_BASE_REF:1} - - # Also update "latest" image if tagged commit is pushed to stable branch - HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1) - echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG" - - if [ "${PULL_BASE_REF:1}" == "${HIGHEST_SEMVER_TAG:1}" ] - then - docker tag gcr.io/kf-feast/feast-core:${PULL_BASE_SHA} gcr.io/kf-feast/feast-core:latest - docker push gcr.io/kf-feast/feast-core:latest - - docker tag gcr.io/kf-feast/feast-serving:${PULL_BASE_SHA} gcr.io/kf-feast/feast-serving:latest - docker push gcr.io/kf-feast/feast-serving:latest - - docker tag gcr.io/kf-feast/feast-jupyter:${PULL_BASE_SHA} gcr.io/kf-feast/feast-jupyter:latest - docker push gcr.io/kf-feast/feast-jupyter:latest - fi - fi - volumeMounts: - - name: docker-socket - mountPath: /var/run/docker.sock - - name: service-account - mountPath: /etc/gcloud/service-account.json - subPath: service-account.json - readOnly: true - securityContext: - privileged: true - volumes: - - name: docker-socket - hostPath: - path: /var/run/docker.sock - - name: service-account - secret: - secretName: feast-service-account - branches: - - ^master$ - - ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ - - name: publish-helm-chart decorate: true spec: diff --git a/Makefile b/Makefile index 4466b62f9c..58c4b5f48f 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,9 @@ push-serving-docker: push-ci-docker: docker push $(REGISTRY)/feast-ci:latest +push-jupyter-docker: + docker push $(REGISTRY)/feast-jupyter:$(VERSION) + build-core-docker: docker build -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile . @@ -138,6 +141,9 @@ build-serving-docker: build-ci-docker: docker build -t $(REGISTRY)/feast-ci:latest -f infra/docker/ci/Dockerfile . +build-jupyter-docker: + docker build -t $(REGISTRY)/feast-jupyter:$(VERSION) -f infra/docker/jupyter/Dockerfile . + # Documentation install-dependencies-proto-docs: From 1f238a752dc858a3f0730215d1cd38aafb685cb4 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sat, 25 Jul 2020 22:09:15 +0800 Subject: [PATCH 2/6] Add docker compose test --- .github/workflows/complete.yml | 2 +- .github/workflows/master_only.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/complete.yml b/.github/workflows/complete.yml index 20e4742f2f..3f607fbcfb 100644 --- a/.github/workflows/complete.yml +++ b/.github/workflows/complete.yml @@ -3,7 +3,7 @@ name: complete workflow on: [push, pull_request] jobs: - build-docker-images: + build-push-docker-images: runs-on: [self-hosted, builder] strategy: matrix: diff --git a/.github/workflows/master_only.yml b/.github/workflows/master_only.yml index 934005baf6..0603f7e14b 100644 --- a/.github/workflows/master_only.yml +++ b/.github/workflows/master_only.yml @@ -47,4 +47,11 @@ jobs: docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} fi - fi \ No newline at end of file + fi + + tests-docker-compose: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: test docker compose + run: ./infra/scripts/test-docker-compose.sh \ No newline at end of file From 985383943d43d8d4ddd204f65c21cceefdda8ee1 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sun, 26 Jul 2020 09:53:17 +0800 Subject: [PATCH 3/6] Allow push commands --- .github/workflows/master_only.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master_only.yml b/.github/workflows/master_only.yml index 0603f7e14b..ed4485dfec 100644 --- a/.github/workflows/master_only.yml +++ b/.github/workflows/master_only.yml @@ -23,7 +23,7 @@ jobs: run: | if [ ${GITHUB_REF#refs/*/} == "master" ]; then docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:dev - # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:dev + docker push gcr.io/kf-feast/feast-${{ matrix.component }}:dev fi - name: get version id: get_version @@ -36,7 +36,7 @@ jobs: if [[ ${{ steps.get_version.outputs.VERSION }} =~ $rx ]]; then docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} - # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} # Also update "latest" image if tagged commit is pushed to stable branch HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1) @@ -45,7 +45,7 @@ jobs: if [ ${{ steps.get_version.outputs.VERSION }} == "${HIGHEST_SEMVER_TAG:1}" ] then docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} - # docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} + docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${{ steps.get_version.outputs.VERSION }} fi fi From 3ec52473b4c882a59562dd6a5be29d52bde55365 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sun, 26 Jul 2020 10:02:18 +0800 Subject: [PATCH 4/6] Move load test into main workflow --- .github/workflows/complete.yml | 14 +++++++++++++- .github/workflows/load_test.yml | 16 ---------------- 2 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 .github/workflows/load_test.yml diff --git a/.github/workflows/complete.yml b/.github/workflows/complete.yml index 3f607fbcfb..73f603de6b 100644 --- a/.github/workflows/complete.yml +++ b/.github/workflows/complete.yml @@ -102,4 +102,16 @@ jobs: java-package: jdk architecture: x64 - name: Run integration tests - run: make test-java-integration \ No newline at end of file + run: make test-java-integration + + load-test: + runs-on: [self-hosted, load] + needs: build-push-docker-images + steps: + - uses: actions/checkout@v2 + - name: Run load test + run: make test-load + - uses: actions/upload-artifact@v2 + with: + name: load-test-results + path: load-test-output/ \ No newline at end of file diff --git a/.github/workflows/load_test.yml b/.github/workflows/load_test.yml deleted file mode 100644 index 5a95c5d1d5..0000000000 --- a/.github/workflows/load_test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: load test - -on: [push, pull_request] - -jobs: - load-test: - runs-on: [self-hosted, load] - name: load-test - steps: - - uses: actions/checkout@v2 - - name: Run load test - run: make test-load - - uses: actions/upload-artifact@v2 - with: - name: load-test-results - path: load-test-output/ \ No newline at end of file From c5867aa2954b5270894ddafc0bf354dc86c91e03 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sun, 26 Jul 2020 10:23:02 +0800 Subject: [PATCH 5/6] Set GitHub post-merge SHA as load test target --- .github/workflows/complete.yml | 2 +- .github/workflows/master_only.yml | 2 +- Makefile | 2 +- infra/scripts/test-load.sh | 12 ++++++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/complete.yml b/.github/workflows/complete.yml index 73f603de6b..901f9f5e6f 100644 --- a/.github/workflows/complete.yml +++ b/.github/workflows/complete.yml @@ -110,7 +110,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run load test - run: make test-load + run: make test-load GIT_SHA=${GITHUB_SHA} - uses: actions/upload-artifact@v2 with: name: load-test-results diff --git a/.github/workflows/master_only.yml b/.github/workflows/master_only.yml index ed4485dfec..b8f84cf0f9 100644 --- a/.github/workflows/master_only.yml +++ b/.github/workflows/master_only.yml @@ -5,7 +5,7 @@ on: branches: master tags: - 'v*.*.*' - +>>> jobs: build-docker-images: diff --git a/Makefile b/Makefile index 58c4b5f48f..d28a14659a 100644 --- a/Makefile +++ b/Makefile @@ -190,4 +190,4 @@ lint-versions: # Performance test-load: - ./infra/scripts/test-load.sh \ No newline at end of file + ./infra/scripts/test-load.sh $(GIT_SHA) \ No newline at end of file diff --git a/infra/scripts/test-load.sh b/infra/scripts/test-load.sh index c017d0fe41..243da5e11e 100755 --- a/infra/scripts/test-load.sh +++ b/infra/scripts/test-load.sh @@ -24,10 +24,14 @@ clean_up() { exit $ARG } -CURRENT_SHA=$(git rev-parse HEAD) - -if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then - export CURRENT_SHA=$(cat "$GITHUB_EVENT_PATH" | jq -r .pull_request.head.sha) +if [ -z "$1" ] ; then + echo "No SHA provided as argument, using local HEAD"; + CURRENT_SHA=$(git rev-parse HEAD); + export CURRENT_SHA +else + echo "Using ${1} as SHA to test"; + CURRENT_SHA=${1} + export CURRENT_SHA fi export PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel) From 0d924b283ce253910d8c5d62fc7278da6c0cb8fc Mon Sep 17 00:00:00 2001 From: Willem Pienaar <6728866+woop@users.noreply.github.com> Date: Mon, 27 Jul 2020 18:49:18 +0800 Subject: [PATCH 6/6] Fix typo in master_only.yml --- .github/workflows/master_only.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master_only.yml b/.github/workflows/master_only.yml index b8f84cf0f9..b2620c4e8d 100644 --- a/.github/workflows/master_only.yml +++ b/.github/workflows/master_only.yml @@ -5,9 +5,8 @@ on: branches: master tags: - 'v*.*.*' ->>> -jobs: +jobs: build-docker-images: runs-on: [self-hosted, builder] strategy: @@ -54,4 +53,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: test docker compose - run: ./infra/scripts/test-docker-compose.sh \ No newline at end of file + run: ./infra/scripts/test-docker-compose.sh