-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed Up Publish OSS Artifacts for Cloud Workflow #19696
Changes from 7 commits
431639f
fae20da
a4a1297
92f2fd6
4d7912b
6b283a5
800b747
5c015df
fc0c421
8efd8a0
38d9d4d
4b33b82
edced9d
89db68a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Prepare Runner for Building' | ||
description: 'Prepare Runner for Building project' | ||
inputs: | ||
install_java: | ||
description: '' | ||
required: false | ||
default: 'true' | ||
install_node: | ||
description: '' | ||
required: false | ||
default: 'true' | ||
install_python: | ||
description: '' | ||
required: false | ||
default: 'true' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- if: inputs.install_java == 'true' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
|
||
- if: inputs.install_node == 'true' | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/gallium" | ||
|
||
- if: inputs.install_python == 'true' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- if: inputs.install_java == 'true' | ||
name: Set up CI Gradle Properties | ||
run: | | ||
mkdir -p ~/.gradle/ | ||
cat > ~/.gradle/gradle.properties <<EOF | ||
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ | ||
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ | ||
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ | ||
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ | ||
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | ||
org.gradle.vfs.watch=false | ||
EOF | ||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: Publish OSS Artifacts for Cloud | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ inputs.oss_ref || github.sha }} | ||
|
||
env: | ||
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} | ||
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} | ||
davinchia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -10,6 +12,9 @@ on: | |
required: false | ||
jobs: | ||
find_valid_pat: | ||
concurrency: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for my understanding: what is this for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is so only one instance of this workflow can be actively running for a specific oss sha (so we don't attempt to push artifacts for the same sha from multiple concurrent workflows) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah ok! can we also add a comment here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added comments |
||
group: ${{ github.workflow }}-${{ inputs.oss_ref || github.sha }} | ||
cancel-in-progress: false | ||
name: "Find a PAT with room for actions" | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
|
@@ -91,6 +96,7 @@ jobs: | |
uses: ./.github/actions/build-branch | ||
with: | ||
branch_version_tag: ${{ needs.generate-tags.outputs.dev_tag }} | ||
build_docker_images: 'false' | ||
|
||
- name: Publish Dev Jars | ||
env: | ||
|
@@ -134,6 +140,13 @@ jobs: | |
echo "GIT_REVISION=${GIT_REVISION}" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Prepare Runner for Building | ||
uses: ./.github/actions/runner-prepare-for-build | ||
|
||
- name: Prepare Docker context | ||
run: VERSION=${{ needs.generate-tags.outputs.dev_tag }} SUB_BUILD=PLATFORM ./gradlew copyGeneratedTar airbyte-db:db-lib:copyInitSql | ||
davinchia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
shell: bash | ||
|
||
- name: Push Docker Images | ||
env: | ||
VERSION: ${{ needs.generate-tags.outputs.dev_tag }} | ||
|
@@ -144,3 +157,29 @@ jobs: | |
- name: Cleanup Docker buildx | ||
run: docker buildx rm oss-buildx | ||
shell: bash | ||
|
||
stop-runner: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh did we previously not stop runners? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, seems like a bug that went unnoticed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yikes - good catch |
||
name: "Stop Build EC2 Runner" | ||
timeout-minutes: 10 | ||
needs: | ||
- start-runner # required to get output from the start-runner job | ||
- docker-push # wait until all publish steps are done | ||
- find_valid_pat | ||
runs-on: ubuntu-latest | ||
# Always is required to stop the runner even if the previous job has errors. However always() runs even if the previous step is skipped. | ||
# Thus, we check for skipped here. | ||
if: ${{ always() && needs.start-runner.result != 'skipped'}} | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-2 | ||
- name: Stop EC2 runner | ||
uses: airbytehq/ec2-github-runner@base64v1.1.0 | ||
with: | ||
mode: stop | ||
github-token: ${{ needs.find_valid_pat.outputs.pat }} | ||
label: ${{ needs.start-runner.outputs.label }} | ||
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a comment is nice here that says something along the lines of
//these environment variables are necessary for gradle cache task