Skip to content

Commit

Permalink
Hotfix docker image cache key in end2end test (#53)
Browse files Browse the repository at this point in the history
* Added hotfix for end2end test

Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia authored Mar 2, 2022
1 parent 01379ee commit 94955f6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
18 changes: 13 additions & 5 deletions flytetools/.github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 12 additions & 1 deletion flytetools/.github/workflows/end2end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion flytetools/.github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
Expand Down

0 comments on commit 94955f6

Please sign in to comment.