Compare commits

...
35 Commits
Author SHA1 Message Date
Marcus Young 5727df6463 [Automated 🤖 ] Bump to version 2.289.2 2022-03-30 09:38:48 -05:00
Marcus Young 9a4c9687b6 [Automated 🤖 ] Bump to version 2.289.1 2022-03-18 13:48:30 -05:00
Marcus Young 22da74a53e [Automated 🤖 ] Bump to version 2.289.0 2022-03-18 10:44:08 -05:00
Marcus Young eba879f8a8 [Automated 🤖 ] Bump to version 2.288.1 2022-02-28 13:18:07 -06:00
Marcus Young 5aa59da8ca [Automated 🤖 ] Bump to version 2.288.0 2022-02-28 13:17:39 -06:00
myoung34andGitHub 742cae3439 Update README.md 2022-02-23 21:24:40 -06:00
myoung34andGitHub f85e5be0ba Merge pull request #189 from ikari7789/patch-1
Add proxy env variable passthru on sudo
2022-02-17 19:49:09 -06:00
Andrew Miller bb4285357f Use .* instead of ' ' for find/replace in sudoers 2022-02-18 10:23:10 +09:00
Andrew MillerandAndrew Miller 9828ae64b1 Add proxy env variable passthru on sudo
If you use "sudo" in the workflow file while behind a proxy, the environment variables passed into the container on creation will be lost since sudo current resets the environment. Update /etc/sudoers to allow the *_proxy and *_PROXY variables to be passed thru so proxy configuration is not lost.
2022-02-17 13:34:45 +09:00
myoung34andGitHub ff360e9b08 Merge pull request #184 from myoung34/disable_auto_updates
Add DISABLE_AUTO_UPDATE flag to disable automatic updates
2022-02-03 09:31:22 -06:00
Marcus Young 89fd82e9f8 Add DISABLE_AUTO_UPDATE flag to disable automatic updates 2022-02-03 09:30:51 -06:00
Marcus Young 3ea2681c1c Add missing dependency for awscli fallback 2022-02-01 20:18:06 -06:00
myoung34andGitHub a3b283960b Merge pull request #183 from myoung34/fix_awscli
Fix awscli to have a fallback method
2022-02-01 17:29:22 -06:00
Marcus Young 2c8611c5b0 Fix awscli to have a fallback method 2022-02-01 16:51:34 -06:00
myoung34andGitHub 783f219932 Merge pull request #180 from MrKevinWeiss/pr/fix/readmesystemd
fix(README.md): Fix the service example
2022-01-30 21:22:17 -06:00
myoung34andGitHub ba2f46a524 Merge pull request #182 from wildone/master
Update readme
2022-01-30 21:14:58 -06:00
Max BarrassandGitHub 7dae856b52 Update README.md 2022-01-31 12:55:36 +11:00
Max BarrassandGitHub bbac066934 Update README.md 2022-01-31 12:54:09 +11:00
Marcus Young 75e6e523a6 [Automated 🤖 ] Bump to version 2.287.1 2022-01-27 15:28:54 -06:00
Kevin "Tristate Tom" WeissandGitHub 7881135a1a fix(README.md): Fix the service example
I was able to get everything up and running and it looks good aside from a small gotcha.

While setting up an ephemeral systemd service it seemed that I still needed to mount the `/var/run/docker.sock`.

I am a pretty big fan of copy pasta and this may save a few google queries for "cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?"

I guess some issue with docker in docker.

Anyways, just wondering if it would be useful, no need to merge if it doesn't make sense.
2022-01-27 20:41:36 +01:00
Marcus Young b3b35f4a44 [Automated 🤖 ] Bump to version 2.287.0 2022-01-27 10:47:28 -06:00
myoung34andGitHub ddb748c2c4 Merge pull request #178 from MrKevinWeiss/pr/fix/oncedep
fix(ephemeral-runner): Replace once with ephemeral
2022-01-26 11:14:26 -06:00
Kevin "Tristate Tom" WeissandGitHub d46589c2c9 fix(ephemeral-runner): Replace once with ephemeral
When running the `ephemeral-runner.sh` there is a deprecation warning.
Better to solve it sooner than later...
```
Warning: '--once' is going to be deprecated in the future, please consider using '--ephemeral' during runner registration.
```
2022-01-26 14:45:09 +01:00
myoung34andGitHub 20afe92018 Merge pull request #177 from lauripiispanen/master
Update AWS CLI to v2
2022-01-24 15:38:48 -06:00
Lauri Piispanen 31c719a53e install AWS CLI v2 directly from AWS 2022-01-24 23:30:30 +02:00
Marcus Young 8810c62144 Fall back to stable repo for git 1.33 failed dependency on git-man 1.34 on bionic/bullseye non-amd64 2022-01-23 10:10:06 -06:00
Marcus Young a9269b40d3 Deprecate debian buster support. Its wildly terrible on packaging currently 2022-01-20 09:15:47 -06:00
Marcus Young f9a9d2e9f8 Hotfix: fix PPA for debian 2022-01-20 09:00:05 -06:00
Marcus Young e2bc04b98d Fix gpg key add ordering 2022-01-19 15:02:52 -06:00
Marcus Young d63b95e11a Add GPG key for git-core ppa 2022-01-19 15:00:13 -06:00
myoung34andGitHub 522edf977c Merge pull request #174 from myoung34/git_ppa
Use git-core PPA for git
2022-01-19 14:55:59 -06:00
Marcus Young 1fce1c1693 Use git-core PPA for git 2022-01-19 14:55:14 -06:00
myoung34andGitHub 3c45869076 Merge pull request #168 from myoung34/liblttng
Fix liblttng-ust[0-1]
2022-01-19 08:19:27 -06:00
Marcus Young 3267910888 Add temporary workaround 2022-01-19 08:18:44 -06:00
Marcus Young 179c64b117 Fix liblttng-ust[0-1] 2022-01-03 21:22:01 -06:00
8 changed files with 49 additions and 37 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
release: [buster, bullseye, sid]
release: [bullseye, sid]
fail-fast: false
steps:
- name: Copy Repo Files
+2 -2
View File
@@ -64,7 +64,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
release: [buster, bullseye, sid]
release: [bullseye, sid]
fail-fast: false
steps:
- name: Copy Repo Files
@@ -88,4 +88,4 @@ jobs:
max_attempts: 3
retry_on: error
timeout_minutes: 120
command: docker buildx build -f Dockerfile.debian-${{ matrix.release }} -t ${ORG}/github-runner:debian-${{ matrix.release }} --output "type=image,push=true" --platform linux/amd64,linux/arm64,linux/arm/v7 .
command: docker buildx build -f Dockerfile.debian-${{ matrix.release }} -t ${ORG}/github-runner:debian-${{ matrix.release }} --output "type=image,push=true" --platform linux/amd64,linux/arm64,linux/arm/v7 .
+1 -1
View File
@@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
release: [buster, bullseye, sid]
release: [bullseye, sid]
fail-fast: false
needs: create-release
steps:
+4 -1
View File
@@ -5,7 +5,7 @@ LABEL maintainer="myoung34@my.apsu.edu"
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir -p /opt/hostedtoolcache
ARG GH_RUNNER_VERSION="2.286.1"
ARG GH_RUNNER_VERSION="2.289.2"
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -13,7 +13,10 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /actions-runner
COPY install_actions.sh /actions-runner
# TODO: remove this terrible sed once
# https://github.com/actions/runner/pull/1585 is merged or similar
RUN chmod +x /actions-runner/install_actions.sh \
&& sed -i.bak 's/.\/bin\/installdependencies.sh/wget https:\/\/raw.githubusercontent.com\/myoung34\/runner\/main\/src\/Misc\/layoutbin\/installdependencies.sh -O .\/bin\/installdependencies.sh; bash .\/bin\/installdependencies.sh/g' /actions-runner/install_actions.sh \
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \
&& rm /actions-runner/install_actions.sh
+14 -21
View File
@@ -1,13 +1,8 @@
FROM ubuntu:focal
LABEL maintainer="myoung34@my.apsu.edu"
# TODO: Ubuntu focal (20.04) has git v2.25, but the minimum needed for GitHub
# Actions runners is v2.29. For now, we build git from source. When updating
# to hirsute (21.04) or later, we can remove the instructions to build from
# source in favor of the regular Ubuntu git package.
ARG GIT_VERSION="2.29.0"
ARG DUMB_INIT_VERSION="1.2.2"
ARG GIT_CORE_PPA_KEY="A1715D88E1DF1F24"
ARG DOCKER_KEY="7EA0A9C3F273FCD8"
ENV DOCKER_COMPOSE_VERSION="1.27.4"
@@ -16,11 +11,13 @@ ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3003,DL4001
# hadolint ignore=DL3003,DL4001,SC2086
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
&& apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${GIT_CORE_PPA_KEY} \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
awscli \
curl \
tar \
unzip \
@@ -28,13 +25,11 @@ RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
ca-certificates \
sudo \
gpg-agent \
gnupg \
software-properties-common \
build-essential \
zlib1g-dev \
zstd \
gettext \
liblttng-ust0 \
libcurl4-openssl-dev \
inetutils-ping \
jq \
@@ -43,18 +38,16 @@ RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
openssh-client \
locales \
python3-pip \
python \
python3-setuptools \
python3 \
dumb-init \
&& pip3 install --no-cache-dir awscliv2 \
&& c_rehash \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
&& sed -e 's/Defaults.*env_reset/Defaults env_keep = "HTTP_PROXY HTTPS_PROXY NO_PROXY FTP_PROXY http_proxy https_proxy no_proxy ftp_proxy"/' -i /etc/sudoers \
&& echo deb http://ppa.launchpad.net/git-core/ppa/ubuntu $([[ $(grep -E '^ID=' /etc/os-release | sed 's/.*=//g') == "ubuntu" ]] && (grep VERSION_CODENAME /etc/os-release | sed 's/.*=//g') || echo bionic) main>/etc/apt/sources.list.d/git-core.list \
&& apt-get update \
&& ( apt-get install -y --no-install-recommends git || apt-get install -t stable -y --no-install-recommends git || apt-get install -y --no-install-recommends git=1:2.33.1-0ppa1~ubuntu18.04.1 git-man=1:2.33.1-0ppa1~ubuntu18.04.1 ) \
&& ( [[ $(apt-cache search -n liblttng-ust0 | awk '{print $1}') == "liblttng-ust0" ]] && apt-get install -y --no-install-recommends liblttng-ust0 || : ) \
&& ( [[ $(apt-cache search -n liblttng-ust1 | awk '{print $1}') == "liblttng-ust1" ]] && apt-get install -y --no-install-recommends liblttng-ust1 || : ) \
&& ( ( curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && unzip awscliv2.zip -d /tmp/ && /tmp/aws/install ) || pip3 install awscli ) \
# Determine the Distro name (Debian, Ubuntu, etc)
&& distro=$(lsb_release -is | awk '{print tolower($0)}') \
# Determine the Distro version (bullseye, xenial, etc)
+22 -9
View File
@@ -5,12 +5,15 @@ Docker Github Actions Runner
This will run the [new self-hosted github actions runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/hosting-your-own-runners).
## Quick start for self-hosted runners for Organisations
1. Make sure you have a `self-hosted` group in your org. Create or rename default in `https://github.com/organizations/<your org>/settings/actions/runner-groups`.
2. Create PAT for account that will have access to the org in settings https://github.com/settings/tokens
3. Create a directory `/tmp/github-runner-your-repo` on the docker host and run [Manual Org Runner](#manual-org-runner), change dir if you want perm location.
4. Check docker logs to ensure runner has connected.
## Notes ##
### Auto Update Issues ###
There is a [known issue with auto updates in docker](https://github.com/actions/runner/issues/246). If one is running a version that has an update it will try to auto update and fail. The only current workaround is to run `latest` which in theory is always up to date and wont update/throttle.
### Docker Support ###
Please note that while this runner installs and allows docker, github actions itself does not support using docker from a self hosted runner yet.
@@ -32,7 +35,7 @@ A workaround exists, please see [here](https://github.com/myoung34/docker-github
| --- | --- | --- | --- | --- | --- |
| ubuntu focal | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+/` | [latest](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=latest) | This is the latest build (Rebuilt nightly and on master merges). Tags without an OS name are included. | Tags without an OS name *before* 9/17/2020 are `eoan`. `armv7` support stopped 9/18/2020 due to inconsistent docker-ce packaging |
| ubuntu bionic | `x86_64`,`armv7`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-bionic/` | [ubuntu-bionic](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-bionic) | This is the latest build from bionic (Rebuilt nightly and on master merges). Tags with `-ubuntu-bionic` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian buster | `x86_64`,`arm64`,`armv7` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | This is the latest build from buster (Rebuilt nightly and on master merges). Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Buster is Debians current old-stable release. |
| debian buster (now deprecated) | `x86_64`,`arm64`,`armv7` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | Debian buster is now deprecated. The packages for arm v7 are in flux and are wildly causing build failures (git as well as apt-key and liblttng-ust#. Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Buster is Debians current old-stable release. |
| debian bullseye | `x86_64`,`arm64`,`armv7` | `/\d\.\d{3}\.\d+-debian-bullseye/` | [debian-bullseye](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-bullseye) | This is the latest build from bullseye (Rebuilt nightly and on master merges). Tags with `-debian-bullseye` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Bullseye is Debians current stable release. |
| debian sid | `x86_64`,`arm64`,`admv7` | `/\d\.\d{3}\.\d+-debian-sid/` | [debian-sid](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-sid) | This is the latest build from sid (Rebuilt nightly and on master merges). Tags with `-debian-sid` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Sid is considered unstable by Debian. |
| ubuntu xenial | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-xenial/` | [ubuntu-xenial](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-xenial) | This is the latest build from xenial (Rebuilt nightly and on master merges). Tags with `-ubuntu-xenial` are included and created on [upstream tags](https://github.com/actions/runner/tags). | This is deprecated as of 7/15/2021 and will no longer receive tags. |
@@ -58,6 +61,7 @@ These containers are built via Github actions that [copy the dockerfile](https:/
| `DISABLE_AUTOMATIC_DEREGISTRATION` | Optional flag to disable signal catching for deregistration. Default is `false`. Any value other than exactly `false` is considered `true`. See [here](https://github.com/myoung34/docker-github-actions-runner/issues/94) |
| `CONFIGURED_ACTIONS_RUNNER_FILES_DIR` | Path to use for runner data. It allows avoiding reregistration each the start of the runner. No default value. |
| `EPHEMERAL` | Optional flag to configure runner with [`--ephemeral` option](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling). Ephemeral runners are suitable for autoscaling. |
| `DISABLE_AUTO_UPDATE` | Optional environment variable to [disable auto updates](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/). Auto updates are enabled by default to preserve past behavior. Any value is considered truthy and will disable them. |
## Examples ##
@@ -65,22 +69,26 @@ These containers are built via Github actions that [copy the dockerfile](https:/
If you're using a RHEL based OS with SELinux, add `--security-opt=label=disable` to prevent [permission denied](https://github.com/myoung34/docker-github-actions-runner/issues/9)
### Manual ###
### Manual Org Runner ###
```shell
# org runner
docker run -d --restart always --name github-runner \
-e RUNNER_NAME_PREFIX="myrunner" \
-e ACCESS_TOKEN="footoken" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-e RUNNER_GROUP="my-group" \
-e RUNNER_SCOPE="org" \
-e DISABLE_AUTO_UPDATE="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
# per repo
```
### Manual per Repo Runner ###
```
docker run -d --restart always --name github-runner \
-e REPO_URL="https://github.com/myoung34/repo" \
-e RUNNER_NAME="foo-runner" \
@@ -356,7 +364,12 @@ Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=-/usr/bin/docker pull myoung34/github-runner:latest
ExecStart=/usr/bin/docker run --rm --env-file /etc/ephemeral-github-actions-runner.env --name %n myoung34/github-runner:latest /ephemeral-runner.sh
ExecStart=/usr/bin/docker run --rm \
--env-file /etc/ephemeral-github-actions-runner.env \
-v /var/run/docker.sock:/var/run/docker.sock \
--name %n myoung34/github-runner:latest \
/ephemeral-runner.sh
[Install]
WantedBy=multi-user.target
+4 -1
View File
@@ -115,5 +115,8 @@ if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
fi
extra_flags=""
[[ -n "$DISABLE_AUTO_UPDATE" ]] && extra_flags="--disableupdate" || :
# Container's command (CMD) execution
"$@"
"$@" "${extra_flags}"
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash
echo "*** Starting ephemeral runner. ***"
/actions-runner/run.sh --once
/actions-runner/run.sh --ephemeral
rv=$?
# See exit code constants in the runner source here: