Merge pull request #7 from mjun0812/feature/add-self-hosted-runner

[WIP] update Dockerfile for self-hosted runner
This commit is contained in:
Junya Morioka
2025-05-17 23:33:39 +09:00
committed by GitHub
4 changed files with 40 additions and 13 deletions
+12 -2
View File
@@ -11,6 +11,16 @@ jobs:
- run: ls
- run: pwd
containers-test:
runs-on:
- self-hosted
container:
image: ubuntu:22.04
timeout-minutes: 10
steps:
- run: ls
- run: pwd
test-build:
runs-on:
- self-hosted
@@ -18,11 +28,11 @@ jobs:
strategy:
fail-fast: false
matrix:
flash-attn-version: ["2.4.3", "2.5.9"]
flash-attn-version: ["2.4.3"]
python-version: ["3.12"]
torch-version: ["2.7.0"]
# https://developer.nvidia.com/cuda-toolkit-archive
cuda-version: ["12.8.1"]
cuda-version: ["11.8.0", "12.8.1"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
+20 -7
View File
@@ -8,13 +8,21 @@ ARG RUNNER_GROUP="default"
ARG RUNNER_LABELS="self-hosted,Linux"
ARG TARGET_ARCH="x64"
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive \
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir -p /opt/hostedtoolcache
RUN apt-get update && apt-get install -y --no-install-recommends\
curl \
ca-certificates \
sudo \
software-properties-common \
wget \
unzip \
zip \
git \
libc-bin \
&& rm -rf /var/lib/apt/lists/*
# Install Docker
@@ -29,21 +37,26 @@ RUN install -m 0755 -d /etc/apt/keyrings \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
docker-ce-cli \
# docker-ce \
# containerd.io \
# docker-buildx-plugin \
# docker-compose-plugin \
docker-ce \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/*
# Install dotnet
RUN add-apt-repository ppa:dotnet/backports
# ubuntu >= 24.04 image has user named 'ubuntu'
RUN usermod -aG sudo ubuntu
RUN usermod -aG sudo ubuntu \
&& usermod -aG docker ubuntu
# Allow sudo without password
RUN echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
USER ubuntu
WORKDIR /home/ubuntu
@@ -61,4 +74,4 @@ RUN curl -fsSL -o actions-runner.tar.gz -L "https://github.com/actions/runner/re
--work /home/ubuntu/actions-runner \
--replace
CMD ["./run.sh"]
CMD ["./run.sh"]
+1 -4
View File
@@ -1,5 +1,6 @@
services:
runner:
privileged: true
build:
context: .
dockerfile: Dockerfile
@@ -11,7 +12,3 @@ services:
RUNNER_GROUP: default
RUNNER_LABELS: self-hosted
TARGET_ARCH: x64
volumes:
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "${DOCKER_GID}"
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
id
# Start docker daemon
sudo service docker start
exec "$@"