Skip to content

Commit

Permalink
ci: update images building workflows
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 committed Dec 9, 2024
1 parent f32a775 commit 8b7055e
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 13 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/iroha2-custom-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: I2::Custom::Publish

on:
push:
tags:
- 'v2*'
workflow_dispatch:
inputs:
BUILD_PROFILER_IMAGE:
description: "Select \"true\" to build and push the \"glibc\" image with profiling"
type: choice
required: true
default: 'false'
options:
- true
- false
BUILD_GLIBC_IMAGE:
description: "Select \"true\" to build and push the standard \"glibc\" image"
type: choice
Expand All @@ -27,7 +32,7 @@ on:
required: true
default: main
PROFILER_NAME:
description: "Profiler value (glibc/alpine) as the image tag part"
description: "Profiler value (profiling/glibc/alpine) as the image tag part"
required: true
default: glibc

Expand Down Expand Up @@ -60,7 +65,7 @@ jobs:
retention-days: 1

registry-profiling-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
if: ${{ inputs.BUILD_PROFILER_IMAGE == 'true' }} and ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_wasm_libs
container:
Expand Down Expand Up @@ -104,8 +109,8 @@ jobs:
with:
push: true
tags: |
hyperledger/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
hyperledger/iroha:${{ env.TAG }}-${{ inputs.PROFILER_NAME }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ inputs.PROFILER_NAME }}-${{ github.sha }}
labels: commit=${{ github.sha }}
build-args: |
"PROFILE=${{ env.IROHA2_PROFILE }}"
Expand All @@ -116,7 +121,7 @@ jobs:
context: .

registry-glibc-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'true' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
if: ${{ inputs.BUILD_PROFILER_IMAGE == 'false' }} and ${{ inputs.BUILD_GLIBC_IMAGE == 'true' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_wasm_libs
container:
Expand Down Expand Up @@ -155,7 +160,7 @@ jobs:
context: .

registry-alpine-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'true' }}
if: ${{ inputs.BUILD_PROFILER_IMAGE == 'false' }} and ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'true' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_wasm_libs
container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-sonar-dojo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
-Dcommunity.rust.lcov.reportPaths=lints/lcov.info
- name: DefectDojo
id: defectdojo
uses: C4tWithShell/[email protected].5
uses: C4tWithShell/[email protected].6
with:
token: ${{ secrets.DEFECTOJO_TOKEN }}
defectdojo_url: ${{ secrets.DEFECTOJO_URL }}
Expand Down
64 changes: 61 additions & 3 deletions .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ env:
CARGO_TERM_COLOR: always
DEFAULTS_DIR: defaults
WASM_TARGET_DIR: wasm/target/prebuilt
IROHA2_DOCKERFILE: Dockerfile.glibc
IROHA2_PROFILE: profiling
IROHA2_RUSTFLAGS: -C force-frame-pointers=on
IROHA2_FEATURES: profiling
IROHA2_CARGOFLAGS: -Z build-std

jobs:
build_wasm_libs:
Expand All @@ -27,8 +32,8 @@ jobs:
path: ${{ env.WASM_TARGET_DIR }}/libs
retention-days: 1

registry:
runs-on: ubuntu-latest
registry-no-profiling:
runs-on: [self-hosted, Linux, iroha2]
needs: build_wasm_libs
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -56,7 +61,7 @@ jobs:
with:
context: .
load: true
file: Dockerfile.glibc
file: ${{env.IROHA2_DOCKERFILE }}
tags: |
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
Expand Down Expand Up @@ -94,3 +99,56 @@ jobs:
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
labels: commit=${{ github.sha }}

registry-with-profiling:
runs-on: [self-hosted, Linux, iroha2]
needs: build_wasm_libs
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
steps:
- uses: actions/checkout@v4
- name: Download wasm libs
uses: actions/download-artifact@v4
with:
name: wasm-libs
path: ${{ env.DEFAULTS_DIR }}/libs
- name: Move the default executor
run: mv ${{ env.DEFAULTS_DIR }}/libs/default_executor.wasm ${{ env.DEFAULTS_DIR }}/executor.wasm
- name: Get the release tag
run: |
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Soramitsu Harbor
uses: docker/login-action@v3
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: |
hyperledger/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
labels: commit=${{ github.sha }}
build-args: |
"PROFILE=${{ env.IROHA2_PROFILE }}"
"RUSTFLAGS=${{ env.IROHA2_RUSTFLAGS }}"
"FEATURES=${{ env.IROHA2_FEATURES }}"
"CARGOFLAGS=${{ env.IROHA2_CARGOFLAGS }}"
file: ${{env.IROHA2_DOCKERFILE }}
context: .

0 comments on commit 8b7055e

Please sign in to comment.