This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
111 lines (96 loc) · 4.37 KB
/
test-docker.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
name: Docker test
on:
workflow_call:
inputs:
cuda_compiler_version:
type: string
default: None
name:
type: string
default: None
build-name:
type: string
default: build
reset-cache:
type: boolean
default: false
runner:
type: string
default: cuda
permissions: read-all
jobs:
test:
name: Test (Linux - Docker - ${{ inputs.name }}, runner=${{ inputs.runner }})
runs-on: [self-hosted, linux, "${{ inputs.runner }}"]
if: false # skip self-hosted runs
steps:
- name: Clean
run: |
docker stop hdk-build.${{ inputs.name }} || true
docker rm hdk-build.${{ inputs.name }} || true
rm -rf ../hdk/*
- name: Set env context
run: |
echo RUN_STAMP=docker-${{ runner.os }}-${{ inputs.name }} >>$GITHUB_ENV
- uses: actions/download-artifact@v3
if: inputs.build-name != 'asan'
with:
name: ${{ env.RUN_STAMP }}-${{ inputs.build-name }}
- uses: actions/download-artifact@v3
if: inputs.build-name == 'asan'
with:
name: ${{ runner.os }}-asan-build
- uses: actions/download-artifact@v3
if: inputs.build-name == 'asan'
with:
name: ${{ runner.os }}-asan-cache
- name: Unpack build files, create Dockerfile, build and start the container
run: |
tar -zxf build.tgz
set -vx
cat docker/Dockerfile docker/Dockerfile.${{ inputs.name }} >Dockerfile
devices=$(find /dev -type c -name 'nvidia*' | awk '{ print " --device "$1":"$1 }')
test ! -d /dev/dri || {
ls -l /dev/dri
devices="$devices --device /dev/dri:/dev/dri"
getent group render | awk -F : '{ print "RUN groupadd -g "$3" render && usermod -a -G render ghrunner" }' >>Dockerfile
}
docker build . \
--build-arg http_proxy \
--build-arg https_proxy \
--build-arg no_proxy \
${{ inputs.reset-cache && '--no-cache ' || ' ' }} --tag hdk-build.${{ inputs.name }}
docker run \
--env http_proxy \
--env https_proxy \
--env no_proxy \
-id --name hdk-build.${{ inputs.name }} --network host $devices hdk-build.${{ inputs.name }}:latest
- name: Copy files into the container
run: |
docker exec hdk-build.${{ inputs.name }} mkdir -p /_work/
docker cp build.tgz hdk-build.${{ inputs.name }}:/_work/
docker exec hdk-build.${{ inputs.name }} chown -R ghrunner:ghrunner /_work/
docker exec -u ghrunner hdk-build.${{ inputs.name }} tar -zxf /_work/build.tgz -C /_work/
- name: Sanity test
if: inputs.name == 'cuda'|| inputs.name == 'clang-cpu'
run: |
docker exec -u ghrunner hdk-build.${{ inputs.name }} dpkg -l
docker exec -u ghrunner hdk-build.${{ inputs.name }} bash /_work/omniscidb/scripts/conda/test.sh
- name: ASAN test
if: inputs.build-name == 'asan'
run: |
docker cp cache.tgz hdk-build.${{ inputs.name }}:/_work/
docker exec hdk-build.${{ inputs.name }} chown -R ghrunner:ghrunner /_work/
docker exec -u ghrunner hdk-build.${{ inputs.name }} tar -zxf /_work/cache.tgz -C /_work/build/omniscidb/Tests
docker exec -u ghrunner hdk-build.${{ inputs.name }} conda update conda
docker exec -u ghrunner hdk-build.${{ inputs.name }} conda env update -f /_work/omniscidb/scripts/mapd-deps-conda-dev-env.yml
docker exec -u ghrunner hdk-build.${{ inputs.name }} conda install -n omnisci-dev -c conda-forge gtest
docker exec -u ghrunner hdk-build.${{ inputs.name }} conda run --no-capture-output -n omnisci-dev bash -cvx 'export LD_LIBRARY_PATH=$(find /_work -name "*.so" -exec dirname {} \; | sort -u | tr "\n" :)$LD_LIBRARY_PATH; cd /_work/build/omniscidb/Tests && ldd ./ArrowBasedExecuteTest && ./ArrowBasedExecuteTest --use-rel-alg-cache=cache.txt'
- name: L0 Sanity test
if: inputs.name == 'l0'
run: |
docker exec -u ghrunner hdk-build.${{ inputs.name }} dpkg -l
docker exec -u ghrunner hdk-build.${{ inputs.name }} bash /_work/omniscidb/scripts/conda/intel-gpu-enabling-test.sh
- name: Stop the container
if: always()
run: docker stop hdk-build.${{ inputs.name }} || true