diff --git a/docker/build/github-actions-runner/Dockerfile b/docker/build/github-actions-runner/Dockerfile deleted file mode 100644 index a394b76c6..000000000 --- a/docker/build/github-actions-runner/Dockerfile +++ /dev/null @@ -1,60 +0,0 @@ -FROM ubuntu:focal - -# Set the github runner version -ARG RUNNER_VERSION="2.304.0" - -ENV GITHUB_ORGANIZATION="" -ENV GITHUB_ACCESS_TOKEN="" - -# Update and install necessary packages -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl iputils-ping jq software-properties-common build-essential libssl-dev \ - libffi-dev python3 python3-venv python3-dev libmysqlclient-dev yamllint - -# Add a github action runner user -RUN useradd -m actions-runner - -# cd into the user directory, download and unzip the github actions runner -RUN cd /home/actions-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 \ - && ./bin/installdependencies.sh \ - && chown -R actions-runner ~actions-runner \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean - -# Install sudo to execute commands with root privileges -RUN apt-get update && apt-get install -y sudo - -# Install packages needed for Docker installation -RUN apt-get update && apt-get install -y apt-transport-https gnupg-agent - -# Add Docker's GPG key and repository -RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \ - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) stable" - -# Install Docker - for Docker CI running by github action runner -RUN apt-get update && apt-get install -y docker-ce - -# Add the github actions-runner user to the docker group to allow the github action runner user to run docker commands. -# See: https://docs.docker.com/engine/installation/linux/ubuntulinux/ -RUN usermod -aG docker actions-runner - -# Install Node.js 20.x -RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y nodejs - -# Install global Playwright CLI and pre-download required browser binaries -RUN npm install -g playwright && npx playwright install --with-deps - -# copy over the actions-runner.sh script -ADD docker/build/github-actions-runner/actions-runner.sh /actions-runner.sh - -# make the script executable -RUN chmod +x actions-runner.sh - -#set the user to "actions-runner" so all subsequent commands are run as the actions-runner user -USER actions-runner - -# set the entrypoint to the actions-runner.sh script -ENTRYPOINT ["./actions-runner.sh"] diff --git a/docker/build/github-actions-runner/README.rst b/docker/build/github-actions-runner/README.rst deleted file mode 100644 index 06f3fb9ab..000000000 --- a/docker/build/github-actions-runner/README.rst +++ /dev/null @@ -1,11 +0,0 @@ -Usage -##### - -Create image: - - - This must be run from the root of the configuration repository - - ``docker build -f docker/build/github-actions-runner/Dockerfile . -t openedx/github-actions-runner`` - -Start the container with this: - -``docker run -ti -v /var/lib/docker.sock:/var/lib/docker.sock -e GITHUB_ACCESS_TOKEN=xxxxxxxx -e GITHUB_ORGANIZATION=abc openedx/github-actions-runner`` diff --git a/docker/build/github-actions-runner/actions-runner.sh b/docker/build/github-actions-runner/actions-runner.sh deleted file mode 100644 index 602a30af4..000000000 --- a/docker/build/github-actions-runner/actions-runner.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -GITHUB_ORGANIZATION=$GITHUB_ORGANIZATION -GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN - -RUNNER_TOKEN=$(curl -sX POST -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" https://api.github.com/orgs/${GITHUB_ORGANIZATION}/actions/runners/registration-token | jq .token --raw-output) - -cd /home/actions-runner/actions-runner - -./config.sh --url https://github.com/${GITHUB_ORGANIZATION} --token ${RUNNER_TOKEN} --unattended --replace - -cleanup() { - echo "Removing runner..." - ./config.sh remove --unattended --token ${RUNNER_TOKEN} -} - -trap 'cleanup; exit 130' INT -trap 'cleanup; exit 143' TERM - -./bin/runsvc.sh & wait $!