From 297847cf8dc7eeac6a946706c557debf65d151a8 Mon Sep 17 00:00:00 2001 From: BogDrakonov <114093152+BogDrakonov@users.noreply.github.com> Date: Sun, 12 Nov 2023 19:27:50 -0500 Subject: [PATCH] Initial Release (#1) --- .github/CODEOWNERS | 1 + .github/workflows/merge.yml | 29 ++++ .github/workflows/pre-commit.yml | 16 ++ .github/workflows/tag.yml | 32 ++++ .gitignore | 251 +++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 6 + Dockerfile | 18 +++ README.md | 22 +++ 8 files changed, 375 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/merge.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .github/workflows/tag.yml create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 Dockerfile create mode 100644 README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..e1bfe15 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @valorem-labs-inc/devops diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..c0d4d5b --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,29 @@ +name: 'Deploy container to latest tag' + +on: + push: + branches: + - main + +jobs: + build-latest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the container to GitHub Container Registry using the latest tag + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/arm64 + tags: ghcr.io/valorem-labs-inc/ubuntu-actions-runner:latest + push: true diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..a933f07 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +name: 'Validate Repo' + +on: pull_request + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + - name: Install pylint + run: pip install pylint + - name: Run pre-commit + uses: pre-commit/action@v2.0.0 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..bc8e879 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,32 @@ +name: 'Deploy container to named tag' + +on: + push: + tags: + - '*.*.*' + +jobs: + build-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Extract tag name + id: extract_tag + run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the container to GitHub Container Registry using the repo tag + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/arm64 + tags: ghcr.io/valorem-labs-inc/ubuntu-actions-runner:${{ steps.extract_tag.outputs.tag }} + push: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90699fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,251 @@ +################ +## Sublime Text +################ + +*.sublime-workspace + +################# +## JetBrain IDEs +################# + +## Directory-based project format +.idea/ +# if you remove the above rule, at least ignore user-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# and these sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml + +## File-based project format +*.ipr +*.iml +*.iws + +## Additional for IntelliJ +out/ + +# generated by mpeltonen/sbt-idea plugin +.idea_modules/ + +# generated by JIRA plugin +atlassian-ide-plugin.xml + +# generated by Crashlytics plugin (for Android Studio and Intellij) +com_crashlytics_export_strings.xml + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############### +## Common Keys +############### + +# Ansible vault key +vault.key + +#################### +## Windows detritus +#################### + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +################ +## Mac detritus +################ + +.DS_Store + +################# +## Chef detritus +################# + +# Berkshelf +.vagrant +/cookbooks +Berksfile.lock + +# Bundler +Gemfile.lock +bin/* +.bundle/* + +.kitchen/ +.kitchen.local.yml + +#################### +## Ansible detritus +#################### + +#Retry files +*.retry + +###################### +## Terraform detritus +###################### + +# Local Terraform states +.terraform/ + + +#################### +## Generic detritus +#################### + +*~ +*# +.#* +\#*# +.*.sw[a-z] +*.un~ +pkg/ + +#################### +## Pytohn detritus +#################### + +# Virtual environments +pyenv/ +venv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2b8b597 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.3.0 + hooks: + - id: end-of-file-fixer + - id: check-added-large-files diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8bc2bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ghcr.io/actions/actions-runner:latest + +# Run our installations as root +USER root + +# Install the core of the system +RUN apt-get update +# Core runner packages +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends vim curl wget dnsutils telnet iputils-ping bzip2 curl g++ gcc git make jq tar unzip wget autoconf automake dbus dnsutils dpkg dpkg-dev fakeroot fonts-noto-color-emoji gnupg2 imagemagick iproute2 iputils-ping libc++abi-dev libc++-dev libc6-dev libcurl4 libgbm-dev libgconf-2-4 libgsl-dev libgtk-3-0 libmagic-dev libmagickcore-dev libmagickwand-dev libsecret-1-dev libsqlite3-dev libyaml-dev libtool libunwind8 libxkbfile-dev libxss1 libssl-dev locales mercurial openssh-client p7zip-rar pkg-config python-is-python3 rpm texinfo tk tzdata upx xorriso xvfb xz-utils zsync acl aria2 binutils bison brotli coreutils file flex ftp haveged lz4 m4 mediainfo netcat net-tools p7zip-full parallel pass patchelf pigz pollinate rsync shellcheck sphinxsearch sqlite3 ssh sshpass subversion sudo swig telnet time zip + +# Our packages (Future use) +#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y + +# Cleanup apt to keep image size down +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Switch back to the runner user for launch +USER runner diff --git a/README.md b/README.md new file mode 100644 index 0000000..18cd271 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +Custom Ubuntu Actions Runner Container +====================================== +This container contains our custom GitHub Actions environment for building our projects in Kubernetes via [GitHub Actions Runner Controller](https://github.com/actions/actions-runner-controller) + +Container Tools +--------------- +The various tools installed in this repo: + +1. TODO + +Architectures +------------- +This container is available for `linux/arm64` + +Availability +------------ +All `linux/arm64` versions from 1.0.0 onward are publicly available on [GitHub Container Registry](https://github.com/orgs/valorem-labs-inc/packages?repo_name=ubuntu-actions-runner) + +Maintainers +---------- +1. [BogDrakonov](https://www.bogdrakonov.com) +2. [Alcibiades](https://alcibiades.capital/)