diff --git a/.github/workflows/iroha2-custom-image.yml b/.github/workflows/iroha2-custom-image.yml index 1256d52ff2..cefbf92a73 100644 --- a/.github/workflows/iroha2-custom-image.yml +++ b/.github/workflows/iroha2-custom-image.yml @@ -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 @@ -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 @@ -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: @@ -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 }}" @@ -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: @@ -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: diff --git a/.github/workflows/iroha2-dev-sonar-dojo.yml b/.github/workflows/iroha2-dev-sonar-dojo.yml index d369581946..18973c19f5 100644 --- a/.github/workflows/iroha2-dev-sonar-dojo.yml +++ b/.github/workflows/iroha2-dev-sonar-dojo.yml @@ -35,7 +35,7 @@ jobs: -Dcommunity.rust.lcov.reportPaths=lints/lcov.info - name: DefectDojo id: defectdojo - uses: C4tWithShell/defectdojo-action@1.0.5 + uses: C4tWithShell/defectdojo-action@1.0.6 with: token: ${{ secrets.DEFECTOJO_TOKEN }} defectdojo_url: ${{ secrets.DEFECTOJO_URL }} diff --git a/.github/workflows/iroha2-release.yml b/.github/workflows/iroha2-release.yml index 9f6ac3658b..9a433f0fe2 100644 --- a/.github/workflows/iroha2-release.yml +++ b/.github/workflows/iroha2-release.yml @@ -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: @@ -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 @@ -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 }} @@ -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: .