update Dockerfile fot self-hosted runner

This commit is contained in:
Junya Morioka
2025-05-17 23:32:07 +09:00
parent 32325917da
commit ffbf65fcab
4 changed files with 40 additions and 13 deletions
+12 -2
View File
@@ -11,6 +11,16 @@ jobs:
- run: ls - run: ls
- run: pwd - run: pwd
containers-test:
runs-on:
- self-hosted
container:
image: ubuntu:22.04
timeout-minutes: 10
steps:
- run: ls
- run: pwd
test-build: test-build:
runs-on: runs-on:
- self-hosted - self-hosted
@@ -18,11 +28,11 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
flash-attn-version: ["2.4.3", "2.5.9"] flash-attn-version: ["2.4.3"]
python-version: ["3.12"] python-version: ["3.12"]
torch-version: ["2.7.0"] torch-version: ["2.7.0"]
# https://developer.nvidia.com/cuda-toolkit-archive # https://developer.nvidia.com/cuda-toolkit-archive
cuda-version: ["12.8.1"] cuda-version: ["11.8.0", "12.8.1"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
+20 -7
View File
@@ -8,13 +8,21 @@ ARG RUNNER_GROUP="default"
ARG RUNNER_LABELS="self-hosted,Linux" ARG RUNNER_LABELS="self-hosted,Linux"
ARG TARGET_ARCH="x64" 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\ RUN apt-get update && apt-get install -y --no-install-recommends\
curl \ curl \
ca-certificates \ ca-certificates \
sudo \ sudo \
software-properties-common \ software-properties-common \
wget \
unzip \
zip \
git \
libc-bin \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install Docker # Install Docker
@@ -29,21 +37,26 @@ RUN install -m 0755 -d /etc/apt/keyrings \
&& apt-get update \ && apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
docker-ce-cli \ docker-ce-cli \
# docker-ce \ docker-ce \
# containerd.io \ containerd.io \
# docker-buildx-plugin \ docker-buildx-plugin \
# docker-compose-plugin \ docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install dotnet # Install dotnet
RUN add-apt-repository ppa:dotnet/backports RUN add-apt-repository ppa:dotnet/backports
# ubuntu >= 24.04 image has user named 'ubuntu' # 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 # Allow sudo without password
RUN echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers RUN echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
USER ubuntu USER ubuntu
WORKDIR /home/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 \ --work /home/ubuntu/actions-runner \
--replace --replace
CMD ["./run.sh"] CMD ["./run.sh"]
+1 -4
View File
@@ -1,5 +1,6 @@
services: services:
runner: runner:
privileged: true
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
@@ -11,7 +12,3 @@ services:
RUNNER_GROUP: default RUNNER_GROUP: default
RUNNER_LABELS: self-hosted RUNNER_LABELS: self-hosted
TARGET_ARCH: x64 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 "$@"