forked from lakekeeper/lakekeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (181 loc) · 6.94 KB
/
test-examples.yml
File metadata and controls
218 lines (181 loc) · 6.94 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Examples Test [auth]
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read # Needed to checkout code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
docker:
uses: ./.github/workflows/docker_build.yml
with:
platform: "amd64"
dockerfile: "docker/full.Dockerfile"
image_name: "lakekeeper-local"
# Depends on all actions that are required for a "successful" CI run.
tests-pass:
name: all examples pass
runs-on: ubuntu-latest
needs:
- test-example-access-control-simple
- test-example-minimal
- test-example-access-control-advanced
- test-docker-compose-with-keycloak
- test-example-kafka-connect-iceberg-sink
steps:
- run: exit 0
test-example-minimal:
needs: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Restore binary
uses: actions/download-artifact@v6
with:
name: lakekeeper-image
path: artifacts
- name: Display structure of downloaded files
run: ls -Rlh artifacts
- name: Restore Docker image
run: |
docker load -i artifacts/lakekeeper-local-amd64.tar
- name: Test Minimal
run: |
cd examples/minimal
sed -i '/pull_policy: always/d' docker-compose.yaml
docker compose run jupyter bash -c "cd /home/jovyan/examples/ && jupyter execute Pyiceberg.ipynb && jupyter execute Spark.ipynb && jupyter execute Trino.ipynb && jupyter execute Starrocks.ipynb && jupyter execute \"Multiple Warehouses.ipynb\" && jupyter execute DuckDB.ipynb"
env:
LAKEKEEPER_TEST__SERVER_IMAGE: localhost/lakekeeper-local:amd64
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e
test-example-access-control-simple:
needs: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Restore binary
uses: actions/download-artifact@v6
with:
name: lakekeeper-image
path: artifacts
- name: Display structure of downloaded files
run: ls -Rlh artifacts
- name: Restore Docker image
run: |
docker load -i artifacts/lakekeeper-local-amd64.tar
- name: Test Aeccess Control Simple
run: |
cd examples/access-control-simple
sed -i '/pull_policy: always/d' docker-compose.yaml
docker compose run jupyter bash -c "cd /home/jovyan/examples/ && jupyter execute 01-Bootstrap.ipynb && jupyter execute 02-Create-Warehouse.ipynb && jupyter execute 03-01-Spark.ipynb && jupyter execute 03-02-Trino.ipynb && jupyter execute 03-03-Starrocks.ipynb && jupyter execute 03-04-PyIceberg.ipynb && jupyter execute 03-05-DuckDB.ipynb"
env:
LAKEKEEPER_TEST__SERVER_IMAGE: localhost/lakekeeper-local:amd64
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e
test-example-access-control-advanced:
needs: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Test Make all
run: |
cd examples/kafka-connect-iceberg-sink
make all
- name: Test Make all
run: |
cd examples/kafka-connect-iceberg-sink
make run-producer
test-example-kafka-connect-iceberg-sink:
needs: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Restore binary
uses: actions/download-artifact@v6
with:
name: lakekeeper-image
path: artifacts
- name: Display structure of downloaded files
run: ls -Rlh artifacts
- name: Restore Docker image
run: |
docker load -i artifacts/lakekeeper-local-amd64.tar
- name: Test Access Control Advanced
run: |
cd examples/access-control-advanced
sed -i '/pull_policy: always/d' docker-compose.yaml
docker compose run jupyter bash -c "cd /home/jovyan/examples/ && jupyter execute 01-Bootstrap.ipynb && jupyter execute 02-Create-Warehouse.ipynb"
env:
LAKEKEEPER_TEST__SERVER_IMAGE: localhost/lakekeeper-local:amd64
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e
test-docker-compose-with-keycloak:
needs: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Restore binary
uses: actions/download-artifact@v6
with:
name: lakekeeper-image
path: artifacts
- name: Display structure of downloaded files
run: ls -Rlh artifacts
- name: Restore Docker image
run: |
docker load -i artifacts/lakekeeper-local-amd64.tar
- name: Launch Docker Compose with Keycloak
run: |
cd docker-compose
sed -i '/pull_policy: /d' docker-compose.yaml
docker compose -f docker-compose.yaml -f keycloak-overlay.yaml up -d --wait
env:
LAKEKEEPER__SERVER_IMAGE: localhost/lakekeeper-local:amd64
- name: Test Docker Compose with Keycloak
run: |
set -euo pipefail
CATALOG_URL="http://localhost:8181/catalog"
MANAGEMENT_URL="http://localhost:8181/management"
KEYCLOAK_TOKEN_URL="http://localhost:30080/realms/iceberg/protocol/openid-connect/token"
WAREHOUSE="demo"
CLIENT_ID="spark"
CLIENT_SECRET="2OR3eRvYfSZzzZ16MlPd95jhLnOaLM52"
# Get an access token from keycloak (the idP server)
echo "Getting access token from Keycloak..."
ACCESS_TOKEN=$(curl -s -X POST \
"$KEYCLOAK_TOKEN_URL" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" \
-d "scope=lakekeeper" \
| jq -r '.access_token')
echo "Access token received"
# Check the 'info' endpoint of the Lakekeeper management API
echo "Checking Lakekeeper management API info endpoint..."
curl -s -X GET \
"$MANAGEMENT_URL/v1/info" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
| jq
# Bootstrap
echo "Bootstrapping Lakekeeper..."
curl -s -X POST \
"$MANAGEMENT_URL/v1/bootstrap" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accept-terms-of-use": true
}' \
|| echo "Bootstrap may have already been completed"
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e