From 114f813c594ff960ff8221f3ec1e4b55661d2890 Mon Sep 17 00:00:00 2001 From: "James (Anh-Tu) Nguyen" Date: Fri, 24 Dec 2021 09:56:29 +0700 Subject: [PATCH] BDRK-3516: Add GitHub Runners custom Docker image (#48) * BDRK-3516: Add GitHub Runners custom Docker image * Test Docker build job * Update other tools in managed-images * Remove custom branch --- .github/workflows/build_docker.yaml | 11 ++++++-- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- dockerfiles/actions-runner-dind/Dockerfile | 26 +++++++++++++++++++ dockerfiles/actions-runner-dind/README.md | 5 ++++ dockerfiles/actions-runner/Dockerfile | 26 +++++++++++++++++++ dockerfiles/actions-runner/README.md | 5 ++++ dockerfiles/consul-backup-gcs/Dockerfile | 6 ++--- dockerfiles/eks-container-insights/Dockerfile | 4 +-- dockerfiles/fluentd/Dockerfile | 6 ++--- 10 files changed, 81 insertions(+), 12 deletions(-) create mode 100644 dockerfiles/actions-runner-dind/Dockerfile create mode 100644 dockerfiles/actions-runner-dind/README.md create mode 100644 dockerfiles/actions-runner/Dockerfile create mode 100644 dockerfiles/actions-runner/README.md diff --git a/.github/workflows/build_docker.yaml b/.github/workflows/build_docker.yaml index bdb6e67..87e9a57 100644 --- a/.github/workflows/build_docker.yaml +++ b/.github/workflows/build_docker.yaml @@ -1,5 +1,7 @@ name: Build Docker images on: + pull_request: + types: [opened, ready_for_review, reopened, synchronize] push: branches: - master @@ -10,10 +12,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: [self-hosted, docker, integration] strategy: matrix: - repo: ["consul-backup-gcs", "eks-container-insights", "fluentd"] + repo: + - consul-backup-gcs + - eks-container-insights + - fluentd + - actions-runner + - actions-runner-dind steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e6fc9ce..58e525c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ on: jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: [self-hosted, docker, integration] env: TEST_IMAGE: "quay.io/helmpack/chart-testing:v3.0.0" BATS_IMAGE: "basisai/bats-helm:v1.2.1" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bff686b..c8295f0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: jobs: release: - runs-on: ubuntu-latest + runs-on: [self-hosted, docker, integration] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/dockerfiles/actions-runner-dind/Dockerfile b/dockerfiles/actions-runner-dind/Dockerfile new file mode 100644 index 0000000..57225ff --- /dev/null +++ b/dockerfiles/actions-runner-dind/Dockerfile @@ -0,0 +1,26 @@ +FROM summerwind/actions-runner-dind:v2.286.0-ubuntu-20.04 + +USER root + +ENV SKOPEO_VERSION 100:1.3.0-1 +ENV YQ_VERSION v4.16.2 + +RUN mkdir -p /tmp/aws \ + && cd /tmp/aws \ + && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ + && unzip awscliv2.zip \ + && ./aws/install \ + && rm -rf /tmp/aws + +RUN . /etc/os-release \ + && echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" \ + | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \ + && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key \ + | apt-key add - \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install skopeo=${SKOPEO_VERSION} \ + && wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 \ + && chmod +x /usr/local/bin/yq \ + && rm -rf /var/lib/apt/lists/* + +USER runner diff --git a/dockerfiles/actions-runner-dind/README.md b/dockerfiles/actions-runner-dind/README.md new file mode 100644 index 0000000..eb25e0b --- /dev/null +++ b/dockerfiles/actions-runner-dind/README.md @@ -0,0 +1,5 @@ +## Custom Docker image for GitHub Actions Runner Docker-In-Docker (dind) + +This Docker image based off the the [actions-runner-dind image](https://github.com/actions-runner-controller/actions-runner-controller/blob/master/runner/Dockerfile.dindrunner) with `skopeo`, `yq` and `awscli` installed. + +It is built and published to [`quay.io/basisai/actions-runner-dind`](https://quay.io/repository/basisai/actions-runner-dind). diff --git a/dockerfiles/actions-runner/Dockerfile b/dockerfiles/actions-runner/Dockerfile new file mode 100644 index 0000000..b7fe49d --- /dev/null +++ b/dockerfiles/actions-runner/Dockerfile @@ -0,0 +1,26 @@ +FROM summerwind/actions-runner:v2.286.0-ubuntu-20.04 + +USER root + +ENV SKOPEO_VERSION 100:1.3.0-1 +ENV YQ_VERSION v4.16.2 + +RUN mkdir -p /tmp/aws \ + && cd /tmp/aws \ + && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ + && unzip awscliv2.zip \ + && ./aws/install \ + && rm -rf /tmp/aws + +RUN . /etc/os-release \ + && echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" \ + | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \ + && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key \ + | apt-key add - \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install skopeo=${SKOPEO_VERSION} \ + && wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 \ + && chmod +x /usr/local/bin/yq \ + && rm -rf /var/lib/apt/lists/* + +USER runner diff --git a/dockerfiles/actions-runner/README.md b/dockerfiles/actions-runner/README.md new file mode 100644 index 0000000..e5608d2 --- /dev/null +++ b/dockerfiles/actions-runner/README.md @@ -0,0 +1,5 @@ +## Custom Docker image for GitHub Actions Runner + +This Docker image based off the the [actions-runner image](https://github.com/actions-runner-controller/actions-runner-controller/blob/master/runner/Dockerfile) with `skopeo`, `yq` and `awscli` installed. + +It is built and published to [`quay.io/basisai/actions-runner`](https://quay.io/repository/basisai/actions-runner). diff --git a/dockerfiles/consul-backup-gcs/Dockerfile b/dockerfiles/consul-backup-gcs/Dockerfile index 68ff844..ec1337f 100644 --- a/dockerfiles/consul-backup-gcs/Dockerfile +++ b/dockerfiles/consul-backup-gcs/Dockerfile @@ -1,7 +1,7 @@ -FROM google/cloud-sdk:355.0.0 +FROM google/cloud-sdk:367.0.0 -ARG ansible_version=2.9.25 -ARG consul_version=1.10.2 +ARG ansible_version=2.9.27 +ARG consul_version=1.11.1 RUN set -xe \ && apt-get update \ diff --git a/dockerfiles/eks-container-insights/Dockerfile b/dockerfiles/eks-container-insights/Dockerfile index 73c2f8b..dcfe6d0 100644 --- a/dockerfiles/eks-container-insights/Dockerfile +++ b/dockerfiles/eks-container-insights/Dockerfile @@ -1,3 +1,3 @@ -FROM fluent/fluentd-kubernetes-daemonset:v1.13.3-debian-cloudwatch-amd64-1.2 +FROM fluent/fluentd-kubernetes-daemonset:v1.14.3-debian-cloudwatch-amd64-1.0 -RUN gem install fluent-plugin-s3 -v 1.6.0 --no-document +RUN gem install fluent-plugin-s3 -v 1.6.1 --no-document diff --git a/dockerfiles/fluentd/Dockerfile b/dockerfiles/fluentd/Dockerfile index 1c7a8bf..85404d2 100644 --- a/dockerfiles/fluentd/Dockerfile +++ b/dockerfiles/fluentd/Dockerfile @@ -1,5 +1,5 @@ -FROM quay.io/fluentd_elasticsearch/fluentd:v3.2.0 +FROM quay.io/fluentd_elasticsearch/fluentd:v3.3.0 -RUN fluent-gem install digest-crc --version 0.5.1 --no-document \ +RUN fluent-gem install digest-crc --version 0.6.4 --no-document \ && fluent-gem install fluent-plugin-gcs --version 0.4.1 --no-document \ - && fluent-gem install fluent-plugin-s3 --version 1.6.0 --no-document + && fluent-gem install fluent-plugin-s3 --version 1.6.1 --no-document