Skip to content

Commit

Permalink
[CI] Don't use matrix for drivers installation in pre-commit
Browse files Browse the repository at this point in the history
Use functionality introduced in #10503
instead. The only piece remaining in the matrix generation is selection of
driverless image if new drivers are to be installed.
  • Loading branch information
aelovikov-intel committed Jul 27, 2023
1 parent a752888 commit f93bee9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 74 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/sycl_detect_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
# devops/* contains config files, including drivers versions.
# Allow them to be tested in pre-commit.
- devops/*/**
drivers:
- devops/dependencies.json
- name: Set output
id: result
Expand All @@ -64,6 +66,6 @@ jobs:
return '${{ steps.changes.outputs.changes }}';
}
// Treat everything as changed for huge PRs.
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci"];
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci", "drivers"];
- run: echo '${{ steps.result.outputs.result }}'
23 changes: 12 additions & 11 deletions .github/workflows/sycl_gen_test_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
type: string
required: false
default: ${{ github.sha }}
drivers_update_needed:
description: "True indicates that dependencies.json has changed"
type: string
required: false
default: false
outputs:
lts_lx_matrix:
description: "Linux LTS"
Expand All @@ -58,22 +63,18 @@ jobs:
cts_matrix: ${{ steps.work.outputs.cts_matrix }}
lts_aws_matrix: ${{ steps.work.outputs.lts_aws_matrix }}
steps:
- name: Download scripts and configs
shell: bash
run: |
wget raw.githubusercontent.com/intel/llvm/${{ inputs.ref }}/devops/scripts/generate_test_matrix.js
wget raw.githubusercontent.com/intel/llvm/${{ inputs.ref }}/devops/test_configs.json
wget raw.githubusercontent.com/intel/llvm/sycl/devops/dependencies.json
mv dependencies.json dependencies.sycl.json
wget raw.githubusercontent.com/intel/llvm/${{ inputs.ref }}/devops/dependencies.json
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
sparse-checkout: |
devops/scripts/generate_test_matrix.js
devops/test_configs.json
- id: work
uses: actions/github-script@v6
name: Generate matrix
env:
GHA_INPUTS: ${{ toJSON(inputs) }}
with:
script: |
const script = require('./generate_test_matrix.js');
const script = require('./devops/generate_test_matrix.js');
script({core, process});
- name: Cleanup
run: rm -rf generate_test_matrix.js test_configs.json dependencies.json dependencies.sycl.json
10 changes: 6 additions & 4 deletions .github/workflows/sycl_linux_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ on:
type: choice
options:
- "[]"
# Use this to test drivers installation:
- "[drivers]"
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
build_image:
type: choice
Expand Down Expand Up @@ -113,6 +115,8 @@ jobs:
with:
ref: ${{ inputs.build_ref || github.sha }}
lts_config: ${{ inputs.lts_config }}
drivers_update_needed: ${{ contains(inputs.changes, 'drivers') }}


build:
needs: [test_matrix]
Expand Down Expand Up @@ -283,13 +287,12 @@ jobs:
ref: ${{ inputs.build_ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
reset_gpu: ${{ contains(matrix.runs-on, 'gen12') && contains(matrix.runs-on, 'Linux') }}
install_drivers: ${{ contains(inputs.changes, 'drivers') && (contains(matrix.runs-on, 'gen12') || contains(matrix.runs-on, 'x86-cpu'))}}

sycl_toolchain_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}

env: ${{ toJSON(matrix.env) }}

khronos_sycl_cts:
needs: [test_matrix, build]
if: ${{ needs.test_matrix.outputs.cts_matrix != '[]' && inputs.check_sycl == 'true' }}
Expand All @@ -309,13 +312,12 @@ jobs:
ref: ${{ inputs.build_ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
reset_gpu: ${{ contains(matrix.runs-on, 'gen12') && contains(matrix.runs-on, 'Linux') }}
install_drivers: ${{ contains(inputs.changes, 'drivers') && (contains(matrix.runs-on, 'gen12') || contains(matrix.runs-on, 'x86-cpu'))}}

sycl_toolchain_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
sycl_toolchain_archive: ${{ inputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ inputs.artifact_decompress_command }}

env: ${{ toJSON(matrix.env) }}

aws-stop:
name: Stop AWS
needs: [ test_matrix, aws-start, e2e-tests ]
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/sycl_linux_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ jobs:
sudo apt install -yq jq
sudo cp devops/scripts/get_release.py /opt/
sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all
- name: Install drivers (deprecated CI interface)
if: env.compute_runtime_tag != '' && inputs.install_drivers != 'true'
run: |
if [ -e /opt/install_drivers.sh ]; then
# TODO pack this script into container
sudo cp devops/scripts/get_release.py /opt/
sudo -E /opt/install_drivers.sh --all
fi
- name: Source OneAPI TBB vars.sh
shell: bash
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sycl_windows_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ jobs:
include: ${{ fromJSON(inputs.lts_matrix) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
env: ${{ matrix.env }}
steps:
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
with:
Expand Down
51 changes: 2 additions & 49 deletions devops/scripts/generate_test_matrix.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
module.exports = ({core, process}) => {
const fs = require('fs');
fs.readFile('./test_configs.json', 'utf8', (err, data) => {
fs.readFile('./devops/test_configs.json', 'utf8', (err, data) => {
if (err) {
console.error(`Error reading file from disk: ${err}`);
} else {
const driverNew =
JSON.parse(fs.readFileSync('./dependencies.json', 'utf8'));
const driverOld =
JSON.parse(fs.readFileSync('./dependencies.sycl.json', 'utf8'));
const testConfigs = JSON.parse(data);
const inputs = JSON.parse(process.env.GHA_INPUTS);
const needsDrivers =
driverNew["linux"]["compute_runtime"]["version"] !==
driverOld["linux"]["compute_runtime"]["version"] ||
driverNew["linux"]["igc"]["version"] !==
driverOld["linux"]["igc"]["version"] ||
driverNew["linux"]["cm"]["version"] !==
driverOld["linux"]["cm"]["version"] ||
driverNew["linux"]["level_zero"]["version"] !==
driverOld["linux"]["level_zero"]["version"] ||
driverNew["linux"]["tbb"]["version"] !==
driverOld["linux"]["tbb"]["version"] ||
driverNew["linux"]["oclcpu"]["version"] !==
driverOld["linux"]["oclcpu"]["version"] ||
driverNew["linux"]["fpgaemu"]["version"] !==
driverOld["linux"]["fpgaemu"]["version"];
const needsDrivers = inputs.drivers_update_needed == 'true';

const ltsConfigs = inputs.lts_config.split(';');

Expand All @@ -36,21 +18,6 @@ module.exports = ({core, process}) => {

testConfigs.lts.forEach(v => {
if (ltsConfigs.includes(v.config)) {
if (needsDrivers) {
v["env"] = {
"compute_runtime_tag" :
driverNew["linux"]["compute_runtime"]["github_tag"],
"igc_tag" : driverNew["linux"]["igc"]["github_tag"],
"cm_tag" : driverNew["linux"]["cm"]["github_tag"],
"level_zero_tag" : driverNew["linux"]["level_zero"]["github_tag"],
"tbb_tag" : driverNew["linux"]["tbb"]["github_tag"],
"cpu_tag" : driverNew["linux"]["oclcpu"]["github_tag"],
"fpgaemu_tag" : driverNew["linux"]["fpgaemu"]["github_tag"],
};
} else {
v["env"] = {};
}

// Check for CUDA machines. If available, add them to
// enabledLTSLxConfigs.
var hasCuda = false;
Expand Down Expand Up @@ -106,20 +73,6 @@ module.exports = ({core, process}) => {

testConfigs.cts.forEach(v => {
if (ctsConfigs.includes(v.config)) {
if (needsDrivers) {
v["env"] = {
"compute_runtime_tag" :
driverNew["linux"]["compute_runtime"]["github_tag"],
"igc_tag" : driverNew["linux"]["igc"]["github_tag"],
"cm_tag" : driverNew["linux"]["cm"]["github_tag"],
"level_zero_tag" : driverNew["linux"]["level_zero"]["github_tag"],
"tbb_tag" : driverNew["linux"]["tbb"]["github_tag"],
"cpu_tag" : driverNew["linux"]["oclcpu"]["github_tag"],
"fpgaemu_tag" : driverNew["linux"]["fpgaemu"]["github_tag"],
};
} else {
v["env"] = {};
}
enabledCTSConfigs.push(v);
}
});
Expand Down

0 comments on commit f93bee9

Please sign in to comment.