Skip to content

fix: hard shutdown of the producer causes exception when another is c… #583

fix: hard shutdown of the producer causes exception when another is c…

fix: hard shutdown of the producer causes exception when another is c… #583

# SPDX-License-Identifier: Apache-2.0
name: Release Workflow
on:
push:
# `v*` tags are used for production environment
tags:
- v*
# `main` tag is used for integration environment
branches:
- main
# Manual trigger with custom release tag
workflow_dispatch:
inputs:
version:
description: "Release tag:"
type: string
required: false
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
packages: write
env:
OWNER: hashgraph
PACKAGE_NAME: hedera-block-node
REGISTRY: ghcr.io
GRADLE_EXEC: "ionice -c 2 -n 2 nice -n 19 ./gradlew "
JAVA_DISTRIBUTION: "temurin"
JAVA_VERSION: "21.0.6"
DOCKER_MIRROR: "https://hub.mirror.docker.lat.ope.eng.hashgraph.io"
BUILDKIT_VERSION: "v0.22.0"
jobs:
check-gradle:
name: Gradle
uses: ./.github/workflows/zxc-verify-gradle-build-determinism.yaml
with:
ref: ${{ github.event.inputs.ref || '' }}
java-distribution: ${{ inputs.java-distribution || 'temurin' }}
java-version: ${{ inputs.java-version || '21.0.6' }}
publish-block-node-app:
timeout-minutes: 30
needs: [check-gradle]
runs-on: hiero-block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: Build
run: ${GRADLE_EXEC} clean assemble
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Qemu
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
driver-opts: network=host
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["${{ env.DOCKER_MIRROR }}"]
version: ${{ env.BUILDKIT_VERSION }}
- name: Extract version
id: extract_version
run: |
VERSION=$(cat version.txt)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Extract Source Date Epoch
id: extract_source_date_epoch
run: |
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
echo "SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}" >> $GITHUB_ENV
- name: Server - Build and push image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
with:
context: ./block-node/app/docker
file: ./block-node/app/docker/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
build-contexts: |
distributions=./block-node/app/build/distributions
publish-simulator:
timeout-minutes: 30
needs: [check-gradle]
runs-on: hiero-block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: Build
run: ${GRADLE_EXEC} clean assemble
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Qemu
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
driver-opts: network=host
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["${{ env.DOCKER_MIRROR }}"]
version: ${{ env.BUILDKIT_VERSION }}
- name: Extract version
id: extract_version
run: |
VERSION=$(cat version.txt)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Build and push SIMULATOR image
- name: Simulator - Prepare docker directory
run: |
${GRADLE_EXEC} :simulator:copyDependenciesFolders
- name: Simulator - Build and push image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
with:
context: ./simulator/build/docker
file: ./simulator/build/docker/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/simulator-image:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
helm-chart-release-block-node-app:
timeout-minutes: 15
needs: publish-block-node-app
runs-on: hiero-block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: extract_version
run: |
VERSION=$(cat version.txt)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Package helm chart
run: |
helm dependency update charts/block-node-server
helm package charts/block-node-server
- name: Push helm chart
run: |
helm push block-node-helm-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hiero-ledger/hiero-block-node
helm-chart-release-simulator:
timeout-minutes: 15
needs: publish-simulator
runs-on: hiero-block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: extract_version
run: |
VERSION=$(cat version.txt)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Simulator Chart - Package helm chart
run: |
helm dependency update charts/blockstream-simulator
helm package charts/blockstream-simulator
- name: Simulator Chart - Push helm chart
run: |
helm push blockstream-simulator-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hiero-ledger/hiero-block-node