Skip to content

[CI] Use GITHUB_TOKEN for API requests during drivers install #10947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sycl_detect_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- devops/*/**
drivers:
- devops/dependencies.json
- devops/scripts/install_drivers.sh

- name: Set output
id: result
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sycl_linux_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ jobs:
- name: Install drivers
if: inputs.install_drivers == 'true'
run: |
sudo cp devops/scripts/get_release.py /opt/
sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all
sudo apt install curl
echo "$GITHUB_TOKEN" | sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all
- name: Source OneAPI TBB vars.sh
shell: bash
run: |
Expand Down
35 changes: 26 additions & 9 deletions devops/scripts/install_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,26 @@ else
CPU_TAG=$cpu_tag
fi

TBB_INSTALLED=false
if [ -t 0 ]; then
# Interactive run (?), no token expected. Might be changed later.
TOKEN=""
else
TOKEN=$(</dev/stdin)
fi

LOCATION=$(dirname -- "$(readlink -f "${BASH_SOURCE}")")
function get_release() {
REPO=$1
TAG=$2
URL="https://api.github.com/repos/${REPO}/releases/tags/${TAG}"
HEADER=""
if [ "$TOKEN" != "" ]; then
HEADER="Authorization: Bearer $TOKEN"
fi
curl -s -L -H "$HEADER" $URL \
| jq -r '. as $raw | try .assets[].browser_download_url catch error($raw)'
}

TBB_INSTALLED=false

if [[ -v INSTALL_LOCATION ]]; then
INSTALL_LOCATION=$(realpath "$INSTALL_LOCATION")
Expand All @@ -38,7 +55,7 @@ InstallTBB () {
cd $INSTALL_LOCATION
echo "Installing TBB..."
echo "TBB version $TBB_TAG"
python3 $LOCATION/get_release.py oneapi-src/onetbb $TBB_TAG \
get_release oneapi-src/onetbb $TBB_TAG \
| grep -E ".*-lin.tgz" \
| wget -qi -
tar -xf *.tgz && rm *.tgz && mv oneapi-tbb-* oneapi-tbb
Expand All @@ -53,18 +70,18 @@ InstallIGFX () {
echo "IGC version $IGC_TAG"
echo "CM compiler version $CM_TAG"
echo "Level Zero version $L0_TAG"
python3 $LOCATION/get_release.py intel/intel-graphics-compiler $IGC_TAG \
get_release intel/intel-graphics-compiler $IGC_TAG \
| grep ".*deb" \
| wget -qi -
python3 $LOCATION/get_release.py intel/compute-runtime $CR_TAG \
get_release intel/compute-runtime $CR_TAG \
| grep -E ".*((deb)|(sum))" \
| wget -qi -
sha256sum -c *.sum && \
python3 $LOCATION/get_release.py intel/cm-compiler $CM_TAG \
get_release intel/cm-compiler $CM_TAG \
| grep ".*deb" \
| grep -v "u18" \
| wget -qi -
python3 $LOCATION/get_release.py oneapi-src/level-zero $L0_TAG \
get_release oneapi-src/level-zero $L0_TAG \
| grep ".*deb" \
| wget -qi -
dpkg -i *.deb && rm *.deb *.sum
Expand All @@ -79,7 +96,7 @@ InstallCPURT () {
echo "$INSTALL_LOCATION/oclcpu exists and will be removed!"
rm -Rf $INSTALL_LOCATION/oclcpu;
fi
python3 $LOCATION/get_release.py intel/llvm $CPU_TAG \
get_release intel/llvm $CPU_TAG \
| grep -E ".*oclcpuexp.*tar.gz" \
| wget -qi -
mkdir oclcpu && tar -xf *.tar.gz -C oclcpu && rm *.tar.gz
Expand All @@ -99,7 +116,7 @@ InstallFPGAEmu () {
echo "$INSTALL_LOCATION/fpgaemu exists and will be removed!"
rm -Rf $INSTALL_LOCATION/fpgaemu;
fi
python3 $LOCATION/get_release.py intel/llvm $FPGA_TAG \
get_release intel/llvm $FPGA_TAG \
| grep -E ".*fpgaemu.*tar.gz" \
| wget -qi - && \
mkdir fpgaemu && tar -xf *.tar.gz -C fpgaemu && rm *.tar.gz
Expand Down