Skip to content

Commit

Permalink
Run endtoend tests in PRs against sandbox releases (flyteorg#350)
Browse files Browse the repository at this point in the history
* Added flytectl in sandbox

Signed-off-by: Yuvraj <[email protected]>

* wip: Added manual change in boilerplate script

Signed-off-by: Yuvraj <[email protected]>

* flytectl config fix

Signed-off-by: Yuvraj <[email protected]>

* Revert registry name in ci

Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia authored Nov 23, 2021
1 parent 9db54f4 commit 4d3a602
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 54 deletions.
25 changes: 17 additions & 8 deletions flytepropeller/.github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
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
run: |
docker build -t lyft/${{ github.event.repository.name }}:builder --target builder --cache-from=lyft/${{ github.event.repository.name }}:builder .
docker build -t lyft/${{ github.event.repository.name }}:latest --cache-from=lyft/${{ github.event.repository.name }}:builder .
docker build -t flyteorg/${{ github.event.repository.name }}:builder --target builder --cache-from=flyteorg/${{ github.event.repository.name }}:builder .
docker build -t flyteorg/${{ github.event.repository.name }}:latest --cache-from=flyteorg/${{ github.event.repository.name }}:builder .
- name: Tag and cache docker image
run: mkdir -p /tmp/tmp/docker-images && docker save lyft/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save lyft/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar
run: mkdir -p /tmp/tmp/docker-images && docker save flyteorg/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save flyteorg/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar

# Duplicated from pull request workflow because sharing is not yet supported
endtoend:
Expand All @@ -40,24 +40,33 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: unionai/[email protected]
name: Setup flytectl
- id: load-docker-cache
name: Load Docker Cache
uses: actions/cache@v1
with:
path: /tmp/tmp/docker-images
key: /tmp/docker-images-${{ github.event.after }}
- name: Create Sandbox Cluster
run: |
cp /tmp/tmp/docker-images/snapshot.tar snapshot.tar
flytectl sandbox start --source=$(pwd)
flytectl config init
- name: Prime docker cache
run: docker load -i /tmp/tmp/docker-images/snapshot.tar || true
- uses: engineerd/[email protected]
with:
version: "v0.11.1"
run: |
flytectl sandbox exec -- docker load -i /root/snapshot.tar
- name: Upgrade Helm charts
run: flytectl sandbox exec -- helm upgrade flyte -n flyte --kubeconfig=/etc/rancher/k3s/k3s.yaml /flyteorg/share/flyte -f /flyteorg/share/flyte/values-sandbox.yaml --set flytepropeller.image.repository=flyteorg/${{ github.event.repository.name }},flytepropeller.image.tag=latest
- name: End2End
env:
KUBECONFIG: /home/runner/.flyte/k3s/k3s.yaml
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
IMAGE_NAME=${{ github.event.repository.name }} IMAGE=lyft/${{ github.event.repository.name }}:latest make end2end_execute
make end2end_execute
bump-version:
name: Bump Version
Expand Down
41 changes: 30 additions & 11 deletions flytepropeller/.github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
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
run: |
docker build -t lyft/${{ github.event.repository.name }}:builder --target builder --cache-from=lyft/${{ github.event.repository.name }}:builder .
docker build -t lyft/${{ github.event.repository.name }}:latest --cache-from=lyft/${{ github.event.repository.name }}:builder .
docker build -t flyteorg/${{ github.event.repository.name }}:builder --target builder --cache-from=flyteorg/${{ github.event.repository.name }}:builder .
docker build -t flyteorg/${{ github.event.repository.name }}:latest --cache-from=flyteorg/${{ github.event.repository.name }}:builder .
- name: Tag and cache docker image
run: mkdir -p /tmp/tmp/docker-images && docker save lyft/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save lyft/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar
run: mkdir -p /tmp/tmp/docker-images && docker save flyteorg/${{ github.event.repository.name }}:builder -o /tmp/tmp/docker-images/snapshot-builder.tar && docker save flyteorg/${{ github.event.repository.name }}:latest -o /tmp/tmp/docker-images/snapshot.tar

endtoend:
name: End to End tests
Expand All @@ -36,24 +36,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: unionai/[email protected]
name: Setup flytectl
- id: load-docker-cache
name: Load Docker Cache
uses: actions/cache@v1
with:
path: /tmp/tmp/docker-images
key: /tmp/docker-images-${{ github.event.after }}
- name: Create Sandbox Cluster
run: |
cp /tmp/tmp/docker-images/snapshot.tar snapshot.tar
flytectl sandbox start --source=$(pwd)
flytectl config init
- name: Prime docker cache
run: docker load -i /tmp/tmp/docker-images/snapshot.tar || true
- uses: engineerd/[email protected]
with:
version: "v0.11.1"
run: |
flytectl sandbox exec -- docker load -i /root/snapshot.tar
- name: Upgrade Helm charts
run: flytectl sandbox exec -- helm upgrade flyte -n flyte --kubeconfig=/etc/rancher/k3s/k3s.yaml /flyteorg/share/flyte -f /flyteorg/share/flyte/values-sandbox.yaml --set flytepropeller.image.repository=flyteorg/${{ github.event.repository.name }},flytepropeller.image.tag=latest
- name: End2End
env:
KUBECONFIG: /home/runner/.flyte/k3s/k3s.yaml
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
IMAGE_NAME=${{ github.event.repository.name }} IMAGE=lyft/${{ github.event.repository.name }}:latest make end2end_execute
kubectl get pods -n flyte -oyaml
make end2end_execute
integration:
name: Integration tests
Expand All @@ -62,22 +72,31 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: unionai/[email protected]
- id: load-docker-cache
name: Load Docker Cache
uses: actions/cache@v1
with:
path: /tmp/tmp/docker-images
key: /tmp/docker-images-${{ github.event.after }}
- name: Create Sandbox Cluster
run: |
cp /tmp/tmp/docker-images/snapshot-builder.tar snapshot.tar
flytectl sandbox start --source=$(pwd)
flytectl config init
- name: Prime docker cache
run: docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true
- uses: engineerd/[email protected]
run: flytectl sandbox exec -- docker load -i /root/snapshot.tar
- name: Upgrade Helm charts
run: flytectl sandbox exec -- helm upgrade flyte -n flyte --kubeconfig=/etc/rancher/k3s/k3s.yaml /flyteorg/share/flyte -f /flyteorg/share/flyte/values-sandbox.yaml --set flytepropeller.image.repository=flyteorg/${{ github.event.repository.name }},flytepropeller.image.tag=builder
- name: Integration
env:
KUBECONFIG: /home/runner/.flyte/k3s/k3s.yaml
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
IMAGE_NAME=${{ github.event.repository.name }} IMAGE=lyft/${{ github.event.repository.name }}:builder make k8s_integration_execute
make k8s_integration_execute
tests-lint:
name: Run tests and lint
Expand Down
18 changes: 0 additions & 18 deletions flytepropeller/boilerplate/flyte/end2end/end2end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,7 @@ 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}" == "flytepropeller" ]
then
sed -i.bak -e "s_${IMAGE_NAME}:.*_${IMAGE}_g" "${OUT}"/kustomize/base/propeller/deployment.yaml
fi

if [ "${IMAGE_NAME}" == "flyteadmin" ]
then
sed -i.bak -e "s_${IMAGE_NAME}:.*_${IMAGE}_g" "${OUT}"/kustomize/base/admindeployment/deployment.yaml
fi
fi

make kustomize
# launch flyte end2end
kubectl apply -f "${OUT}/deployment/test/flyte_generated.yaml"
make end2end_execute
popd
17 changes: 0 additions & 17 deletions flytepropeller/data-config.yaml

This file was deleted.

File renamed without changes.

0 comments on commit 4d3a602

Please sign in to comment.