forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
460 lines (407 loc) · 16.6 KB
/
quickstart-test.yml
File metadata and controls
460 lines (407 loc) · 16.6 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
name: Quickstart Test
on:
workflow_dispatch:
schedule:
- cron: "2 0 * * *"
push:
branches:
- master
paths:
- "metadata-ingestion/src/datahub/cli/docker_cli.py"
- "metadata-ingestion/src/datahub/cli/docker_check.py"
- "metadata-ingestion/src/datahub/cli/quickstart_versioning.py"
- ".github/workflows/quickstart-test.yml"
- "docker/quickstart/*"
pull_request:
paths:
- "metadata-ingestion/src/datahub/cli/docker_cli.py"
- "metadata-ingestion/src/datahub/cli/docker_check.py"
- "metadata-ingestion/src/datahub/cli/quickstart_versioning.py"
- ".github/workflows/quickstart-test.yml"
- "docker/quickstart/*"
jobs:
test-quickstart-pr:
name: Quickstart Smoke Tests
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
./gradlew :metadata-ingestion:install
- name: Run quickstart
run: |
source metadata-ingestion/venv/bin/activate
# Use compose and version mapping from PR; head image so system-update runs SqlSetup
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml --version head
docker images
- name: Store logs
if: failure()
env:
TARGET_DIR: docker_logs/${{ github.job }}
COMPOSE_PROJECT_NAME: datahub
run: |
docker ps -a
. .github/scripts/docker_logs.sh
- name: Upload logs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: docker-logs-${{ github.job }}
path: docker_logs/${{ github.job }}/
retention-days: 5
- name: Run quickstart check
run: |
source metadata-ingestion/venv/bin/activate
datahub docker check
- name: Smoke test
if: false
env:
RUN_QUICKSTART: false
DATAHUB_VERSION: head
CLEANUP_DATA: "false"
TEST_STRATEGY: cypress
BATCH_COUNT: 30
BATCH_NUMBER: 2
run: |
echo "$DATAHUB_VERSION"
./gradlew --stop
./smoke-test/smoke.sh
- name: Run quickstart check
run: |
source metadata-ingestion/venv/bin/activate
datahub docker check
test-quickstart-pr-compatiblity-checks:
name: Quickstart compatiliby Tests
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: install older datahub cli
run: |
pip install acryl-datahub==1.0
- name: bring up datahub using old cli
run: |
datahub docker quickstart --version v1.2.0
datahub docker check
datahub docker ingest-sample-data
datahub docker check
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install dependencies
run: |
./gradlew :metadata-ingestion:install
- name: Run quickstart
run: |
source metadata-ingestion/venv/bin/activate
# Use compose and version mapping files from PR
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
if datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml; then
echo "Command succeeded when it should have failed"
exit 1
else
echo "Command failed as expected"
fi
- name: Backup, nuke and restart and restore
run: |
source metadata-ingestion/venv/bin/activate
echo "Running backup"
datahub docker quickstart --backup
echo "Running nuke"
datahub docker nuke
# Use compose and version mapping files from PR
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
echo "Running quickstart"
datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml
echo "Running restore"
echo "y" | datahub docker quickstart --restore
datahub docker check
- name: Store logs
if: failure()
env:
TARGET_DIR: docker_logs/${{ github.job }}
COMPOSE_PROJECT_NAME: datahub
run: |
docker ps -a
. .github/scripts/docker_logs.sh
- name: Upload logs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: docker-logs-${{ github.job }}
path: docker_logs/${{ github.job }}/
retention-days: 5
test-quickstart-regression:
name: Verify upgrades work with latest CLI
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: once more supported versions are added, this should become list last n versions
datahub_version: ["v1.1.0", "v1.2.0", "v1.3.0.1", "head"]
fail-fast: false
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: install datahub cli
run: |
pip install acryl-datahub
- name: bring up older version datahub
run: |
datahub docker quickstart --version ${{ matrix.datahub_version }}
datahub docker check
datahub docker ingest-sample-data
datahub docker check
- name: Backup, nuke and restart and restore
run: |
echo "Running backup"
datahub docker quickstart --backup
echo "Running nuke"
datahub docker nuke
datahub docker quickstart
echo "Running restore"
echo "y" | datahub docker quickstart --restore
datahub docker check
test-quickstart-regression-unsupported-versions:
name: Verifiy handling of unsupported older versions
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: last n unsupported versions to be added here
datahub_version: ["v1.0.0"]
fail-fast: false
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: install datahub cli
run: |
pip install acryl-datahub
- name: bring up datahub
run: |
if datahub docker quickstart --version ${{ matrix.datahub_version }}; then
echo "Command succeeded when it should have failed"
exit 1
else
echo "Command failed as expected"
fi
test-quickstart-regression-old-cli:
name: Verify migration from old-cli deployments
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: once more supported versions are aded, this should become list last n versions
datahub_version: ["v1.1.0", "v1.2.0"]
fail-fast: false
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: install datahub cli
run: |
pip install acryl-datahub==${{ matrix.datahub_version }}
- name: bring up datahub using old cli
run: |
datahub docker quickstart --version ${{ matrix.datahub_version }}
datahub docker check
datahub docker ingest-sample-data
datahub docker check
- name: Backup, nuke and restart and restore
run: |
echo "Running backup"
datahub docker quickstart --backup
echo "Running nuke"
datahub docker nuke
# Install latest version of datahub cli
pip install --upgrade acryl-datahub
datahub docker quickstart
echo "Running restore"
echo "y" | datahub docker quickstart --restore
datahub docker check
test-docker-compose-version-compatibility:
name: Docker Compose Version Compatibility
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Test v1.x standalone - should FAIL (unsupported)
- compose_version: "1.29.2"
compose_type: "standalone"
should_fail: true
# Test v2.x plugin - should SUCCEED
- compose_version: "v2.20.0"
compose_type: "plugin"
should_fail: false
- compose_version: "v2.24.0"
compose_type: "plugin"
should_fail: false
# Test v2.x standalone (backward compatibility mode) - should SUCCEED
- compose_version: "v2.24.0"
compose_type: "standalone"
should_fail: false
# Test v5.x plugin - should SUCCEED (forward compatibility)
- compose_version: "v5.0.1"
compose_type: "plugin"
should_fail: false
fail-fast: false
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Docker Compose (standalone mode)
if: matrix.compose_type == 'standalone'
run: |
# Find and remove ALL docker compose plugins
echo "Searching for docker compose plugin installations..."
find / -name "docker-compose" -type f 2>/dev/null | grep -E "(cli-plugins|docker/cli)" || true
# Remove known plugin locations
rm -rf ~/.docker/cli-plugins/docker-compose
sudo rm -rf /usr/local/lib/docker/cli-plugins/docker-compose
sudo rm -rf /usr/lib/docker/cli-plugins/docker-compose
sudo rm -rf /usr/libexec/docker/cli-plugins/docker-compose
sudo rm -rf /usr/local/libexec/docker/cli-plugins/docker-compose
# Also remove the entire cli-plugins directory to be thorough
rm -rf ~/.docker/cli-plugins
sudo rm -rf /usr/local/lib/docker/cli-plugins
sudo rm -rf /usr/lib/docker/cli-plugins
sudo rm -rf /usr/libexec/docker/cli-plugins
sudo rm -rf /usr/local/libexec/docker/cli-plugins
# Install standalone docker-compose (works for v1.x and v2.x)
sudo curl -L "https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Verify installation
docker-compose --version
# Verify plugin is NOT available (ensures we're testing standalone mode only)
if docker compose version 2>/dev/null; then
echo "ERROR: docker compose plugin still available after removal!"
echo "Plugin location:"
which docker || echo "docker binary not found"
find / -name "docker-compose" -type f 2>/dev/null | grep -E "(cli-plugins|docker/cli)" || true
docker compose version
exit 1
fi
echo "SUCCESS: Only standalone docker-compose is available"
- name: Install Docker Compose v2+ (plugin)
if: matrix.compose_type == 'plugin'
run: |
# Remove existing docker-compose standalone if present
sudo rm -f /usr/local/bin/docker-compose
# Install specific version of docker compose plugin
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p "$DOCKER_CONFIG/cli-plugins"
curl -SL "https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-linux-x86_64" \
-o "$DOCKER_CONFIG/cli-plugins/docker-compose"
chmod +x "$DOCKER_CONFIG/cli-plugins/docker-compose"
# Verify installation
docker compose version
- name: Verify Docker Compose installation
run: |
echo "=== Docker Compose Version Information ==="
if command -v docker-compose &> /dev/null; then
echo "Standalone docker-compose found:"
docker-compose --version
fi
if docker compose version &> /dev/null; then
echo "Docker compose plugin found:"
docker compose version
docker compose version --short
fi
echo "========================================"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
./gradlew :metadata-ingestion:install
- name: Test quickstart (expecting failure for v1.x)
if: matrix.should_fail
run: |
source metadata-ingestion/venv/bin/activate
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
# Run quickstart and capture output (don't fail on error)
set +e
datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml 2>&1 | tee output.log
set -e
# Check if the version error message is present in the output
if grep -q "require Docker Compose v2 or later" output.log; then
echo "SUCCESS: Error message correctly indicates v2 or later required"
echo "Output contained the expected v1.x rejection message"
exit 0
else
echo "ERROR: Expected v1.x rejection message not found in output"
echo "This means either:"
echo " 1. Docker Compose v1.x was not properly isolated (v2 plugin still present)"
echo " 2. The version check is not working correctly"
echo ""
echo "Full output:"
cat output.log
exit 1
fi
- name: Test quickstart (expecting success for v2+ and v5)
if: "!matrix.should_fail"
run: |
source metadata-ingestion/venv/bin/activate
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml
- name: Run quickstart check
if: "!matrix.should_fail"
run: |
source metadata-ingestion/venv/bin/activate
datahub docker check
- name: Test nuke and restart
if: "!matrix.should_fail"
run: |
source metadata-ingestion/venv/bin/activate
echo "Running nuke"
datahub docker nuke
echo "Running quickstart again"
export FORCE_LOCAL_QUICKSTART_MAPPING=docker/quickstart/quickstart_version_mapping.yaml
datahub docker quickstart -f docker/quickstart/docker-compose.quickstart-profile.yml
datahub docker check