Skip to content

Commit 2336d02

Browse files
authored
[CI] Factor out igc dev related code (#13441)
Per discussion with @aelovikov-intel ,factor out all igc dev related code to new workflows to avoid necessary interaction with other docker images.
1 parent 80ecd7f commit 2336d02

9 files changed

+157
-36
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: IGC DEV CI Containers
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- sycl
7+
paths:
8+
- 'devops/actions/build_container/**'
9+
- 'devops/dependencies-igc-dev.json'
10+
- '.github/workflows/sycl-containers-igc-dev.yaml'
11+
pull_request:
12+
paths:
13+
- 'devops/actions/build_container/**'
14+
- 'devops/dependencies-igc-dev.json'
15+
- '.github/workflows/sycl-containers-igc-dev.yaml'
16+
17+
permissions: read-all
18+
19+
jobs:
20+
build_and_push_images:
21+
if: github.repository == 'intel/llvm'
22+
name: Build and Push IGC Dev Docker Images
23+
runs-on: ubuntu-22.04
24+
permissions:
25+
packages: write
26+
strategy:
27+
matrix:
28+
include:
29+
- name: Intel Drivers Ubuntu 22.04 Docker image with dev IGC
30+
dockerfile: ubuntu2204_intel_drivers_igc_dev
31+
imagefile: ubuntu2204_intel_drivers
32+
tag: devigc
33+
build_args: |
34+
"use_latest=false"
35+
"use_igc_dev=true"
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 2
41+
- name: Build and Push Container
42+
uses: ./devops/actions/build_container
43+
with:
44+
push: ${{ github.event_name != 'pull_request' }}
45+
file: ${{ matrix.dockerfile }}
46+
username: ${{ github.repository_owner }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
tags: |
49+
ghcr.io/${{ github.repository }}/${{ matrix.imagefile }}:${{ matrix.tag }}-${{ github.sha }}
50+
ghcr.io/${{ github.repository }}/${{ matrix.imagefile }}:${{ matrix.tag }}
51+
build-args: ${{ matrix.build_args }}
52+

.github/workflows/sycl-containers.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ on:
88
branches:
99
- sycl
1010
paths:
11+
- 'devops/actions/build_container/**'
1112
- 'devops/containers/**'
1213
- 'devops/dependencies.json'
1314
- 'devops/scripts/install_drivers.sh'
1415
- 'devops/scripts/install_build_tools.sh'
1516
- '.github/workflows/sycl-containers.yaml'
1617
pull_request:
1718
paths:
19+
- 'devops/actions/build_container/**'
1820
- 'devops/containers/**'
1921
- 'devops/dependencies.json'
2022
- 'devops/scripts/install_drivers.sh'
@@ -45,12 +47,6 @@ jobs:
4547
file: ubuntu2204_intel_drivers
4648
tag: latest
4749
build_args: "use_latest=false"
48-
- name: Intel Drivers Ubuntu 22.04 Docker image with dev IGC
49-
file: ubuntu2204_intel_drivers
50-
tag: devigc
51-
build_args: |
52-
"use_latest=false"
53-
"use_igc_dev=true"
5450
- name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
5551
file: ubuntu2204_intel_drivers
5652
tag: unstable
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update IGC dev driver
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1,4'
6+
workflow_dispatch:
7+
8+
permissions: read-all
9+
10+
jobs:
11+
update_driver_linux:
12+
permissions:
13+
contents: write # for Git to git push
14+
runs-on: ubuntu-20.04
15+
if: github.repository == 'intel/llvm'
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Update dependencies file
19+
run: |
20+
version="$(python3 devops/scripts/update_drivers.py linux --igc-dev-only)"
21+
echo 'NEW_DRIVER_VERSION='$version >> $GITHUB_ENV
22+
- name: Create Pull Request
23+
env:
24+
BRANCH: ci/update_gpu_driver-linux-${{ env.NEW_DRIVER_VERSION }}
25+
GITHUB_TOKEN: ${{ secrets.LLVM_MAIN_SYNC_BBSYCL_TOKEN }}
26+
run: |
27+
cd $GITHUB_WORKSPACE
28+
git config --global user.name "GitHub Actions"
29+
git config --global user.email "[email protected]"
30+
git checkout -B $BRANCH
31+
git add -u
32+
git commit -m "[GHA] Uplift Linux IGC Dev RT version to $NEW_DRIVER_VERSION" || exit 0 # exit if commit is empty
33+
git show
34+
git push https://[email protected]/${{ github.repository }} ${BRANCH}
35+
gh pr create --head $BRANCH --title "[GHA] Uplift Linux IGC Dev RT version to $NEW_DRIVER_VERSION" --body "Scheduled igc dev drivers uplift"

devops/containers/ubuntu2204_intel_drivers.Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ FROM $base_image:$base_tag
66
ENV DEBIAN_FRONTEND=noninteractive
77

88
ARG use_latest=true
9-
ARG use_igc_dev=false
109

11-
RUN apt update && apt install -yqq wget \
12-
&& if [ "$use_igc_dev" = "true" ]; then apt-get install -yqq libllvm14; fi
10+
RUN apt update && apt install -yqq wget
1311

1412
COPY scripts/get_release.py /
1513
COPY scripts/install_drivers.sh /
@@ -22,9 +20,6 @@ RUN --mount=type=secret,id=github_token \
2220
install_driver_opt=" --use-latest"; \
2321
else \
2422
install_driver_opt=" dependencies.json"; \
25-
if [ "$use_igc_dev" = "true" ]; then \
26-
install_driver_opt="$install_driver_opt --use-dev-igc"; \
27-
fi; \
2823
fi && \
2924
GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all
3025

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG base_tag=latest
2+
ARG base_image=ghcr.io/intel/llvm/ubuntu2204_base
3+
4+
FROM $base_image:$base_tag
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
RUN apt update && apt install -yqq libllvm14
9+
10+
COPY scripts/get_release.py /
11+
COPY scripts/install_drivers.sh /
12+
COPY dependencies.json /
13+
COPY dependencies-igc-dev.json /
14+
15+
RUN mkdir /runtimes
16+
ENV INSTALL_LOCATION=/runtimes
17+
RUN --mount=type=secret,id=github_token \
18+
install_driver_opt="dependencies.json dependencies-igc-dev.json --use-dev-igc"; \
19+
GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all
20+
21+
COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh
22+
23+
ENTRYPOINT ["/bin/bash", "/drivers_entrypoint.sh"]
24+

devops/dependencies-igc-dev.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"linux": {
3+
"igc_dev": {
4+
"github_tag": "igc-dev-498324a",
5+
"version": "498324a",
6+
"updated_at": "2024-04-17T13:44:27Z",
7+
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/1422168296/zip",
8+
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
9+
}
10+
}
11+
}

devops/dependencies.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/igc-1.0.15985.7",
1313
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
1414
},
15-
"igc_dev": {
16-
"github_tag": "igc-dev-db4de5f",
17-
"version": "db4de5f",
18-
"updated_at": "2024-04-12T11:06:26Z",
19-
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/1409219375/zip",
20-
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
21-
},
2215
"cm": {
2316
"github_tag": "cmclang-1.0.144",
2417
"version": "1.0.144",

devops/scripts/install_drivers.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ if [ -f "$1" ]; then
88
CONFIG_FILE=$1
99
CR_TAG=$(jq -r '.linux.compute_runtime.github_tag' $CONFIG_FILE)
1010
IGC_TAG=$(jq -r '.linux.igc.github_tag' $CONFIG_FILE)
11-
IGC_DEV_TAG=$(jq -r '.linux.igc_dev.github_tag' $CONFIG_FILE)
12-
IGC_DEV_VER=$(jq -r '.linux.igc_dev.version' $CONFIG_FILE)
13-
IGC_DEV_URL=$(jq -r '.linux.igc_dev.url' $CONFIG_FILE)
1411
CM_TAG=$(jq -r '.linux.cm.github_tag' $CONFIG_FILE)
1512
L0_TAG=$(jq -r '.linux.level_zero.github_tag' $CONFIG_FILE)
1613
TBB_TAG=$(jq -r '.linux.tbb.github_tag' $CONFIG_FILE)
1714
FPGA_TAG=$(jq -r '.linux.fpgaemu.github_tag' $CONFIG_FILE)
1815
CPU_TAG=$(jq -r '.linux.oclcpu.github_tag' $CONFIG_FILE)
16+
if [[ "$*" == *"--use-dev-igc"* ]]; then
17+
CONFIG_FILE_IGC_DEV=$2
18+
IGC_DEV_TAG=$(jq -r '.linux.igc_dev.github_tag' $CONFIG_FILE_IGC_DEV)
19+
IGC_DEV_VER=$(jq -r '.linux.igc_dev.version' $CONFIG_FILE_IGC_DEV)
20+
IGC_DEV_URL=$(jq -r '.linux.igc_dev.url' $CONFIG_FILE_IGC_DEV)
21+
fi
1922
elif [[ "$*" == *"--use-latest"* ]]; then
2023
CR_TAG=latest
2124
IGC_TAG=latest

devops/scripts/update_drivers.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import os
55
import re
6+
import argparse
67

78

89
def get_latest_release(repo):
@@ -28,7 +29,19 @@ def get_artifacts_download_url(repo, name):
2829
return json.loads(artifacts)["artifacts"][0]["archive_download_url"]
2930

3031

31-
def uplift_linux_igfx_driver(config, platform_tag):
32+
def uplift_linux_igfx_driver(config, platform_tag, igc_dev_only):
33+
34+
if igc_dev_only:
35+
igc_dev = get_latest_workflow_runs("intel/intel-graphics-compiler", "build-IGC")
36+
igcdevver = igc_dev["head_sha"][:7]
37+
config[platform_tag]["igc_dev"]["github_tag"] = "igc-dev-" + igcdevver
38+
config[platform_tag]["igc_dev"]["version"] = igcdevver
39+
config[platform_tag]["igc_dev"]["updated_at"] = igc_dev["updated_at"]
40+
config[platform_tag]["igc_dev"]["url"] = get_artifacts_download_url(
41+
"intel/intel-graphics-compiler", "IGC_Ubuntu22.04_llvm14_clang-" + igcdevver
42+
)
43+
return config
44+
3245
compute_runtime = get_latest_release('intel/compute-runtime')
3346

3447
config[platform_tag]['compute_runtime']['github_tag'] = compute_runtime['tag_name']
@@ -46,15 +59,6 @@ def uplift_linux_igfx_driver(config, platform_tag):
4659
config[platform_tag]['igc']['url'] = 'https://github.com/intel/intel-graphics-compiler/releases/tag/igc-' + ver
4760
break
4861

49-
igc_dev = get_latest_workflow_runs("intel/intel-graphics-compiler", "build-IGC")
50-
igcdevver = igc_dev["head_sha"][:7]
51-
config[platform_tag]["igc_dev"]["github_tag"] = "igc-dev-" + igcdevver
52-
config[platform_tag]["igc_dev"]["version"] = igcdevver
53-
config[platform_tag]["igc_dev"]["updated_at"] = igc_dev["updated_at"]
54-
config[platform_tag]["igc_dev"]["url"] = get_artifacts_download_url(
55-
"intel/intel-graphics-compiler", "IGC_Ubuntu22.04_llvm14_clang-" + igcdevver
56-
)
57-
5862
cm = get_latest_release('intel/cm-compiler')
5963
config[platform_tag]['cm']['github_tag'] = cm['tag_name']
6064
config[platform_tag]['cm']['version'] = cm['tag_name'].replace('cmclang-', '')
@@ -68,22 +72,30 @@ def uplift_linux_igfx_driver(config, platform_tag):
6872
return config
6973

7074

71-
def main(platform_tag):
75+
def main(platform_tag, igc_dev_only):
7276
script = os.path.dirname(os.path.realpath(__file__))
7377
config_name = os.path.join(script, '..', 'dependencies.json')
78+
if igc_dev_only:
79+
config_name = os.path.join(script, "..", "dependencies-igc-dev.json")
7480
config = {}
7581

7682
with open(config_name, "r") as f:
7783
config = json.loads(f.read())
78-
config = uplift_linux_igfx_driver(config, platform_tag)
84+
config = uplift_linux_igfx_driver(config, platform_tag, igc_dev_only)
7985

8086
with open(config_name, "w") as f:
8187
json.dump(config, f, indent=2)
8288
f.write('\n')
8389

90+
if igc_dev_only:
91+
return config[platform_tag]["igc_dev"]["github_tag"]
92+
8493
return config[platform_tag]['compute_runtime']['version']
8594

8695

8796
if __name__ == '__main__':
88-
platform_tag = sys.argv[1] if len(sys.argv) > 1 else "ERROR_PLATFORM"
89-
sys.stdout.write(main(platform_tag) + '\n')
97+
parser = argparse.ArgumentParser()
98+
parser.add_argument("platform_tag")
99+
parser.add_argument("--igc-dev-only", action="store_true")
100+
args = parser.parse_args()
101+
sys.stdout.write(main(args.platform_tag, args.igc_dev_only) + "\n")

0 commit comments

Comments
 (0)