init.sh env fix #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
env: | |
UBUNTU_VERSION: 22.04 | |
BUILDX_NO_DEFAULT_ATTESTATIONS: 1 | |
LATEST_CUDA: "null" | |
LATEST_ROCM: "null" | |
LATEST_CPU: "null" | |
jobs: | |
cpu-base: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Free Space | |
run: | | |
df -h | |
rm -rf /usr/share/dotnet | |
rm -rf /opt/ghc | |
rm -rf /usr/local/share/boost | |
rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- | |
name: Env Setter | |
run: | | |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Set tags | |
run: | | |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}" | |
ver_tag="cpu-${{ env.UBUNTU_VERSION }}" | |
if [[ $ver_tag == ${{ env.LATEST_CPU }} ]]; then | |
TAGS="${img_path}:latest-cpu, ${img_path}:$ver_tag" | |
else | |
TAGS="${img_path}:$ver_tag" | |
fi | |
echo "TAGS=${TAGS}" >> ${GITHUB_ENV} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: build | |
build-args: | | |
IMAGE_BASE=ubuntu:${{ env.UBUNTU_VERSION }} | |
XPU_TARGET=CPU | |
MAMBA_DEFAULT_ENV=system | |
push: true | |
# Avoids unknown/unknown architecture and extra metadata | |
provenance: false | |
tags: ${{ env.TAGS }} | |
nvidia-base: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cuda: | |
- 11.7.1 | |
- 11.8.0 | |
- 12.1.0 | |
- 12.2.0 | |
level: | |
- "base" | |
- "runtime" | |
- "devel" | |
- "cudnn8-runtime" | |
- "cudnn8-devel" | |
exclude: | |
- cuda: 12.2.0 | |
level: "cudnn8-runtime" # Not yet available | |
- cuda: 12.2.0 | |
level: "cudnn8-devel" # Not yet available | |
steps: | |
- | |
name: Free Space | |
run: | | |
df -h | |
rm -rf /usr/share/dotnet | |
rm -rf /opt/ghc | |
rm -rf /usr/local/share/boost | |
rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- | |
name: Env Setter | |
run: | | |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Set tags | |
run: | | |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}" | |
ver_tag="cuda-${{ matrix.cuda }}-${{ matrix.level }}-${{ env.UBUNTU_VERSION }}" | |
if [[ $ver_tag == ${{ env.LATEST_CUDA }} ]]; then | |
TAGS="${img_path}:latest, ${img_path}:latest-cuda, ${img_path}:$ver_tag" | |
else | |
TAGS="${img_path}:$ver_tag" | |
fi | |
echo "TAGS=${TAGS}" >> ${GITHUB_ENV} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: build | |
build-args: | | |
IMAGE_BASE=nvidia/cuda:${{ matrix.cuda }}-${{ matrix.level }}-ubuntu${{ env.UBUNTU_VERSION }} | |
XPU_TARGET=NVIDIA_GPU | |
CUDA_VERSION=${{ matrix.cuda }} | |
CUDA_LEVEL=${{ matrix.level }} | |
MAMBA_DEFAULT_ENV=system | |
push: true | |
provenance: false | |
tags: ${{ env.TAGS }} | |
amd-base: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rocm: | |
- 5.4.2 | |
- 5.6 | |
level: | |
- "core" | |
- "runtime" | |
- "devel" | |
steps: | |
- | |
name: Free Space | |
run: | | |
df -h | |
rm -rf /usr/share/dotnet | |
rm -rf /opt/ghc | |
rm -rf /usr/local/share/boost | |
rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- | |
name: Env Setter | |
run: | | |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
echo "TAG=rocm-${{ matrix.rocm }}-${{ matrix.level }}-${{ env.UBUNTU_VERSION }}" >> ${GITHUB_ENV} | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Set tags | |
run: | | |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}" | |
ver_tag="rocm-${{ matrix.rocm }}-${{ matrix.level }}-${{ env.UBUNTU_VERSION }}" | |
if [[ $ver_tag == ${{ env.LATEST_ROCM }} ]]; then | |
TAGS="${img_path}:latest-rocm, ${img_path}:$ver_tag" | |
else | |
TAGS="${img_path}:$ver_tag" | |
fi | |
echo "TAGS=${TAGS}" >> ${GITHUB_ENV} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: build | |
build-args: | | |
IMAGE_BASE=ubuntu:${{ env.UBUNTU_VERSION }} | |
XPU_TARGET=AMD_GPU | |
ROCM_VERSION=${{ matrix.rocm }} | |
ROCM_LEVEL=${{ matrix.level }} | |
MAMBA_DEFAULT_ENV=system | |
push: true | |
provenance: false | |
tags: ${{ env.TAGS }} |