@@ -48,25 +48,29 @@ jobs:
48
48
with :
49
49
name : ${{ runner.os }}-asan-cache
50
50
51
- - name : Unpack build files, create Dockerfile
51
+ - name : Unpack build files, create Dockerfile, build and start the container
52
52
run : |
53
53
tar -zxf build.tgz
54
+ set -vx
54
55
cat docker/Dockerfile docker/Dockerfile.${{ inputs.name }} >Dockerfile
55
56
56
- - name : Start the container
57
- if : inputs.name != 'l0'
58
- run : |
59
- set -vx
60
- docker build . ${{ inputs.reset-cache && '--no-cache ' || '' }}--tag hdk-build.${{ inputs.name }}
61
- docker run -id --name hdk-build.${{ inputs.name }} --network host --device /dev/nvidia-modeset:/dev/nvidia-modeset --device /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools --device /dev/nvidia-uvm:/dev/nvidia-uvm --device /dev/nvidia0:/dev/nvidia0 --device /dev/nvidiactl:/dev/nvidiactl hdk-build.${{ inputs.name }}:latest
57
+ devices=$(find /dev -type c - name 'nvidia*' | awk '{ print " --device "$1":"$1 }')
58
+ test ! -d /dev/dri || {
59
+ ls -l /dev/dri
60
+ devices="$devices --device /dev/dri:/dev/dri"
61
+ getent group render | awk -F : '{ print "RUN groupadd -g "$3" render && usermod -a -G render ghrunner" }' >>Dockerfile
62
+ }
62
63
63
- - name : Start L0 container
64
- if : inputs.name == 'l0'
65
- run : |
66
- set -vx
67
- getent group render | awk -F : '{ print "RUN groupadd -g "$3" render && usermod -a -G render ghrunner" }' >>Dockerfile
68
- docker build . ${{ inputs.reset-cache && '--no-cache' || '' }}--tag hdk-build.${{ inputs.name }}
69
- docker run -id --name hdk-build.${{ inputs.name }} --network host --device /dev/dri:/dev/dri hdk-build.${{ inputs.name }}:latest
64
+ docker build . \
65
+ --build-arg http_proxy \
66
+ --build-arg https_proxy \
67
+ --build-arg no_proxy \
68
+ ${{ inputs.reset-cache && '--no-cache ' || ' ' }} --tag hdk-build.${{ inputs.name }}
69
+ docker run \
70
+ --env http_proxy \
71
+ --env https_proxy \
72
+ --env no_proxy \
73
+ -id --name hdk-build.${{ inputs.name }} --network host $devices hdk-build.${{ inputs.name }}:latest
70
74
71
75
- name : Copy files into the container
72
76
run : |
0 commit comments