forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (122 loc) · 5.5 KB
/
end2end.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: End to End tests
on:
workflow_call:
inputs:
priorities:
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
runs-on: ubuntu-latest
env:
FLYTESNACKS_VERSION: ""
steps:
- name: Set latest Flytesnacks release
if: ${{ env.FLYTESNACKS_VERSION == '' }}
run: |
FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)"
echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v3
- uses: unionai/[email protected]
name: Setup flytectl
- uses: actions/setup-python@v3
with:
python-version: 3.11
- id: load-docker-cache-datacatalog
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-datacatalog
key: ${{ inputs.cache_key }}-datacatalog
- id: load-docker-cache-flyteadmin
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flyteadmin
key: ${{ inputs.cache_key }}-flyteadmin
- id: load-docker-cache-flytecopilot
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flytecopilot
key: ${{ inputs.cache_key }}-flytecopilot
- id: load-docker-cache-flytepropeller
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flytepropeller
key: ${{ inputs.cache_key }}-flytepropeller
- name: Create Sandbox Cluster
run: |
cp /tmp/tmp/docker-images-datacatalog/snapshot-datacatalog.tar snapshot-datacatalog.tar
cp /tmp/tmp/docker-images-flyteadmin/snapshot-flyteadmin.tar snapshot-flyteadmin.tar
cp /tmp/tmp/docker-images-flytecopilot/snapshot-flytecopilot.tar snapshot-flytecopilot.tar
cp /tmp/tmp/docker-images-flytepropeller/snapshot-flytepropeller.tar snapshot-flytepropeller.tar
flytectl config init
flytectl sandbox start --source=$(pwd)
- name: Prime docker cache
run: |
flytectl sandbox exec -- docker load -i /root/snapshot-datacatalog.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flyteadmin.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flytecopilot.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flytepropeller.tar
- name: Setup Flytekit
run: |
python -m pip install --upgrade pip
pip install flytekit flytekitplugins-deck-standard
pip freeze
- name: Checkout flytesnacks
if: ${{ inputs.priorities == 'P0' }}
uses: actions/checkout@v3
with:
repository: flyteorg/flytesnacks
path: flytesnacks
ref: ${{ env.FLYTESNACKS_VERSION }}
- name: Register P0 tests
if: ${{ inputs.priorities == 'P0' }}
run: |
while read -r line;
do
pyflyte --config ./boilerplate/flyte/end2end/functional-test-config.yaml \
register \
--project flytesnacks \
--domain development \
--image cr.flyte.org/flyteorg/flytekit:py3.11-latest \
--version ${{ env.FLYTESNACKS_VERSION }} \
flytesnacks/$line;
done < flytesnacks/flyte_tests.txt
- name: Register all flytesnacks examples
if: ${{ inputs.priorities != 'P0' }}
uses: unionai/[email protected]
with:
flytesnacks: true
project: flytesnacks
version: ${{ env.FLYTESNACKS_VERSION }}
domain: development
# - name: Pre Upgrade Tests
# if: ${{ github.event.repository.name == 'flyteadmin' }}
# env:
# PRIORITIES: "${{ inputs.priorities }}"
# run: |
# make end2end_execute
- 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-core --kubeconfig=/etc/rancher/k3s/k3s.yaml flyteorg/flyte-core -f /flyteorg/share/flyte/values-sandbox.yaml --wait --set datacatalog.image.repository=${{ github.repository_owner }}/datacalog,datacatalog.image.tag=latest
# TODO(monorepo): the following commands are not correct.
# we have to separate the calls to replace the images into different commands.
# flytectl sandbox exec -- helm upgrade flyte -n flyte-core --kubeconfig=/etc/rancher/k3s/k3s.yaml flyteorg/flyte-core -f /flyteorg/share/flyte/values-sandbox.yaml --wait \
# --set datacatalog.image.repository=${{ github.repository_owner }}/datacalog,datacatalog.image.tag=latest
# --set flyteadmin.image.repository=${{ github.repository_owner }}/datacalog,flyteadmin.image.tag=latest
# --set flytecopilot.image.repository=${{ github.repository_owner }}/datacalog,flytecopilot.image.tag=latest
# --set flytepropeller.image.repository=${{ github.repository_owner }}/datacalog,flytepropeller.image.tag=latest
flytectl sandbox exec -- k3s kubectl get pods -n flyte -oyaml
- name: Post Upgrade Tests
env:
PRIORITIES: "${{ inputs.priorities }}"
run: |
make end2end_execute