Skip to content

Commit

Permalink
update ci for cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
gezp committed Nov 24, 2023
1 parent 6ce3d9e commit dc461e7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker Image CI for Ubuntu with Cuda

on:
push:
tag:
- "*-cu*"

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Aliyun Docker Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hongkong.aliyuncs.com
username: ${{ secrets.ALIYUN_USERNAME }}
password: ${{ secrets.ALIYUN_PASSWORD }}
- name: Check Github Tag
id: checker
run: |
UBUNTU_VERSION=`echo $1 | awk -F '-cu' '{print $1}'`
CUDA_VERSION=`echo $1 | awk -F '-cu' '{print $2}'`
echo "ubuntu version:${UBUNTU_VERSION},cuda version:${CUDA_VERSION}"
echo "UBUNTU_VERSION=${UBUNTU_VERSION}" >> $GITHUB_OUTPUT
echo "CUDA_VERSION=${CUDA_VERSION}" >> $GITHUB_OUTPUT
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: ubuntu-desktop
file: ubuntu-desktop/${{env.UBUNTU_VERSION}}/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=nvidia/cuda:${{env.CUDA_VERSION}}-devel-ubuntu${{env.UBUNTU_VERSION}}
push: true
tags: |
gezp/ubuntu-desktop:${{env.UBUNTU_VERSION}}-cu${{env.CUDA_VERSION}}
registry.cn-hongkong.aliyuncs.com/gezp/ubuntu-desktop:${{env.UBUNTU_VERSION}}-cu${{env.CUDA_VERSION}}
env:
UBUNTU_VERSION: ${{ steps.checker.outputs.UBUNTU_VERSION }}
CUDA_VERSION: ${{ steps.checker.outputs.CUDA_VERSION }}
7 changes: 0 additions & 7 deletions update_tag.sh → update_cuda_tag.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/bin/bash

ubuntu_tags=(18.04 20.04 22.04)
ubuntu18_cuda_tags=(11.0.3 11.1.1 11.2.2)
ubuntu20_cuda_tags=(11.0.3 11.1.1 11.2.2 11.3.1 11.4.3 11.5.2 11.6.2 11.7.1)
ubuntu22_cuda_tags=(11.7.1 11.8.0 12.0.1 12.1.1)

for value in ${ubuntu_tags[@]}
do
git tag $value -f
git push origin $value -f
done

for value in ${ubuntu18_cuda_tags[@]}
do
git tag 18.04-cu$value -f
Expand Down

0 comments on commit dc461e7

Please sign in to comment.