forked from akvelon/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runner image and arc changes (apache#27118)
* runner image and arc changes * add state bucket comment in env file for reference * add readme for manual image push and sync beam environment --------- Co-authored-by: vdjerek <Vlado Djerek>
- Loading branch information
1 parent
a4203a3
commit 696e324
Showing
7 changed files
with
146 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
.github/gh-actions-self-hosted-runners/arc/images/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
|
||
FROM ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner:ubuntu-20.04 | ||
|
||
USER root | ||
#Install Node | ||
RUN curl -OL https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz && \ | ||
tar -C /usr/local -xf node-v18.16.0-linux-x64.tar.xz && \ | ||
rm node-v18.16.0-linux-x64.tar.xz && \ | ||
mv /usr/local/node-v18.16.0-linux-x64 /usr/local/node | ||
ENV PATH="${PATH}:/usr/local/node/bin" | ||
#Install Go | ||
ARG go_version=1.20.4 | ||
RUN curl -OL https://go.dev/dl/go${go_version}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go${go_version}.linux-amd64.tar.gz && \ | ||
rm go${go_version}.linux-amd64.tar.gz | ||
ENV PATH="${PATH}:/usr/local/go/bin" | ||
#Install Java | ||
RUN curl -OL https://cdn.azul.com/zulu/bin/zulu8.70.0.23-ca-jdk8.0.372-linux_x64.tar.gz && \ | ||
tar -C /usr/local -xzf zulu8.70.0.23-ca-jdk8.0.372-linux_x64.tar.gz && \ | ||
rm zulu8.70.0.23-ca-jdk8.0.372-linux_x64.tar.gz && \ | ||
mv /usr/local/zulu8.70.0.23-ca-jdk8.0.372-linux_x64 /usr/local/java | ||
ENV PATH="${PATH}:/usr/local/java/bin" | ||
#Install Gradle | ||
RUN curl -OL https://services.gradle.org/distributions/gradle-7.3.3-bin.zip && \ | ||
unzip gradle-7.3.3-bin.zip && \ | ||
rm gradle-7.3.3-bin.zip && \ | ||
mv gradle-7.3.3 /usr/local/gradle | ||
ENV PATH="${PATH}:/usr/local/gradle/bin" | ||
|
||
|
||
# Needed to transfer path addtitions to runner environment | ||
RUN echo PATH=$PATH >> /runnertmp/.env | ||
USER runner |
36 changes: 36 additions & 0 deletions
36
.github/gh-actions-self-hosted-runners/arc/images/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
# Manual build and push | ||
|
||
First set a tag you want to use: | ||
``` | ||
export RUNNER_IMAGE_TAG=some_tag | ||
``` | ||
After which you run the build command: | ||
``` | ||
docker build -t us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$RUNNER_IMAGE_TAG -t us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$(git rev-parse --short HEAD) . | ||
``` | ||
This builds and tags the image with both the Git SHA and desired tag set. | ||
|
||
Authenticate to the docker repository in GCP with: | ||
``` | ||
gcloud auth configure-docker us-central1-docker.pkg.dev | ||
``` | ||
docker push us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$RUNNER_IMAGE_TAG | ||
docker push us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$(git rev-parse --short HEAD) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
name: Build and Version Runner Docker Image | ||
|
||
on: | ||
pull_request_target: | ||
branches: ['master'] | ||
paths: ['.github/gh-actions-self-hosted-runners/arc/images/**'] | ||
|
||
jobs: | ||
build-and-version-runner: | ||
env: | ||
working-directory: .github/gh-actions-self-hosted-runners/arc/images/ | ||
runs-on: [self-hosted, ubuntu-20.04] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build and push Docker image | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ${{ env.working-directory }} | ||
push: false | ||
tags: | | ||
us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:latest | ||
us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:${{ github.sha }} |