Skip to content

Commit

Permalink
CI: Avoid passing large number of args to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jsji committed Apr 3, 2024
1 parent 9f4ee47 commit afd53c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/sycl-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get dependencies configuration
id: deps
run: |
DEPS=`cat devops/dependencies.json`
DEPS="${DEPS//$'\r'/''}"
DEPS="${DEPS//$'\n'/' '}"
echo $DEPS
echo "deps=$DEPS" >>$GITHUB_OUTPUT
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
Expand All @@ -100,13 +92,7 @@ jobs:
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest-${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest
build-args: |
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux.compute_runtime.github_tag}}
igc_tag=${{fromJson(steps.deps.outputs.deps).linux.igc.github_tag}}
cm_tag=${{fromJson(steps.deps.outputs.deps).linux.cm.github_tag}}
level_zero_tag=${{fromJson(steps.deps.outputs.deps).linux.level_zero.github_tag}}
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux.tbb.github_tag}}
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux.fpgaemu.github_tag}}
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux.oclcpu.github_tag}}
use_latest=false
# This job produces a Docker container with the latest versions of Intel
# drivers, that can be found on GitHub.
drivers_image_ubuntu2204_unstable:
Expand Down Expand Up @@ -139,5 +125,5 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable-${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable
# build-args:empty, so we automatically take the "latest" tags as
# unstable
build-args: |
use_latest=true
24 changes: 16 additions & 8 deletions devops/containers/ubuntu2204_intel_drivers.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@ FROM $base_image:$base_tag

ENV DEBIAN_FRONTEND=noninteractive

ARG compute_runtime_tag=latest
ARG igc_tag=latest
ARG cm_tag=latest
ARG level_zero_tag=latest
ARG tbb_tag=latest
ARG fpgaemu_tag=latest
ARG cpu_tag=latest
ARG use_latest=true

RUN apt update && apt install -yqq wget

COPY scripts/get_release.py /
COPY scripts/install_drivers.sh /
COPY dependencies.json /

RUN mkdir /runtimes
ENV INSTALL_LOCATION=/runtimes
RUN --mount=type=secret,id=github_token GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh --all
RUN --mount=type=secret,id=github_token \
if [ "use_latest" = "true" ]; then \
install_driver_opt=""; \
export compute_runtime_tag=latest; \
export igc_tag=latest; \
export cm_tag=latest; \
export level_zero_tag=latest; \
export tbb_tag=latest; \
export fpgaemu_tag=latest; \
export cpu_tag=latest; \
else \
install_driver_opt=" dependencies.json"; \
fi && \
GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all

COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh

Expand Down

0 comments on commit afd53c3

Please sign in to comment.