https://github.com/angrymaciek/angry-runner

Docker image recipe for a self-hosted GitHub Actions runner / development environment

https://github.com/angrymaciek/angry-runner

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

ci containers devcontainer docker github-actions github-codespaces
Last synced: 5 months ago · JSON representation

Repository

Docker image recipe for a self-hosted GitHub Actions runner / development environment

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 9
Topics
ci containers devcontainer docker github-actions github-codespaces
Created almost 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Codeowners Security

README.md

build Docker CodeFactor GitHub license

Angry Runner (😠🏃‍♂️)

Delicious recipe for a Docker image suitable for: (1) self-hosted GitHub Actions runners, (2) local development environment as well as (3) GitHub codespaces base for the devcontainer mechanism.

Enjoy!

~AngryMaciek

Brief description

The base image here is the popular ubuntu:24:04 - that is to increase the similarity of the container system to users OSs; A few system tools come pre-installed: GNU Bash, Z shell, gcc & g++, Git, GNU Make, CMake, valgrind, Vim and most importantly - mambaforge, which has been set up for the (default) root user; port 8888 is exposed to the host machine; dir /workspace is available to mount a volume; an entrypoint script has been designed to add a new non-root linux user which can access conda via a system group; executing commands as angryuser is available through gosu; interactive login shell for that user is customised with my personal Prezto settings.

Useful references: * https://denibertovic.com/posts/handling-permissions-with-docker-volumes/ * https://askubuntu.com/questions/1457726/how-and-where-to-install-conda-to-be-accessible-to-all-users * https://www.fromlatest.io

Actions runner

In order to execute your CI job on a self-hosted runner in a Docker container please specify:

```yaml job:

runs-on: "self-hosted"
container:
  image: angrymaciek/angry-runner:latest
  options: --rm=true # cleanup
defaults:
  run:
    shell: bash # recognise source

steps:

  # Commands from the ci steps are executed in a non-interactive non-login shell;
  # conda is not initialised there thus every job step with a 'run' directive
  # needs to start with loading conda.
  # PS. base env is not activated automatically
  - name: info
    run: |
      source /mambaforge/etc/profile.d/conda.sh
      conda activate base
      conda info -a

```

Local development

(Provided you have a Docker engine installed and set up)

In order to build a container please clone this repository and execute docker build:

bash cd $HOME git clone https://github.com/AngryMaciek/angry-runner.git docker build -f angry-runner/Dockerfile -t angrymaciek/angry-runner:latest angry-runner

Alternatively to building yourself you can pull the container from the DockerHub:

bash docker pull angrymaciek/angry-runner:latest

Run the container with:

bash docker run --name angry-runner -e HOSTUID=`id -u $USER` -p 8888:8888 -it -v $HOME:/workspace angrymaciek/angry-runner:latest

Recall that all data generated inside the container (with the exception of the mounted volume) are not persistent.
If you'd like your data don't perish into oblivion after you stop the container check out Docker documentation on storage mechanisms. In the example above my whole home directory is mounted as the volume. This may, of course, be adjusted.

Watch out! Due to Docker's specifics commands above need to be executed as root user; alternatively, see here.

Codespaces (devcontainer)

The following repository is configured to push each new version of the image to my DockerHub. Feel free to use it as a base for your development container through the devcontainer mechanism; include these lines in your JSON:

json "image": "angrymaciek/angry-runner:latest", "postCreateCommand": "bash /bin/entrypoint.sh",

By default the container starts as root, though one may swiftly change to the developer shell with: gosu angryuser zsh. Watch out! Depending on the container set up tool it may turn out that the cloned repository does not have write permission set for others (as root is the owner). In such case one needs to run chmod 777 -R . before switching users.

Owner

  • Name: Maciek Bąk
  • Login: AngryMaciek
  • Kind: user
  • Location: London, UK
  • Company: City, University of London

PhD in Computational Biology

GitHub Events

Total
Last Year