Skip to content

Commit f0547ed

Browse files
author
Alexander Batashev
authored
[CI] Introduce driver and nightly containers (#4777)
This pull request is a follow-up on #4754, that adds two more Docker containers: a container with Intel drivers installed and a container with pre-installed nightly build of DPC++ from this repository. "Intel drivers" container includes all the latest version of low-level runtimes for Intel devices. The "nightly" container is derived from "Intel drivers" container, and provides the latest nightly build of SYCL. Requires: #4773 Documentation: #4778
1 parent d494595 commit f0547ed

File tree

6 files changed

+204
-1
lines changed

6 files changed

+204
-1
lines changed

.github/workflows/sycl_containers.yaml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
schedule:
55
# Every 1st and 15th day of month
66
- cron: '0 0 1,15 * *'
7+
push:
8+
branches:
9+
- sycl
710

811
jobs:
912
base_image_ubuntu2004:
@@ -14,14 +17,22 @@ jobs:
1417
- name: Checkout
1518
uses: actions/checkout@v2
1619
with:
17-
fetch-depth: 1
20+
fetch-depth: 2
21+
- name: Check if dependencies have changed
22+
id: deps_changed
23+
shell: bash {0}
24+
run: |
25+
git diff --exit-code HEAD~1 -- devops/containers/ubuntu2004_base.Dockerfile
26+
echo "::set-output name=flag::$?"
1827
- name: Login to GitHub Container Registry
28+
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
1929
uses: docker/login-action@v1
2030
with:
2131
registry: ghcr.io
2232
username: ${{ github.repository_owner }}
2333
password: ${{ secrets.GITHUB_TOKEN }}
2434
- name: Build and Push Container
35+
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
2536
uses: docker/build-push-action@v2
2637
with:
2738
push: true
@@ -30,3 +41,37 @@ jobs:
3041
ghcr.io/${{ github.repository }}/ubuntu2004_base:latest
3142
context: ${{ github.workspace }}/devops
3243
file: ${{ github.workspace }}/devops/containers/ubuntu2004_base.Dockerfile
44+
# This job produces a Docker container with the latest versions of Intel
45+
# drivers, that can be found on GitHub.
46+
drivers_image_ubuntu2004:
47+
if: github.repository == 'intel/llvm'
48+
name: Intel Drivers Ubuntu 20.04 Docker image
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 2
55+
- name: Check if dependencies have changed
56+
id: deps_changed
57+
shell: bash {0}
58+
run: |
59+
git diff --exit-code HEAD~1 -- devops/containers/ubuntu2004_intel_drivers.Dockerfile
60+
echo "::set-output name=flag::$?"
61+
- name: Login to GitHub Container Registry
62+
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
63+
uses: docker/login-action@v1
64+
with:
65+
registry: ghcr.io
66+
username: ${{ github.repository_owner }}
67+
password: ${{ secrets.GITHUB_TOKEN }}
68+
- name: Build and Push Container
69+
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
70+
uses: docker/build-push-action@v2
71+
with:
72+
push: true
73+
tags: |
74+
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:latest-${{ github.sha }}
75+
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:latest
76+
context: ${{ github.workspace }}/devops
77+
file: ${{ github.workspace }}/devops/containers/ubuntu2004_intel_drivers.Dockerfile

.github/workflows/sycl_nightly.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: SYCL Nightly Builds
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 3 * * *'
7+
8+
jobs:
9+
ubuntu2004_build_test:
10+
if: github.repository == 'intel/llvm'
11+
uses: intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@sycl
12+
with:
13+
build_github_cache: true
14+
build_cache_root: ${{ github.workspace }}
15+
build_artifact_suffix: default
16+
ubuntu2004_docker_build_push:
17+
if: github.repository == 'intel/llvm'
18+
runs-on: ubuntu-latest
19+
needs: ubuntu2004_build_test
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/download-artifact@v2
23+
with:
24+
name: sycl_nightly_ubuntu2004
25+
path: devops/
26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Build and Push Container (with drivers)
33+
uses: docker/build-push-action@v2
34+
with:
35+
push: true
36+
build-args: |
37+
base_image=ghcr.io/intel/llvm/ubuntu2004_intel_drivers
38+
base_tag=latest
39+
tags: |
40+
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:${{ github.sha }}
41+
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:latest
42+
context: ${{ github.workspace }}/devops
43+
file: ${{ github.workspace }}/devops/containers/ubuntu2004_preinstalled.Dockerfile
44+
- name: Build and Push Container (no drivers)
45+
uses: docker/build-push-action@v2
46+
with:
47+
push: true
48+
build-args: |
49+
base_image=ghcr.io/intel/llvm/ubuntu2004_base
50+
base_tag=latest
51+
tags: |
52+
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers-${{ github.sha }}
53+
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers
54+
context: ${{ github.workspace }}/devops
55+
file: ${{ github.workspace }}/devops/containers/ubuntu2004_preinstalled.Dockerfile
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ARG base_tag=latest
2+
ARG base_image=ghcr.io/intel/llvm/ubuntu2004_base
3+
4+
FROM $base_image:$base_tag
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
ARG compute_runtime_tag=latest
9+
ARG igc_tag=latest
10+
ARG tbb_tag=latest
11+
ARG fpgaemu_tag=latest
12+
ARG cpu_tag=latest
13+
14+
RUN apt update && apt install -yqq wget
15+
16+
COPY scripts/get_release.py /
17+
18+
# Install IGC and NEO
19+
RUN python3 /get_release.py intel/intel-graphics-compiler $igc_tag \
20+
| grep ".*deb" \
21+
| wget -qi - && \
22+
python3 /get_release.py intel/compute-runtime $compute_runtime_tag \
23+
| grep -E ".*((deb)|(sum))" \
24+
| wget -qi - && \
25+
sha256sum -c *.sum &&\
26+
dpkg -i *.deb && rm *.deb *.sum
27+
28+
RUN mkdir /runtimes
29+
30+
# Install TBB
31+
RUN cd /runtimes && \
32+
python3 /get_release.py oneapi-src/onetbb $tbb_tag \
33+
| grep -E ".*-lin.tgz" \
34+
| wget -qi - && \
35+
tar -xf *.tgz && rm *.tgz && mv oneapi-tbb-* oneapi-tbb
36+
37+
# Install Intel FPGA Emulator
38+
RUN cd /runtimes && \
39+
python3 /get_release.py intel/llvm $fpgaemu_tag \
40+
| grep -E ".*fpgaemu.*tar.gz" \
41+
| wget -qi - && \
42+
mkdir fpgaemu && tar -xf *.tar.gz -C fpgaemu && rm *.tar.gz && \
43+
if [ -e /runtimes/fpgaemu/install.sh ]; then \
44+
bash -x /runtimes/fpgaemu/install.sh ; \
45+
else \
46+
echo /runtimes/fpgaemu/x64/libintelocl_emu.so > /etc/OpenCL/vendors/intel_fpgaemu.icd ; \
47+
fi
48+
49+
# Install Intel OpenCL CPU Runtime
50+
RUN cd /runtimes && \
51+
python3 /get_release.py intel/llvm $cpu_tag \
52+
| grep -E ".*oclcpuexp.*tar.gz" \
53+
| wget -qi - && \
54+
mkdir oclcpu && tar -xf *.tar.gz -C oclcpu && rm *.tar.gz && \
55+
if [ -e /runtimes/oclcpu/install.sh ]; then \
56+
bash -x /runtimes/oclcpu/install.sh ; \
57+
else \
58+
echo /runtimes/oclcpu/x64/libintelocl.so > /etc/OpenCL/vendors/intel_oclcpu.icd ; \
59+
fi
60+
61+
COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh
62+
63+
ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"]
64+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ARG base_tag=latest
2+
ARG base_image=ghcr.io/intel/llvm/ubuntu2004_intel_drivers
3+
4+
FROM $base_image:$base_tag
5+
6+
COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh
7+
ADD llvm_sycl.tar.gz /usr
8+
9+
ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"]
10+

devops/scripts/drivers_entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
source /runtimes/oneapi-tbb/env/vars.sh
4+
5+
exec "$@"
6+

devops/scripts/get_release.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from urllib.request import urlopen
2+
import json
3+
import sys
4+
5+
def get_release_by_tag(repo, tag):
6+
release = urlopen("https://api.github.com/repos/" + repo + "/releases/tags/" + tag).read()
7+
return json.loads(release)
8+
9+
def get_latest_release(repo):
10+
release = urlopen("https://api.github.com/repos/" + repo + "/releases/latest").read()
11+
return json.loads(release)
12+
13+
repo = sys.argv[1]
14+
tag = sys.argv[2]
15+
16+
if tag == "latest":
17+
release = get_latest_release(repo)
18+
else:
19+
release = get_release_by_tag(repo, tag)
20+
21+
for item in release["assets"]:
22+
print(item["browser_download_url"])
23+

0 commit comments

Comments
 (0)