diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index b19bba7..59428ad 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -3,7 +3,7 @@ description: 'Build and optionally push a Docker image to Docker Hub and GitHub inputs: image_name: - description: 'Docker image name (e.g., sebffischer/anvil-cuda)' + description: 'Docker image name (e.g., sebffischer/anvl-cuda)' required: true dockerfile: description: 'Path to the Dockerfile' @@ -21,8 +21,8 @@ inputs: ghcr_token: description: 'GitHub token for GHCR (typically GITHUB_TOKEN)' required: false - anvil_ref: - description: 'Git ref for r-xla/anvil to install (tag, branch, or SHA). Defaults to HEAD.' + anvl_ref: + description: 'Git ref for r-xla/anvl to install (tag, branch, or SHA). Defaults to HEAD.' required: false default: '' no_cache: @@ -102,7 +102,7 @@ runs: build-args: | BUILDKIT_INLINE_CACHE=1 CACHEBUST=${{ github.run_id }} - ANVIL_REF=${{ inputs.anvil_ref }} + ANVL_REF=${{ inputs.anvl_ref }} secrets: ${{ inputs.github_pat != '' && format('github_pat={0}', inputs.github_pat) || '' }} no-cache: ${{ inputs.no_cache == 'true' }} cache-from: ${{ inputs.no_cache != 'true' && format('type=registry,ref=docker.io/{0}:buildcache', inputs.image_name) || '' }} diff --git a/.github/workflows/cpu.yaml b/.github/workflows/cpu.yaml index a5c3c4e..94e332c 100644 --- a/.github/workflows/cpu.yaml +++ b/.github/workflows/cpu.yaml @@ -13,26 +13,26 @@ on: - main jobs: - resolve-anvil-release: + resolve-anvl-release: runs-on: ubuntu-latest outputs: tag: ${{ steps.get-tag.outputs.tag }} changed: ${{ steps.set-changed.outputs.changed }} steps: - - name: Get latest anvil release tag + - name: Get latest anvl release tag id: get-tag env: GH_TOKEN: ${{ github.token }} run: | - tag=$(gh api repos/r-xla/anvil/releases/latest --jq '.tag_name') + tag=$(gh api repos/r-xla/anvl/releases/latest --jq '.tag_name') echo "tag=$tag" >> "$GITHUB_OUTPUT" - echo "Latest anvil release: $tag" + echo "Latest anvl release: $tag" - name: Check if release changed id: check-cache uses: actions/cache@v4 with: - path: /tmp/anvil-release-tag-cpu - key: anvil-release-cpu-${{ steps.get-tag.outputs.tag }} + path: /tmp/anvl-release-tag-cpu + key: anvl-release-cpu-${{ steps.get-tag.outputs.tag }} - name: Set changed output id: set-changed run: | @@ -40,8 +40,8 @@ jobs: echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" - mkdir -p /tmp/anvil-release-tag-cpu - echo "${{ steps.get-tag.outputs.tag }}" > /tmp/anvil-release-tag-cpu/tag + mkdir -p /tmp/anvl-release-tag-cpu + echo "${{ steps.get-tag.outputs.tag }}" > /tmp/anvl-release-tag-cpu/tag fi build-latest: @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/docker-build with: - image_name: sebffischer/anvil-cpu + image_name: sebffischer/anvl-cpu dockerfile: ./cpu/Dockerfile push: ${{ github.event_name != 'pull_request' }} dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -61,12 +61,12 @@ jobs: ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_pat: ${{ secrets.GITHUB_TOKEN }} extra_tags: | - docker.io/sebffischer/anvil-cpu:latest - ghcr.io/${{ github.repository_owner }}/anvil-cpu:latest + docker.io/sebffischer/anvl-cpu:latest + ghcr.io/${{ github.repository_owner }}/anvl-cpu:latest build-release: - needs: resolve-anvil-release - if: needs.resolve-anvil-release.outputs.changed == 'true' + needs: resolve-anvl-release + if: needs.resolve-anvl-release.outputs.changed == 'true' runs-on: ubuntu-latest permissions: contents: read @@ -75,14 +75,14 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/docker-build with: - image_name: sebffischer/anvil-cpu + image_name: sebffischer/anvl-cpu dockerfile: ./cpu/Dockerfile push: ${{ github.event_name != 'pull_request' }} dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_pat: ${{ secrets.GITHUB_TOKEN }} - anvil_ref: ${{ needs.resolve-anvil-release.outputs.tag }} + anvl_ref: ${{ needs.resolve-anvl-release.outputs.tag }} extra_tags: | - docker.io/sebffischer/anvil-cpu:release - ghcr.io/${{ github.repository_owner }}/anvil-cpu:release + docker.io/sebffischer/anvl-cpu:release + ghcr.io/${{ github.repository_owner }}/anvl-cpu:release diff --git a/.github/workflows/cuda-base.yaml b/.github/workflows/cuda-base.yaml index 56a6a8a..be4cb31 100644 --- a/.github/workflows/cuda-base.yaml +++ b/.github/workflows/cuda-base.yaml @@ -13,26 +13,26 @@ on: - main jobs: - resolve-anvil-release: + resolve-anvl-release: runs-on: ubuntu-latest outputs: tag: ${{ steps.get-tag.outputs.tag }} changed: ${{ steps.set-changed.outputs.changed }} steps: - - name: Get latest anvil release tag + - name: Get latest anvl release tag id: get-tag env: GH_TOKEN: ${{ github.token }} run: | - tag=$(gh api repos/r-xla/anvil/releases/latest --jq '.tag_name') + tag=$(gh api repos/r-xla/anvl/releases/latest --jq '.tag_name') echo "tag=$tag" >> "$GITHUB_OUTPUT" - echo "Latest anvil release: $tag" + echo "Latest anvl release: $tag" - name: Check if release changed id: check-cache uses: actions/cache@v4 with: - path: /tmp/anvil-release-tag-cuda - key: anvil-release-cuda-${{ steps.get-tag.outputs.tag }} + path: /tmp/anvl-release-tag-cuda + key: anvl-release-cuda-${{ steps.get-tag.outputs.tag }} - name: Set changed output id: set-changed run: | @@ -40,11 +40,11 @@ jobs: echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" - mkdir -p /tmp/anvil-release-tag-cuda - echo "${{ steps.get-tag.outputs.tag }}" > /tmp/anvil-release-tag-cuda/tag + mkdir -p /tmp/anvl-release-tag-cuda + echo "${{ steps.get-tag.outputs.tag }}" > /tmp/anvl-release-tag-cuda/tag fi - # -- :latest builds (anvil main) -- + # -- :latest builds (anvl main) -- build-cuda-base-latest: runs-on: ubuntu-latest permissions: @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/docker-build with: - image_name: sebffischer/anvil-cuda-base + image_name: sebffischer/anvl-cuda-base dockerfile: ./cuda-base/Dockerfile push: ${{ github.event_name != 'pull_request' }} dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -62,24 +62,24 @@ jobs: ghcr_token: ${{ secrets.GITHUB_TOKEN }} no_cache: 'true' extra_tags: | - docker.io/sebffischer/anvil-cuda-base:latest - ghcr.io/${{ github.repository_owner }}/anvil-cuda-base:latest + docker.io/sebffischer/anvl-cuda-base:latest + ghcr.io/${{ github.repository_owner }}/anvl-cuda-base:latest build-cuda-latest: needs: build-cuda-base-latest uses: ./.github/workflows/cuda.yaml with: push: ${{ github.event_name != 'pull_request' }} - anvil_ref: '' + anvl_ref: '' tag: latest secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - # -- :release builds (latest anvil release, only when release changed) -- + # -- :release builds (latest anvl release, only when release changed) -- build-cuda-base-release: - needs: resolve-anvil-release - if: needs.resolve-anvil-release.outputs.changed == 'true' + needs: resolve-anvl-release + if: needs.resolve-anvl-release.outputs.changed == 'true' runs-on: ubuntu-latest permissions: contents: read @@ -88,7 +88,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/docker-build with: - image_name: sebffischer/anvil-cuda-base + image_name: sebffischer/anvl-cuda-base dockerfile: ./cuda-base/Dockerfile push: ${{ github.event_name != 'pull_request' }} dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -96,16 +96,16 @@ jobs: ghcr_token: ${{ secrets.GITHUB_TOKEN }} no_cache: 'true' extra_tags: | - docker.io/sebffischer/anvil-cuda-base:release - ghcr.io/${{ github.repository_owner }}/anvil-cuda-base:release + docker.io/sebffischer/anvl-cuda-base:release + ghcr.io/${{ github.repository_owner }}/anvl-cuda-base:release build-cuda-release: - needs: [resolve-anvil-release, build-cuda-base-release] - if: needs.resolve-anvil-release.outputs.changed == 'true' + needs: [resolve-anvl-release, build-cuda-base-release] + if: needs.resolve-anvl-release.outputs.changed == 'true' uses: ./.github/workflows/cuda.yaml with: push: ${{ github.event_name != 'pull_request' }} - anvil_ref: ${{ needs.resolve-anvil-release.outputs.tag }} + anvl_ref: ${{ needs.resolve-anvl-release.outputs.tag }} tag: release secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/.github/workflows/cuda.yaml b/.github/workflows/cuda.yaml index 4b8671b..00bc530 100644 --- a/.github/workflows/cuda.yaml +++ b/.github/workflows/cuda.yaml @@ -8,8 +8,8 @@ on: description: 'Whether to push the image' type: boolean default: false - anvil_ref: - description: 'Git ref for r-xla/anvil to install' + anvl_ref: + description: 'Git ref for r-xla/anvl to install' type: string default: '' tag: @@ -36,14 +36,14 @@ jobs: - name: Build and push Docker image uses: ./.github/actions/docker-build with: - image_name: sebffischer/anvil-cuda + image_name: sebffischer/anvl-cuda dockerfile: ./cuda/Dockerfile push: ${{ inputs.push || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }} dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_pat: ${{ secrets.GITHUB_TOKEN }} - anvil_ref: ${{ inputs.anvil_ref }} + anvl_ref: ${{ inputs.anvl_ref }} extra_tags: | - docker.io/sebffischer/anvil-cuda:${{ inputs.tag || 'latest' }} - ghcr.io/${{ github.repository_owner }}/anvil-cuda:${{ inputs.tag || 'latest' }} + docker.io/sebffischer/anvl-cuda:${{ inputs.tag || 'latest' }} + ghcr.io/${{ github.repository_owner }}/anvl-cuda:${{ inputs.tag || 'latest' }} diff --git a/Makefile b/Makefile index 04c8d02..9b89cd0 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Build variables (override with: make cpu TAG=mytag) -CPU_IMAGE_NAME ?= anvil-cpu -CUDA_BASE_IMAGE_NAME ?= anvil-cuda-base -CUDA_IMAGE_NAME ?= anvil-cuda -CPU_BENCH_IMAGE_NAME ?= anvil-cpu-bench -CUDA_BENCH_IMAGE_NAME ?= anvil-cuda-bench -CUDA_BENCH_12_4_IMAGE_NAME ?= anvil-cuda-bench-12.4 +CPU_IMAGE_NAME ?= anvl-cpu +CUDA_BASE_IMAGE_NAME ?= anvl-cuda-base +CUDA_IMAGE_NAME ?= anvl-cuda +CPU_BENCH_IMAGE_NAME ?= anvl-cpu-bench +CUDA_BENCH_IMAGE_NAME ?= anvl-cuda-bench +CUDA_BENCH_12_4_IMAGE_NAME ?= anvl-cuda-bench-12.4 TAG ?= latest PLATFORM ?= linux/amd64 PROGRESS ?= plain diff --git a/README.md b/README.md index e320c20..f525c99 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Docker images for anvil +# Docker images for anvl -This repository builds daily docker images for https://github.com/r-xla/anvil. +This repository builds daily docker images for https://github.com/r-xla/anvl. Only amd64/x86-64 architecture is supported. ## Prebuilt Images @@ -9,9 +9,9 @@ These images are built daily and pushed to [Docker Hub](https://hub.docker.com/u | Image | Description | |-------|-------------| -| `anvil-cpu` | Anvil with CPU support based on rocker/r-ver | -| `anvil-cuda-base` | Base image with CUDA 12.8.1 and all {anvil} system dependencies | -| `anvil-cuda` | `anvil-cuda-base` with {anvil} installed | +| `anvl-cpu` | Anvl with CPU support based on rocker/r-ver | +| `anvl-cuda-base` | Base image with CUDA 12.8.1 and all {anvl} system dependencies | +| `anvl-cuda` | `anvl-cuda-base` with {anvl} installed | All images come with R installed. @@ -19,8 +19,8 @@ Each image is available with two tags: | Tag | Description | |-----|-------------| -| `:latest` | Built from the anvil `main` branch (rebuilt daily and on push) | -| `:release` | Built from the latest anvil release (rebuilt when a new release is published) | +| `:latest` | Built from the anvl `main` branch (rebuilt daily and on push) | +| `:release` | Built from the latest anvl release (rebuilt when a new release is published) | ```bash # From Docker Hub @@ -49,8 +49,8 @@ These Dockerfiles are available for local builds but are not automatically built | Image | Description | |-------|-------------| -| `anvil-cpu-bench` | `anvil-cpu` + dependencies for benchmarking | -| `anvil-cuda-bench` | `anvil-cuda` + dependencies for benchmarking | +| `anvl-cpu-bench` | `anvl-cpu` + dependencies for benchmarking | +| `anvl-cuda-bench` | `anvl-cuda` + dependencies for benchmarking | ## Building Images Locally diff --git a/cpu-bench/Dockerfile b/cpu-bench/Dockerfile index 47220ce..c4f2d3e 100644 --- a/cpu-bench/Dockerfile +++ b/cpu-bench/Dockerfile @@ -1,4 +1,4 @@ -FROM sebffischer/anvil-cpu:latest +FROM sebffischer/anvl-cpu:latest ENV DEBIAN_FRONTEND=noninteractive diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 0797c9a..921a958 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -22,17 +22,17 @@ COPY .Rprofile /usr/local/lib/R/etc/Rprofile.site RUN R -q -e "install.packages('remotes', force = TRUE)" -# Cache bust to always reinstall anvil +# Cache bust to always reinstall anvl ARG CACHEBUST=1 -ARG ANVIL_REF="" +ARG ANVL_REF="" # GITHUB_PAT is NOT part of the image RUN --mount=type=secret,id=github_pat \ export GITHUB_PAT="$(cat /run/secrets/github_pat 2>/dev/null || true)" && \ - ANVIL_REF="${ANVIL_REF:-HEAD}" \ - R -q -e "remotes::install_github('r-xla/anvil', ref = Sys.getenv('ANVIL_REF'), force = TRUE)" + ANVL_REF="${ANVL_REF:-HEAD}" \ + R -q -e "remotes::install_github('r-xla/anvl', ref = Sys.getenv('ANVL_REF'), force = TRUE)" # Trigger PJRT plugin download -RUN R -q -e "anvil::nv_array(1, device = 'cpu')" +RUN R -q -e "anvl::nv_array(1, device = 'cpu')" CMD ["bash"] diff --git a/cuda-bench/Dockerfile b/cuda-bench/Dockerfile index cab6e11..ad66c2f 100644 --- a/cuda-bench/Dockerfile +++ b/cuda-bench/Dockerfile @@ -1,4 +1,4 @@ -FROM sebffischer/anvil-cuda:latest +FROM sebffischer/anvl-cuda:latest ENV DEBIAN_FRONTEND=noninteractive diff --git a/cuda/Dockerfile b/cuda/Dockerfile index 6565bf5..7c6c4a1 100644 --- a/cuda/Dockerfile +++ b/cuda/Dockerfile @@ -1,21 +1,21 @@ # -------- Build on cuda-base image -------- -FROM sebffischer/anvil-cuda-base:latest +FROM sebffischer/anvl-cuda-base:latest # -------- install R packages--------------------------- RUN R -q -e "install.packages('remotes', force = TRUE)" -# Cache bust to always reinstall anvil +# Cache bust to always reinstall anvl ARG CACHEBUST=1 -ARG ANVIL_REF="" +ARG ANVL_REF="" # GITHUB_PAT is NOT part of the image # USE_BUNDLED_LIBUV: fs >= 2.1.0 no longer auto-falls back to its bundled libuv # when system libuv-dev is absent, so force the bundled build. RUN --mount=type=secret,id=github_pat \ export GITHUB_PAT="$(cat /run/secrets/github_pat 2>/dev/null || true)" && \ - ANVIL_REF="${ANVIL_REF:-HEAD}" \ + ANVL_REF="${ANVL_REF:-HEAD}" \ USE_BUNDLED_LIBUV=1 \ - R -q -e "remotes::install_github('r-xla/anvil', ref = Sys.getenv('ANVIL_REF'), force = TRUE)" + R -q -e "remotes::install_github('r-xla/anvl', ref = Sys.getenv('ANVL_REF'), force = TRUE)" # Download PJRT plugins # Can't use nv_array() here because it fails if no GPU is available