Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
version: "3"
build:
steps:
- type: apt-get
name: Install Pre-requisites
packages: ["libc6", "libgcc1", "libgssapi-krb5-2", "libicu70", "liblttng-ust1", "libssl3", "libstdc++6", "libunwind8", "zlib1g"]
- type: apt-get
packages: ["dotnet-sdk-8.0", "aspnetcore-runtime-8.0"]
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
wget https://gitlab.com/gitlab-org/cli/-/releases/v1.41.0/downloads/glab_1.41.0_Linux_x86_64.deb
sudo dpkg -i glab_1.41.0_Linux_x86_64.deb
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["gcc"]
version: "3"
build:
steps:
- type: apt-get
packages: ["g++"]
version: "3"
build:
steps:
- type: apt-get
packages: ["wget", "unzip"]
- type: command
command: |
wget https://storage.googleapis.com/dart-archive/channels/stable/release/3.4.3/sdk/dartsdk-linux-x64-release.zip
unzip -d /usr/local/dart dartsdk-linux-x64-release.zip
rm -rf dartsdk-linux-x64-release.zip
echo 'export PATH=$PATH:/usr/local/dart/dart-sdk/bin' | tee -a /etc/profile.d/dart-installation.sh
chmod +x /etc/profile.d/dart-installation.sh
user: root
version: "3"
build:
steps:
- type: apt-get
packages: ["wget"]
- type: command
command: |
# detect architecture
ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
GO_ARCH="amd64"
elif [ "$ARCH" == "aarch64" ]; then
GO_ARCH="arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
GO_VERSION="1.22.2"
# download and install Go
wget https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
rm -rf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
# environment variables for DX
echo 'export GOPATH=/home/devzero/go' | tee /etc/profile.d/go-installation.sh
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' | tee -a /etc/profile.d/go-installation.sh
user: root
version: "3"
build:
steps:
- type: apt-get
packages: ["build-essential", "curl", "git", "nano", "software-properties-common", "ssh", "sudo", "tar", "unzip", "vim", "wget", "zip"]
- type: command
command: |
sudo apt update
sudo apt upgrade -y
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true TZ=Etc/UTC sudo -E apt install php -y
sudo apt install php-mysql php-curl php-json php-cgi php-cli php-xml php-gd php-mbstring php-zip -y
sudo apt install libapache2-mod-php -y
directory: /home/devzero
user: devzero
These steps will allow you to create a workspace with all of the GitHub Actions required packages and binaries for a self-hosted runner
See DevZero's GitHub Actions docs for usage.
version: "3"
build:
steps:
- type: apt-get
packages: ["build-essential", "curl", "git", "nano", "software-properties-common", "ssh", "sudo", "tar", "unzip", "vim", "wget", "zip", "jq"]
- type: command
command: |
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64-2.317.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-linux-x64-2.317.0.tar.gz
tar xzf ./actions-runner-linux-x64-2.317.0.tar.gz
launch:
environment:
- name: OWNER
value: "INSERT-YOUR-GITHUB-ORG-NAME"
- name: REPO
value: "INSERT-YOUR-REPO-NAME"
- name: GITHUB_PAT
value: '***'
steps:
- type: command
command: |
cd actions-runner && ./config.sh --unattended --url https://github.com/${OWNER}/${REPO} --token $(curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer "${GITHUB_PAT}"" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/runners/registration-token | jq -r '.token')
- type: command
command: |
cd actions-runner && sudo ./svc.sh install
cd actions-runner && sudo ./svc.sh start
The Actions Runner Controller directions are in beta and running tests which require Docker aren't supported yet
Adjust the INSTALLATION_NAME
, NAMESPACE
, GITHUB_CONFIG_URL
, and GITHUB_PAT
variables as needed.
version: "3"
build:
steps:
- type: apt-get
packages: ["build-essential", "curl", "git", "nano", "software-properties-common", "ssh", "sudo", "tar", "unzip", "vim", "wget", "zip"]
- type: command
command: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && rm kubectl
directory: /home/devzero
user: devzero
- type: command
command: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
launch:
environment:
- name: INSTALLATION_NAME
value: "dz-arc-controller"
- name: NAMESPACE
value: "dz-arc-systems"
- name: GITHUB_CONFIG_URL
value: "org/repo"
- name: GITHUB_PAT
value: '***'
steps:
- type: command
command: |
helm install arc \
--namespace "${NAMESPACE}" \
--create-namespace \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
- type: command
command: |
helm install "${INSTALLATION_NAME}" \
--namespace "${NAMESPACE}" \
--create-namespace \
--set githubConfigUrl="${GITHUB_CONFIG_URL}" \
--set githubConfigSecret.github_token="${GITHUB_PAT}" \
--set containerMode.type="kubernetes" \
--set containerMode.kubernetesModeWorkVolumeClaim.accessModes={"ReadWriteOnce"} \
--set containerMode.kubernetesModeWorkVolumeClaim.storageClassName=gp2 \
--set containerMode.kubernetesModeWorkVolumeClaim.resources.requests.storage=1Gi \
--set template.spec.securityContext.fsGroup=1001 \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
curl -s "https://get.sdkman.io" | bash
. "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java
version: "3"
build:
steps:
- type: apt-get
packages: ["autoconf", "build-essential", "curl", "git", "libdb-dev", "libffi-dev", "libgdbm-dev", "libmysqlclient-dev", "libncurses5-dev", "libpq-dev", "libreadline6-dev", "libsqlite3-dev", "libssl-dev", "libxml2-dev", "libxslt1-dev", "libyaml-dev", "patch", "procps", "tar", "unzip", "zlib1g-dev"]
- type: command
command: |
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
eval "$(~/.rbenv/bin/rbenv init - bash)" && export PATH="$HOME/.rbenv/bin:$PATH"
rbenv install 3.3.1
rbenv global 3.3.1
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' | sudo tee /etc/profile.d/ruby-installation.sh
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' | sudo tee -a /etc/profile.d/ruby-installation.sh
sudo chmod +x /etc/profile.d/ruby-installation.sh
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "libssl-dev", "pkg-config"]
- type: command
command: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
. $HOME/.cargo/env
rustup install 1.80.0
rustup default 1.80.0
To automatically enter a virtualenv
when you connect to a workspace, configure your .bashrc
file (see the last build step in the recipe below):
version: "3"
build:
steps:
- type: apt-get
packages: ["libpq-dev", "libpython3.8-dev", "python3.8", "python3.8-venv", "software-properties-common"]
extra_repositories:
- repository: ppa:deadsnakes/ppa
- type: command
command: |
python3.8 -m venv venv
. venv/bin/activate
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
python get-pip.py
rm get-pip.py
directory: /home/devzero
- type: command
command: |
python3.8 -m venv venv
echo "source /home/devzero/venv/bin/activate" >> /home/devzero/.bashrc
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "unzip", "tar"]
- type: command
command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR=$HOME/.nvm && [ -s $NVM_DIR/nvm.sh ] && \. $NVM_DIR/nvm.sh
nvm install 21.0.0
echo '. $HOME/.nvm/nvm.sh' >> $HOME/.bashrc
echo '. $HOME/.nvm/nvm.sh' >> $HOME/.zshrc
npm install --global yarn
version: "3"
build:
steps:
- type: apt-get
packages: ["libpq-dev", "libpython3.8-dev", "python3.8", "python3.8-venv", "software-properties-common"]
extra_repositories:
- repository: ppa:deadsnakes/ppa
- type: command
command: |
python3.8 -m venv venv
. venv/bin/activate
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
python get-pip.py
rm get-pip.py
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "tar", "unzip", "wget"]
- type: apt-get
packages: ["mongodb-org"]
extra_repositories:
- key_url: https://www.mongodb.org/static/pgp/server-7.0.asc
repository: https://repo.mongodb.org/apt/ubuntu
components: ["multiverse"]
distribution: "jammy/mongodb-org/7.0"
- type: command
name: "mongosh"
command: |
VERSION=2.2.12
wget https://downloads.mongodb.com/compass/mongosh-$VERSION-linux-x64.tgz
tar -zxvf mongosh-$VERSION-linux-x64.tgz
sudo cp mongosh-$VERSION-linux-x64/bin/mongosh /usr/local/bin/
rm -rf mongosh-$VERSION-linux-x64*
- type: command
name: "mongodb tools"
command: |
VERSION=100.9.5
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-$VERSION.tgz
tar -zxvf mongodb-database-tools-ubuntu2204-x86_64-$VERSION.tgz
sudo cp mongodb-database-tools-ubuntu2204-x86_64-$VERSION/bin/* /usr/local/bin/
rm -rf mongodb-database-tools-ubuntu2204-x86_64-$VERSION*
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |-
curl -fsSL https://get.pulumi.com | sh
echo 'export PATH=$PATH:/home/devzero/.pulumi/bin' | sudo tee /etc/profile.d/151-pulumi-installation.sh
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "gnupg", "software-properties-common", "terraform"]
extra_repositories:
- key_url: https://apt.releases.hashicorp.com/gpg
repository: https://apt.releases.hashicorp.com
components: ["main"]
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y curl unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf aws awscliv2.zip
version: "3"
build:
steps:
- type: apt-get
packages: ["wget"]
- type: command
command: |
VERSION=0.8.0
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/$VERSION/linux-amd64/docker-credential-ecr-login
chmod +x docker-credential-ecr-login
sudo mv docker-credential-ecr-login /usr/local/bin
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y apt-transport-https ca-certificates gnupg curl
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get update && sudo apt-get install google-cloud-cli
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["wget"]
- type: command
command: |
sudo mkdir -p -m 755 /etc/apt/keyrings
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "gzip"]
- type: command
command: |
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.4.17/argo-linux-amd64.gz
gunzip argo-linux-amd64.gz
chmod +x argo-linux-amd64
mv ./argo-linux-amd64 /usr/local/bin/argo
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
rm kubectl
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/
rm skaffold
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["wget"]
- type: command
command: |
VERSION=v0.32.5
wget https://github.com/derailed/k9s/releases/download/$VERSION/k9s_Linux_amd64.tar.gz
mkdir k9s_Linux_amd64
tar -xvf k9s_Linux_amd64.tar.gz -C k9s_Linux_amd64
sudo mv k9s_Linux_amd64/k9s /usr/local/bin/
rm -rf k9s_Linux_amd64*
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "gnupg"]
extra_repositories:
- type: apt-get
packages: ["bazel"]
extra_repositories:
- key_url: https://bazel.build/bazel-release.pub.gpg
repository: https://storage.googleapis.com/bazel-apt
components:
- jdk1.8
distribution: stable
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "apt-transport-https", "ca-certificates"]
- type: apt-get
packages: ["docker-ce", "docker-ce-cli", "containerd.io"]
extra_repositories:
- key_url: https://download.docker.com/linux/ubuntu/gpg
repository: https://download.docker.com/linux/ubuntu
- type: command
command: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
usermod -aG docker devzero
systemctl enable docker.service
systemctl enable containerd.service
directory: /home/devzero
user: root
version: "3"
build:
steps:
- type: apt-get
packages: ["git"]
- type: command
command: |
git clone https://github.com/ahmetb/kubectx /usr/local/src
ln -s /usr/local/src/kubectx /usr/local/bin/kubectx
ln -s /usr/local/src/kubens /usr/local/bin/kubens
chmod +x /usr/local/bin/kubectx
chmod +x /usr/local/bin/kubens
user: root
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |-
sh <(curl -L https://nixos.org/nix/install) --no-daemon
. ~/.nix-profile/etc/profile.d/nix.sh
shell: /bin/bash -l {}
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["curl", "tar", "unzip"]
- type: apt-get
name: "postgres tools"
packages: ["postgresql-16"]
extra_repositories:
- key_url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
repository: http://apt.postgresql.org/pub/repos/apt
distribution: jammy-pgdg
components: ["main"]
- type: command
command: |
echo 'postgres ALL=NOPASSWD: ALL' | sudo tee /etc/sudoers.d/100-postgres
# Modify pg_hba.conf to allow trust authentication for devzero
echo "local all devzero trust" | sudo tee -a /etc/postgresql/16/main/pg_hba.conf
echo "host all devzero 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/16/main/pg_hba.conf
echo "host all devzero ::1/128 trust" | sudo tee -a /etc/postgresql/16/main/pg_hba.conf
directory: /home/devzero
user: root
launch:
steps:
- type: command
command: |
# create the devzero user
sudo -u postgres bash -c "psql -c \"CREATE USER devzero;\""
# create a devzero database
sudo -u postgres createdb devzero -O devzero
user: root
version: "3"
build:
steps:
- type: apt-get
packages: ["curl"]
- type: command
command: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
rm get_helm.sh
user: devzero
version: "3"
build:
steps:
- type: apt-get
packages: ["build-essential", "curl", "git", "nano", "software-properties-common", "ssh", "sudo", "tar", "unzip", "vim", "wget", "zip"]
- type: command
command: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && rm kubectl
directory: /home/devzero
user: devzero
- type: command
command: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
rm get_helm.sh
user: devzero
launch:
steps:
- type: command
command: |
helm install \
-n bazel-buildfarm \
--create-namespace \
bazel-buildfarm \
oci://ghcr.io/bazelbuild/buildfarm \
--version "0.2.4"
- type: command
command: |
kubectl port-forward service/bazel-buildfarm-server -n bazel-buildfarm 8980:8980 --address 0.0.0.0 &