Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/runners/actions-runner-ubuntu-cuda-11-4.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Use NVIDIA CUDA 12.0.0 development image with Ubuntu 18.04 as the base
FROM nvidia/cuda:11.4.3-devel-ubuntu18.04

ARG RUNNER_VERSION=2.298.2
# Docker and Docker Compose arguments

# Use 1001 and 121 for compatibility with GitHub-hosted runners
ARG RUNNER_UID=1000
ARG DOCKER_GID=1001

ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:git-core/ppa \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
dnsutils \
ftp \
git \
uuid-dev \
iproute2 \
iputils-ping \
jq \
libunwind8 \
locales \
netcat \
openssh-client \
parallel \
python3-pip \
rsync \
shellcheck \
sudo \
telnet \
time \
tzdata \
unzip \
upx \
wget \
lsb-release \
openssl \
manpages-dev \
zip \
zstd \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& rm -rf /var/lib/apt/lists/*

# Add Kitware's APT repository for CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y cmake

# Add PPA for newer versions of GCC
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-11 g++-11 cpp-11 && \
# Clean up
apt-get clean

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

# Download latest git-lfs version
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y --no-install-recommends git-lfs

RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
&& groupadd docker --gid $DOCKER_GID \
&& usermod -aG sudo runner \
&& usermod -aG docker runner \
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers

ENV HOME=/home/runner

# cd into the user directory, download and unzip the github actions runner
RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz

RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh

ADD start.sh start.sh

RUN chmod +x start.sh

# Add /usr/local/cuda-11.4/compat to LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda-11.4/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

USER runner

ENTRYPOINT ["./start.sh"]
103 changes: 103 additions & 0 deletions .github/runners/actions-runner-ubuntu-cuda-12-0.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Use NVIDIA CUDA 12.0.0 development image with Ubuntu 18.04 as the base
FROM nvidia/cuda:12.0.0-devel-ubuntu18.04

ARG RUNNER_VERSION=2.298.2
# Docker and Docker Compose arguments

# Use 1001 and 121 for compatibility with GitHub-hosted runners
ARG RUNNER_UID=1000
ARG DOCKER_GID=1001

ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:git-core/ppa \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
dnsutils \
ftp \
git \
uuid-dev \
iproute2 \
iputils-ping \
jq \
libunwind8 \
locales \
netcat \
openssh-client \
parallel \
python3-pip \
rsync \
shellcheck \
sudo \
telnet \
time \
tzdata \
unzip \
upx \
wget \
lsb-release \
openssl \
manpages-dev \
zip \
zstd \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& rm -rf /var/lib/apt/lists/*

# Add Kitware's APT repository for CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y cmake

# Add PPA for newer versions of GCC
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-11 g++-11 cpp-11 && \
# Clean up
apt-get clean

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

# Download latest git-lfs version
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y --no-install-recommends git-lfs

RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
&& groupadd docker --gid $DOCKER_GID \
&& usermod -aG sudo runner \
&& usermod -aG docker runner \
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers

ENV HOME=/home/runner

# cd into the user directory, download and unzip the github actions runner
RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz

RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh

ADD start.sh start.sh

RUN chmod +x start.sh

# Add /usr/local/cuda-12.0/compat to LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda-12.0/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

USER runner

ENTRYPOINT ["./start.sh"]
50 changes: 50 additions & 0 deletions .github/runners/actions-runner-windows-cuda-11-4.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM mcr.microsoft.com/windows/server:ltsc2022

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]

ARG RUNNER_VERSION=2.298.2

RUN Invoke-WebRequest \
-Uri 'https://aka.ms/install-powershell.ps1' \
-OutFile install-powershell.ps1; \
powershell -ExecutionPolicy Unrestricted -File ./install-powershell.ps1 -AddToPath

RUN Invoke-WebRequest \
-Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip \
-OutFile runner.zip; \
Expand-Archive -Path C:/runner.zip -DestinationPath C:/actions-runner; \
Remove-Item -Path C:\runner.zip; \
setx /M PATH $(${Env:PATH} + \";${Env:ProgramFiles}\Git\bin\")

# Install Chocolatey
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Upgrade Git
RUN choco install git -y; \
git --version

# Install 7zip
RUN choco install 7zip -y; \
7z --help

# Install cmake and add to path
RUN choco install cmake.install -y --installargs '"ADD_CMAKE_TO_PATH=System"'

RUN cmake --version

# Install MSBuild and add to path
RUN choco install visualstudio2019buildtools -y --package-parameters '"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.14.29.CLI.Support --add Microsoft.VisualStudio.Component.VC.14.29.CMake.Project --add Microsoft.VisualStudio.Component.VC.14.29.MFC --add Microsoft.VisualStudio.Component.VC.14.29.MSBuild --add Microsoft.VisualStudio.Component.VC.14.29.VCRedist.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VSTools.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.ASAN --add Microsoft.VisualStudio.Component.VC.14.29.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.14.29.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.14.29.VC.FxCop --add Microsoft.VisualStudio.Component.VC.14.29.VC.MFC --add Microsoft.VisualStudio.Component.VC.14.29.VC.MSBuild --add Microsoft.VisualStudio.Component.VC.14.29.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.14.29.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.VCUnitTest --add Microsoft.VisualStudio.Component.VC.14.29.VC.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.x86.x64.Latest --add Microsoft.VisualStudio.Component.VC.14.29.VisualStudioCppSDK --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win10 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.LegacyBuildTools --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.VC.DiagnosticTools --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.Component.VC.Llvm.Cmake --add Microsoft.VisualStudio.Component.VC.Llvm.Llvm --add Microsoft.VisualStudio.Component.VC.Llvm.Toolset --add Microsoft.VisualStudio.Component.VC.MFC --add Microsoft.VisualStudio.Component.VC.MSBuild --add Microsoft.VisualStudio"'

RUN choco install gzip -y;

# Install cuda toolkit 11.4.4
RUN choco install cuda --version=11.4.2.47141 -y

# Copy integrated tools to MSBuild
RUN Copy-Item -Path 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\extras\visual_studio_integration\MSBuildExtensions\*' -Destination 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\BuildCustomizations'


ADD runner.ps1 C:/runner.ps1
CMD ["pwsh", "-ExecutionPolicy", "Unrestricted", "-File", ".\\runner.ps1"]
51 changes: 51 additions & 0 deletions .github/runners/actions-runner-windows-cuda-12-0.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM mcr.microsoft.com/windows/server:ltsc2022

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]

ARG RUNNER_VERSION=2.298.2

RUN Invoke-WebRequest \
-Uri 'https://aka.ms/install-powershell.ps1' \
-OutFile install-powershell.ps1; \
powershell -ExecutionPolicy Unrestricted -File ./install-powershell.ps1 -AddToPath

RUN Invoke-WebRequest \
-Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip \
-OutFile runner.zip; \
Expand-Archive -Path C:/runner.zip -DestinationPath C:/actions-runner; \
Remove-Item -Path C:\runner.zip; \
setx /M PATH $(${Env:PATH} + \";${Env:ProgramFiles}\Git\bin\")

# Install Chocolatey
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Upgrade Git
RUN choco install git -y; \
git --version

# Install 7zip
RUN choco install 7zip -y; \
7z --help

# Install cmake and add to path
RUN choco install cmake.install -y --installargs '"ADD_CMAKE_TO_PATH=System"'

RUN cmake --version

# Install MSBuild and add to path
RUN choco install visualstudio2022buildtools -y --package-parameters '"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.14.29.CLI.Support --add Microsoft.VisualStudio.Component.VC.14.29.CMake.Project --add Microsoft.VisualStudio.Component.VC.14.29.MFC --add Microsoft.VisualStudio.Component.VC.14.29.MSBuild --add Microsoft.VisualStudio.Component.VC.14.29.VCRedist.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VSTools.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.ASAN --add Microsoft.VisualStudio.Component.VC.14.29.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.14.29.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.14.29.VC.FxCop --add Microsoft.VisualStudio.Component.VC.14.29.VC.MFC --add Microsoft.VisualStudio.Component.VC.14.29.VC.MSBuild --add Microsoft.VisualStudio.Component.VC.14.29.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.14.29.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.VCUnitTest --add Microsoft.VisualStudio.Component.VC.14.29.VC.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.VC.x86.x64.Latest --add Microsoft.VisualStudio.Component.VC.14.29.VisualStudioCppSDK --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win10 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.LegacyBuildTools --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.VC.DiagnosticTools --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.Component.VC.Llvm.Cmake --add Microsoft.VisualStudio.Component.VC.Llvm.Llvm --add Microsoft.VisualStudio.Component.VC.Llvm.Toolset --add Microsoft.VisualStudio.Component.VC.MFC --add Microsoft.VisualStudio.Component.VC.MSBuild --add Microsoft.VisualStudio"'

RUN choco install gzip -y;

# Install cuda toolkit 12.0.4
RUN choco install cuda --version=12.0.1.52833 -y

# Copy integrated tools to MSBuild
RUN Copy-Item -Path 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\extras\visual_studio_integration\MSBuildExtensions\*' -Destination 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\BuildCustomizations'
RUN Copy-Item -Path 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\extras\visual_studio_integration\MSBuildExtensions\*' -Destination 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v160\BuildCustomizations'


ADD runner.ps1 C:/runner.ps1
CMD ["pwsh", "-ExecutionPolicy", "Unrestricted", "-File", ".\\runner.ps1"]
2 changes: 2 additions & 0 deletions .github/runners/runner.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --pat $env:RUNNER_PAT --runnergroup $env:RUNNER_GROUP --labels $env:RUNNER_LABELS --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR;
.\actions-runner\run.cmd;
21 changes: 21 additions & 0 deletions .github/runners/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

RUNNER_REPO=$RUNNER_REPO
RUNNER_PAT=$RUNNER_PAT
RUNNER_GROUP=$RUNNER_GROUP
RUNNER_LABELS=$RUNNER_LABELS
RUNNER_NAME=$RUNNER_NAME

cd /home/runner/actions-runner

./config.sh --unattended --replace --url https://github.com/${RUNNER_REPO} --pat ${RUNNER_PAT} --name ${RUNNER_NAME} --runnergroup ${RUNNER_GROUP} --labels ${RUNNER_LABELS} --work /home/runner/actions-runner/_work

cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --pat ${RUNNER_PAT}
}

trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM

./run.sh & wait $!
Loading