diff --git a/flytetools/.github/workflows/docker_build.yml b/flytetools/.github/workflows/docker_build.yml index 8cf690eb6b..9e3eb78891 100644 --- a/flytetools/.github/workflows/docker_build.yml +++ b/flytetools/.github/workflows/docker_build.yml @@ -2,11 +2,16 @@ name: Docker Build Images on: workflow_call: - + outputs: + cache_key: + description: "Docker Cache key" + value: ${{ jobs.build_docker.outputs.cache_key }} jobs: - build-docker: + build_docker: name: Build Docker Image runs-on: ubuntu-latest + outputs: + cache_key: ${{ steps.cache_key.outputs.cache_key }} steps: - name: Checkout uses: actions/checkout@v2 @@ -15,10 +20,13 @@ jobs: uses: actions/cache@v1 with: path: /tmp/tmp/docker-images - key: /tmp/docker-images-${{ github.event.after }} + key: /tmp/docker-images-${{ github.run_id }} restore-keys: | - /tmp/docker-images-${{ github.event.before }} - /tmp/docker-images-${{ github.event.pull_request.base.sha }} + /tmp/docker-images- + - name: Set cache key output + id: cache_key + run: | + echo ::set-output name=cache_key::/tmp/docker-images-${{ github.run_id }} - name: Prime docker cache run: (docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true) && (docker load -i /tmp/tmp/docker-images/snapshot.tar || true) - name: Build dockerfile diff --git a/flytetools/.github/workflows/end2end.yml b/flytetools/.github/workflows/end2end.yml index dcf74084c5..49dc8ef293 100644 --- a/flytetools/.github/workflows/end2end.yml +++ b/flytetools/.github/workflows/end2end.yml @@ -7,6 +7,10 @@ on: description: "Priorities of tests to register (comma-separated)" required: true type: string + cache_key: + description: "Cache key for docker image" + required: true + type: string jobs: endtoend: name: End to End tests @@ -24,7 +28,7 @@ jobs: uses: actions/cache@v1 with: path: /tmp/tmp/docker-images - key: /tmp/docker-images-${{ github.event.after }} + key: ${{ inputs.cache_key }} - name: Create Sandbox Cluster run: | cp /tmp/tmp/docker-images/snapshot.tar snapshot.tar @@ -33,6 +37,13 @@ jobs: - name: Prime docker cache run: | flytectl sandbox exec -- docker load -i /root/snapshot.tar + - name: Upgrade Helm charts + run: | + flytectl sandbox exec -- helm repo add flyteorg https://flyteorg.github.io/flyte + flytectl sandbox exec -- helm repo update + flytectl sandbox exec -- helm upgrade flyte -n flyte --kubeconfig=/etc/rancher/k3s/k3s.yaml flyteorg/flyte -f /flyteorg/share/flyte/values.yaml --wait --set flyte.${{ github.event.repository.name }}.image.repository=flyteorg/${{ github.event.repository.name }},flyte.${{ github.event.repository.name }}.image.tag=latest + + flytectl sandbox exec -- k3s kubectl get pods -n flyte -oyaml - name: Setup Flytekit run: | python -m pip install --upgrade pip diff --git a/flytetools/.github/workflows/integration.yml b/flytetools/.github/workflows/integration.yml index e17b9a6731..08a4262a39 100644 --- a/flytetools/.github/workflows/integration.yml +++ b/flytetools/.github/workflows/integration.yml @@ -2,6 +2,11 @@ name: Integration tests on: workflow_call: + inputs: + cache_key: + description: "Cache key for docker image" + required: true + type: string jobs: integration: name: Integration tests @@ -14,7 +19,7 @@ jobs: uses: actions/cache@v1 with: path: /tmp/tmp/docker-images - key: /tmp/docker-images-${{ github.event.after }} + key: ${{ inputs.cache_key }} - name: Prime docker cache run: docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true - uses: engineerd/setup-kind@v0.5.0