diff --git a/.github/workflows/generate_intel_image.yaml b/.github/workflows/generate_intel_image.yaml new file mode 100644 index 00000000..97b24f45 --- /dev/null +++ b/.github/workflows/generate_intel_image.yaml @@ -0,0 +1,59 @@ +name: 'generate and publish intel docker caches' + +on: + workflow_dispatch: + push: + branches: + - master + +concurrency: + group: intel-cache-${{ github.head_ref || github.ref }}-${{ github.repository }} + cancel-in-progress: true + +jobs: + generate_caches: + strategy: + matrix: + include: + - base-image: intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04 + runs-on: 'ubuntu-latest' + platforms: 'linux/amd64' + runs-on: ${{matrix.runs-on}} + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to quay + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.LOCALAI_REGISTRY_USERNAME }} + password: ${{ secrets.LOCALAI_REGISTRY_PASSWORD }} + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache Intel images + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + build-args: | + BASE_IMAGE=${{ matrix.base-image }} + context: . + file: ./Dockerfile + tags: quay.io/go-skynet/intel-oneapi-base:latest + push: true + target: intel + platforms: ${{ matrix.platforms }} diff --git a/.github/workflows/image-pr.yml b/.github/workflows/image-pr.yml index 85012135..f2cda005 100644 --- a/.github/workflows/image-pr.yml +++ b/.github/workflows/image-pr.yml @@ -68,7 +68,7 @@ jobs: - build-type: 'sycl_f16' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: 'sycl-f16-ffmpeg' ffmpeg: 'true' @@ -110,7 +110,7 @@ jobs: - build-type: 'sycl_f16' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: 'sycl-f16-ffmpeg-core' ffmpeg: 'true' diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 3273d36b..6ce90b1f 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -148,7 +148,7 @@ jobs: - build-type: 'sycl_f16' platforms: 'linux/amd64' tag-latest: 'auto' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f16-ffmpeg' ffmpeg: 'true' @@ -161,7 +161,7 @@ jobs: - build-type: 'sycl_f32' platforms: 'linux/amd64' tag-latest: 'auto' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f32-ffmpeg' ffmpeg: 'true' @@ -175,7 +175,7 @@ jobs: - build-type: 'sycl_f16' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f16-core' ffmpeg: 'false' @@ -185,7 +185,7 @@ jobs: - build-type: 'sycl_f32' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f32-core' ffmpeg: 'false' @@ -195,7 +195,7 @@ jobs: - build-type: 'sycl_f16' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f16-ffmpeg-core' ffmpeg: 'true' @@ -205,7 +205,7 @@ jobs: - build-type: 'sycl_f32' platforms: 'linux/amd64' tag-latest: 'false' - base-image: "intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04" + base-image: "quay.io/go-skynet/intel-oneapi-base:latest" grpc-base-image: "ubuntu:22.04" tag-suffix: '-sycl-f32-ffmpeg-core' ffmpeg: 'true' diff --git a/Dockerfile b/Dockerfile index 0c72b203..2dd092d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ ARG IMAGE_TYPE=extras ARG BASE_IMAGE=ubuntu:22.04 ARG GRPC_BASE_IMAGE=${BASE_IMAGE} +ARG INTEL_BASE_IMAGE=${BASE_IMAGE} # The requirements-core target is common to all images. It should not be placed in requirements-core unless every single build will use it. FROM ${BASE_IMAGE} AS requirements-core @@ -145,6 +146,17 @@ RUN if [ "${BUILD_TYPE}" = "hipblas" ]; then \ ################################### ################################### +# Temporary workaround for Intel's repository to work correctly +# https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/APT-Repository-not-working-signatures-invalid/m-p/1599436/highlight/true#M36143 +# This is a temporary workaround until Intel fixes their repository +FROM ${INTEL_BASE_IMAGE} AS intel +RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \ +gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg +RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" > /etc/apt/sources.list.d/intel-graphics.list + +################################### +################################### + # The grpc target does one thing, it builds and installs GRPC. This is in it's own layer so that it can be effectively cached by CI. # You probably don't need to change anything here, and if you do, make sure that CI is adjusted so that the cache continues to work. FROM ${GRPC_BASE_IMAGE} AS grpc