Skip to content

Commit c319286

Browse files
committed
[CI] Add cron job to update IGC dev driver only
1 parent 06bd6bc commit c319286

File tree

2 files changed

+48
-15
lines changed

2 files changed

+48
-15
lines changed

.github/workflows/sycl-update-gpu-driver.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ name: Update GPU driver
33
on:
44
schedule:
55
- cron: '0 3 * * 2'
6+
- cron: '0 3 * * 1,4'
67
workflow_dispatch:
8+
inputs:
9+
dayofweek:
10+
description: 'Override the day of the week (e.g., 1 for Monday, 2 for Tuesday, etc.)'
11+
required: false
12+
default: '2'
713

814
permissions: read-all
915

@@ -15,9 +21,25 @@ jobs:
1521
if: github.repository == 'intel/llvm'
1622
steps:
1723
- uses: actions/checkout@v4
24+
- name: Determine parameters based on the day of the week
25+
run: |
26+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
27+
# Use the input dayofweek when manually triggered
28+
DAY_OF_WEEK="${{ github.event.inputs.dayofweek }}"
29+
else
30+
# Use the current day of the week when triggered by a schedule
31+
DAY_OF_WEEK=$(date +%u)
32+
fi
33+
34+
if [ "$DAY_OF_WEEK" = "2" ]; then
35+
PARAM=""
36+
else
37+
PARAM="--igc-dev-only"
38+
fi
39+
echo "PARAM=$PARAM" >> $GITHUB_ENV
1840
- name: Update dependencies file
1941
run: |
20-
version="$(python3 devops/scripts/update_drivers.py linux)"
42+
version="$(python3 devops/scripts/update_drivers.py $PARAM linux)"
2143
echo 'NEW_DRIVER_VERSION='$version >> $GITHUB_ENV
2244
- name: Create Pull Request
2345
env:

devops/scripts/update_drivers.py

Lines changed: 25 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,20 @@ 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+
igc_dev = get_latest_workflow_runs("intel/intel-graphics-compiler", "build-IGC")
35+
igcdevver = igc_dev["head_sha"][:7]
36+
config[platform_tag]["igc_dev"]["github_tag"] = "igc-dev-" + igcdevver
37+
config[platform_tag]["igc_dev"]["version"] = igcdevver
38+
config[platform_tag]["igc_dev"]["updated_at"] = igc_dev["updated_at"]
39+
config[platform_tag]["igc_dev"]["url"] = get_artifacts_download_url(
40+
"intel/intel-graphics-compiler", "IGC_Ubuntu22.04_llvm14_clang-" + igcdevver
41+
)
42+
43+
if(igc_dev_only):
44+
return config
45+
3246
compute_runtime = get_latest_release('intel/compute-runtime')
3347

3448
config[platform_tag]['compute_runtime']['github_tag'] = compute_runtime['tag_name']
@@ -46,15 +60,6 @@ def uplift_linux_igfx_driver(config, platform_tag):
4660
config[platform_tag]['igc']['url'] = 'https://github.com/intel/intel-graphics-compiler/releases/tag/igc-' + ver
4761
break
4862

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-
5863
cm = get_latest_release('intel/cm-compiler')
5964
config[platform_tag]['cm']['github_tag'] = cm['tag_name']
6065
config[platform_tag]['cm']['version'] = cm['tag_name'].replace('cmclang-', '')
@@ -68,22 +73,28 @@ def uplift_linux_igfx_driver(config, platform_tag):
6873
return config
6974

7075

71-
def main(platform_tag):
76+
def main(platform_tag, igc_dev_only):
7277
script = os.path.dirname(os.path.realpath(__file__))
7378
config_name = os.path.join(script, '..', 'dependencies.json')
7479
config = {}
7580

7681
with open(config_name, "r") as f:
7782
config = json.loads(f.read())
78-
config = uplift_linux_igfx_driver(config, platform_tag)
83+
config = uplift_linux_igfx_driver(config, platform_tag, igc_dev_only)
7984

8085
with open(config_name, "w") as f:
8186
json.dump(config, f, indent=2)
8287
f.write('\n')
8388

89+
if(igc_dev_only):
90+
return config[platform_tag]["igc_dev"]["github_tag"]
91+
8492
return config[platform_tag]['compute_runtime']['version']
8593

8694

8795
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')
96+
parser = argparse.ArgumentParser()
97+
parser.add_argument('platform_tag')
98+
parser.add_argument('--igc-dev-only', action='store_true')
99+
args = parser.parse_args()
100+
sys.stdout.write(main(args.platform_tag, args.igc_dev_only) + '\n')

0 commit comments

Comments
 (0)