Skip to content
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

Use a rust layer with a full app build #1004

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
/**/*.swo
/**/*.swp
/**/*~
# ignore jar files, but keep Gradle wrapper
# ignore jar files, but keep Gradle wrapper and build artifacts
/**/*.jar
!gradle/wrapper/gradle-wrapper.jar
!artifacts/*.jar

# node
/**/node_modules/
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ on:
- main
- release\/*

jobs:
cancel_running_workflows:
name: Cancel running workflows
runs-on: ubuntu-22.04
steps:
- name: cancel running workflows
uses: RDXWorks-actions/cancel-workflow-action@main
with:
access_token: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_deb:
name: Build debian package
runs-on: selfhosted-ubuntu-22.04-16-cores
Expand Down Expand Up @@ -140,7 +135,7 @@ jobs:
packages: write
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-latest
runs_on: ubuntu-16-cores-selfhosted
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "private-babylon-node"
Expand Down Expand Up @@ -246,7 +241,7 @@ jobs:
packages: write
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-latest
runs_on: ubuntu-16-cores-selfhosted
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node"
Expand Down
206 changes: 206 additions & 0 deletions .github/workflows/publish-build-layer-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Publish build layer images

on:
workflow_dispatch:
inputs:
docker_tag:
description: "Docker tag to be published"

permissions:
packages: write
pull-requests: write
id-token: write
contents: read
muzuke marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build_rust_amd64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-16-cores-selfhosted
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-rust
context: "."
dockerfile: docker/base-images/rust-builder.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/amd64"
provenance: "false"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: amd64
flavor: |
suffix=-amd64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

build_rust_arm64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: selfhosted-ubuntu-22.04-arm
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-rust
context: "."
dockerfile: docker/base-images/rust-builder.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/arm64"
provenance: "false"
scan_image: false
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: arm64
flavor: |
suffix=-arm64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

join_rust_multiarch_image:
name: Join multiarch image
needs:
- build_rust_amd64
- build_rust_arm64
permissions:
id-token: write
contents: read
pull-requests: read
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/join-docker-images-all-tags.yml@main
with:
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
amd_meta_data_json: ${{needs.build_rust_amd64.outputs.json}}
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

build_java_amd64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-16-cores-selfhosted
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-java
context: "."
dockerfile: docker/base-images/java-builder.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/amd64"
provenance: "false"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: amd64
flavor: |
suffix=-amd64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

build_java_arm64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: selfhosted-ubuntu-22.04-arm
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-java
context: "."
dockerfile: docker/base-images/java-builder.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/arm64"
provenance: "false"
scan_image: false
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: arm64
flavor: |
suffix=-arm64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

join_java_multiarch_image:
name: Join multiarch image
needs:
- build_java_amd64
- build_java_arm64
permissions:
id-token: write
contents: read
pull-requests: read
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/join-docker-images-all-tags.yml@main
with:
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
amd_meta_data_json: ${{needs.build_java_amd64.outputs.json}}
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

build_app_amd64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-16-cores-selfhosted
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-app
context: "."
dockerfile: docker/base-images/app.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/amd64"
provenance: "false"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: amd64
flavor: |
suffix=-amd64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

build_app_arm64:
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: selfhosted-ubuntu-22.04-arm
environment: "release"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-node-build-layers"
tag: ${{ inputs.docker_tag }}-app
context: "."
dockerfile: docker/base-images/app.dockerfile
target: "babylon-node-build-layers"
platforms: "linux/arm64"
provenance: "false"
scan_image: false
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
use_gh_remote_cache: true
cache_tag_suffix: arm64
flavor: |
suffix=-arm64
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

join_app_multiarch_image:
name: Join multiarch image
needs:
- build_app_amd64
- build_app_arm64
permissions:
id-token: write
contents: read
pull-requests: read
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/join-docker-images-all-tags.yml@main
with:
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
amd_meta_data_json: ${{needs.build_app_amd64.outputs.json}}
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ node_modules/
**/resources/markdown

# code coverage info
**/lcov.info
**/lcov.info

# CI generated
artifacts
Loading
Loading