From 488ec65c1cbc472a3b7291829a39d32401f3b405 Mon Sep 17 00:00:00 2001 From: BAStos525 Date: Fri, 2 Aug 2024 18:30:50 +0300 Subject: [PATCH] ci: Build executor.wasm in CI Signed-off-by: BAStos525 --- .github/workflows/iroha2-dev-nightly.yml | 26 +++ .github/workflows/iroha2-dev-pr-static.yml | 24 ++ .github/workflows/iroha2-dev-pr-wasm.yaml | 24 ++ .github/workflows/iroha2-dev-pr.yml | 59 ++--- .github/workflows/iroha2-dev.yml | 224 +++++++++---------- .github/workflows/iroha2-pr-ui.yml | 24 ++ .github/workflows/iroha2-profiling-image.yml | 24 ++ .github/workflows/iroha2-release.yml | 23 ++ Dockerfile | 1 - Dockerfile.glibc | 1 + defaults/docker-compose.local.yml | 12 +- defaults/docker-compose.single.yml | 3 +- defaults/docker-compose.yml | 11 +- 13 files changed, 302 insertions(+), 154 deletions(-) diff --git a/.github/workflows/iroha2-dev-nightly.yml b/.github/workflows/iroha2-dev-nightly.yml index 63f83d279fb..339210d7fe2 100644 --- a/.github/workflows/iroha2-dev-nightly.yml +++ b/.github/workflows/iroha2-dev-nightly.yml @@ -2,13 +2,39 @@ name: I2::Dev::Nightly::Publish on: workflow_dispatch +env: + DOCKER_COMPOSE_PATH: defaults + jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + dockerhub: runs-on: ubuntu-latest + needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 steps: - uses: actions/checkout@v4 + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/.github/workflows/iroha2-dev-pr-static.yml b/.github/workflows/iroha2-dev-pr-static.yml index 7c87fb86cfb..a3f7a55a44e 100644 --- a/.github/workflows/iroha2-dev-pr-static.yml +++ b/.github/workflows/iroha2-dev-pr-static.yml @@ -16,15 +16,39 @@ concurrency: env: RUSTUP_TOOLCHAIN: nightly-2024-04-18 + DOCKER_COMPOSE_PATH: defaults jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + smart_contracts_analysis: runs-on: ubuntu-latest + needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Default executor format run: | cd ./wasm_samples/default_executor diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml index 4a9a0f35e8f..e71467d8529 100644 --- a/.github/workflows/iroha2-dev-pr-wasm.yaml +++ b/.github/workflows/iroha2-dev-pr-wasm.yaml @@ -20,15 +20,39 @@ concurrency: env: RUSTUP_TOOLCHAIN: nightly-2024-04-18 + DOCKER_COMPOSE_PATH: defaults jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + tests: runs-on: ubuntu-latest + needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Install iroha_wasm_test_runner run: cargo install --path tools/wasm_test_runner - name: Run smart contract tests on WebAssembly VM diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 1c35aa1f6e2..2e49de89bfa 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -20,27 +20,28 @@ concurrency: env: CARGO_TERM_COLOR: always CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test" + DOCKER_COMPOSE_PATH: defaults jobs: - # consistency: - # runs-on: [self-hosted, Linux, iroha2] - # container: - # image: hyperledger/iroha2-ci:nightly-2024-04-18 - # steps: - # - uses: actions/checkout@v4 - # - uses: Swatinem/rust-cache@v2 - # - name: Check genesis.json - # if: always() - # run: ./scripts/tests/consistency.sh genesis - # - name: Check schema.json - # if: always() - # run: ./scripts/tests/consistency.sh schema - # - name: Check Docker Compose configurations - # if: always() - # run: ./scripts/tests/consistency.sh docker-compose + consistency: + runs-on: [self-hosted, Linux, iroha2] + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Check genesis.json + if: always() + run: ./scripts/tests/consistency.sh genesis + - name: Check schema.json + if: always() + run: ./scripts/tests/consistency.sh schema + - name: Check Docker Compose configurations + if: always() + run: ./scripts/tests/consistency.sh docker-compose build_executor: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: ubuntu-latest container: image: hyperledger/iroha2-ci:nightly-2024-04-18 timeout-minutes: 30 @@ -48,17 +49,17 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build iroha executor - run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file defaults/executor.wasm + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs uses: actions/upload-artifact@v4 with: name: executor.wasm - path: defaults/executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm retention-days: 1 # exclude: client/tests/integration/ with_coverage: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 @@ -69,7 +70,7 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Run tests, with coverage run: | mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha @@ -90,7 +91,7 @@ jobs: # include: client/tests/integration/ # exclude: client/tests/integration/extra_functional integration: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 @@ -102,13 +103,13 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Run tests, with no-default-features run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional # include: client/tests/integration/extra_functional extra_functional: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 @@ -120,7 +121,7 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Run tests run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional @@ -158,7 +159,7 @@ jobs: context: . workspace_analysis_clippy: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 @@ -169,7 +170,7 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Format run: cargo fmt --all -- --check - name: Lints without features @@ -188,7 +189,7 @@ jobs: path: clippy.json torii-api-and-client-cli-tests: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 @@ -200,7 +201,7 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Build binaries run: | cargo build -p iroha_client_cli -p kagami -p irohad diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml index 75a48340437..797b0a78a32 100644 --- a/.github/workflows/iroha2-dev.yml +++ b/.github/workflows/iroha2-dev.yml @@ -10,7 +10,7 @@ env: jobs: build_executor: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: ubuntu-latest container: image: hyperledger/iroha2-ci:nightly-2024-04-18 timeout-minutes: 30 @@ -18,15 +18,16 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build iroha executor - run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file defaults/executor.wasm + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs uses: actions/upload-artifact@v4 with: name: executor.wasm - path: defaults/executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm retention-days: 1 + registry: - runs-on: ubuntu-latest # [self-hosted, Linux, iroha2] + runs-on: [self-hosted, Linux, iroha2] needs: build_executor steps: - uses: actions/checkout@v4 @@ -34,9 +35,7 @@ jobs: uses: actions/download-artifact@v4 with: name: executor.wasm - path: defaults - - name: check files - run: ls -la defaults + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Set up Docker Buildx id: buildx if: always() @@ -52,124 +51,125 @@ jobs: file: Dockerfile tags: | hyperledger/iroha:local - bastos525/iroha:dev + hyperldedger/iroha:dev cache-from: type=gha cache-to: type=gha,mode=max - # - name: Test docker-compose.single.yml before pushing - # run: | - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.single.yml up --wait || exit 1 - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.single.yml down - # - name: Test docker-compose.local.yml before pushing - # run: | - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml up --wait || exit 1 - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml down - # - name: Test docker-compose.yml before pushing - # run: | - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1 - # docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml down + - name: Test docker-compose.single.yml before pushing + run: | + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.single.yml up --wait || exit 1 + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.single.yml down + - name: Test docker-compose.local.yml before pushing + run: | + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml up --wait || exit 1 + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml down + - name: Test docker-compose.yml before pushing + run: | + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1 + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml down - name: Login to DockerHub 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: Login to Soramitsu Harbor + uses: docker/login-action@v3 + with: + registry: docker.soramitsu.co.jp + username: ${{ secrets.HARBOR_USERNAME }} + password: ${{ secrets.HARBOR_TOKEN }} - name: Push iroha2:dev image uses: docker/build-push-action@v6 with: context: . push: true tags: | - bastos525/iroha:dev + hyperldedger/iroha:dev + docker.soramitsu.co.jp/iroha2/iroha:dev labels: commit=${{ github.sha }} - # archive_binaries_and_schema: - # runs-on: ubuntu-latest - # container: - # image: hyperledger/iroha2-ci:nightly-2024-04-18 - # steps: - # - uses: actions/checkout@v4 - # - uses: Swatinem/rust-cache@v2 - # - name: Build - # run: mold --run cargo build --release --verbose - # - name: Archive iroha - # uses: actions/upload-artifact@v3 - # with: - # name: cargo-build-release - # path: target/release/iroha - # - name: Archive Iroha client CLI - # uses: actions/upload-artifact@v3 - # with: - # name: cargo-client-cli-build-release - # path: target/release/iroha - # - name: Archive kagami - # uses: actions/upload-artifact@v3 - # with: - # name: cargo-crypto-cli-build-release - # path: target/release/kagami - # - name: Generate schema - # run: | - # mkdir -p target/schema - # cargo run --bin kagami -- schema >target/schema/schema.json - # - name: Archive schema - # uses: actions/upload-artifact@v3 - # with: - # name: schema - # path: target/schema + archive_binaries_and_schema: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build + run: mold --run cargo build --release --verbose + - name: Archive iroha + uses: actions/upload-artifact@v3 + with: + name: cargo-build-release + path: target/release/iroha + - name: Archive Iroha client CLI + uses: actions/upload-artifact@v3 + with: + name: cargo-client-cli-build-release + path: target/release/iroha + - name: Archive kagami + uses: actions/upload-artifact@v3 + with: + name: cargo-crypto-cli-build-release + path: target/release/kagami + - name: Generate schema + run: | + mkdir -p target/schema + cargo run --bin kagami -- schema >target/schema/schema.json + - name: Archive schema + uses: actions/upload-artifact@v3 + with: + name: schema + path: target/schema - # telemetry: - # # FIXME #2646 - # if: false - # runs-on: ubuntu-latest - # container: - # image: hyperledger/iroha2-ci:nightly-2024-04-18 - # steps: - # - uses: actions/checkout@v4 - # - uses: Swatinem/rust-cache@v2 - # - name: Run debug tests and save telemetry - # env: - # TELEMETRY_FILE: ../target/telemetry/debug.json.lz4 - # run: | - # mkdir -p target/telemetry - # mold --run cargo test -p iroha --all-features -- unstable_network || true - # - name: Run release tests and save telemetry - # env: - # TELEMETRY_FILE: ../target/telemetry/release.json.lz4 - # run: mold --run cargo test -p iroha --all-features --release -- unstable_network || true - # - name: Install script dependencies - # run: | - # apt-get update - # apt-get install -y --no-install-recommends lz4 jq - # - name: Print debug telemetry info - # run: | - # ./scripts/analyze_telemetry.sh target/telemetry/debug.json.lz4 >target/telemetry/debug.md - # - name: Print release telemetry info - # run: ./scripts/analyze_telemetry.sh target/telemetry/release.json.lz4 >target/telemetry/release.md - # - name: Print debug telemetry info - # run: | - # echo '## Debug build' - # cat target/telemetry/debug.md - # - name: Print release telemetry info - # run: | - # echo '## Release build' - # cat target/telemetry/release.md - # - name: Create telemetry comment - # uses: actions-ecosystem/action-create-comment@v1 - # with: - # body: | - # \# Telemetry info - # \## Debug build - # ${{ steps.debug-telemetry.outputs.body }} - # \## Release build - # ${{ steps.release-telemetry.outputs.body }} - # github_token: ${{ secrets.github_token }} - # continue-on-error: true - # - name: Archive telemetry - # uses: actions/upload-artifact@v3 - # with: - # name: telemetry - # path: target/telemetry + telemetry: + # FIXME #2646 + if: false + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Run debug tests and save telemetry + env: + TELEMETRY_FILE: ../target/telemetry/debug.json.lz4 + run: | + mkdir -p target/telemetry + mold --run cargo test -p iroha --all-features -- unstable_network || true + - name: Run release tests and save telemetry + env: + TELEMETRY_FILE: ../target/telemetry/release.json.lz4 + run: mold --run cargo test -p iroha --all-features --release -- unstable_network || true + - name: Install script dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends lz4 jq + - name: Print debug telemetry info + run: | + ./scripts/analyze_telemetry.sh target/telemetry/debug.json.lz4 >target/telemetry/debug.md + - name: Print release telemetry info + run: ./scripts/analyze_telemetry.sh target/telemetry/release.json.lz4 >target/telemetry/release.md + - name: Print debug telemetry info + run: | + echo '## Debug build' + cat target/telemetry/debug.md + - name: Print release telemetry info + run: | + echo '## Release build' + cat target/telemetry/release.md + - name: Create telemetry comment + uses: actions-ecosystem/action-create-comment@v1 + with: + body: | + \# Telemetry info + \## Debug build + ${{ steps.debug-telemetry.outputs.body }} + \## Release build + ${{ steps.release-telemetry.outputs.body }} + github_token: ${{ secrets.github_token }} + continue-on-error: true + - name: Archive telemetry + uses: actions/upload-artifact@v3 + with: + name: telemetry + path: target/telemetry diff --git a/.github/workflows/iroha2-pr-ui.yml b/.github/workflows/iroha2-pr-ui.yml index 7b87519bf71..dcb07697c45 100644 --- a/.github/workflows/iroha2-pr-ui.yml +++ b/.github/workflows/iroha2-pr-ui.yml @@ -15,10 +15,29 @@ concurrency: env: CARGO_TERM_COLOR: always + DOCKER_COMPOSE_PATH: defaults jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + test: runs-on: ubuntu-latest + needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 timeout-minutes: 60 @@ -32,6 +51,11 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Run tests, with ${{ matrix.feature_flag }} run: | mold --run cargo test --test ui --${{ matrix.feature_flag }} diff --git a/.github/workflows/iroha2-profiling-image.yml b/.github/workflows/iroha2-profiling-image.yml index 340c66e25d9..1698a722b12 100644 --- a/.github/workflows/iroha2-profiling-image.yml +++ b/.github/workflows/iroha2-profiling-image.yml @@ -11,10 +11,29 @@ env: IROHA2_RUSTFLAGS: -C force-frame-pointers=on IROHA2_FEATURES: profiling IROHA2_CARGOFLAGS: -Z build-std + DOCKER_COMPOSE_PATH: defaults jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + registry: runs-on: [self-hosted, Linux, iroha2] + needs: build_executor container: image: hyperledger/iroha2-ci:nightly-2024-04-18 steps: @@ -35,6 +54,11 @@ jobs: registry: docker.soramitsu.co.jp username: ${{ secrets.HARBOR_USERNAME }} password: ${{ secrets.HARBOR_TOKEN }} + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Set up Docker Buildx id: buildx if: always() diff --git a/.github/workflows/iroha2-release.yml b/.github/workflows/iroha2-release.yml index 805b343b986..625a45d951d 100644 --- a/.github/workflows/iroha2-release.yml +++ b/.github/workflows/iroha2-release.yml @@ -10,10 +10,33 @@ env: DOCKER_COMPOSE_PATH: defaults jobs: + build_executor: + runs-on: ubuntu-latest + container: + image: hyperledger/iroha2-ci:nightly-2024-04-18 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Build iroha executor + run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + - name: Upload executor to reuse in other jobs + uses: actions/upload-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm + retention-days: 1 + registry: runs-on: ubuntu-latest + needs: build_executor steps: - uses: actions/checkout@v4 + - name: Download executor.wasm file + uses: actions/download-artifact@v4 + with: + name: executor.wasm + path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 523114ab14e..afb1255c54c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,6 +83,5 @@ COPY --from=builder $TARGET_DIR/kagami $BIN_PATH COPY defaults/genesis.json $CONFIG_DIR COPY defaults/executor.wasm $CONFIG_DIR COPY defaults/client.toml $CONFIG_DIR -#VOLUME defaults/executor.wasm /config USER $USER CMD ["irohad"] diff --git a/Dockerfile.glibc b/Dockerfile.glibc index 8747ade4718..c999e2aa91a 100644 --- a/Dockerfile.glibc +++ b/Dockerfile.glibc @@ -60,5 +60,6 @@ COPY --from=builder $TARGET_DIR/iroha $BIN_PATH COPY --from=builder $TARGET_DIR/kagami $BIN_PATH COPY defaults/genesis.json $CONFIG_DIR COPY defaults/executor.wasm $CONFIG_DIR +COPY defaults/client.toml $CONFIG_DIR USER $USER CMD ["irohad"] diff --git a/defaults/docker-compose.local.yml b/defaults/docker-compose.local.yml index 6d37702b275..93fcafb97ac 100644 --- a/defaults/docker-compose.local.yml +++ b/defaults/docker-compose.local.yml @@ -22,7 +22,8 @@ services: - 1337:1337 - 8080:8080 volumes: - - ./:/config + - ./genesis.json:/config/genesis.json:ro + - ./client.toml:/config/client.toml:ro init: true healthcheck: test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0 @@ -63,7 +64,8 @@ services: - 1338:1338 - 8081:8081 volumes: - - ./:/config + - ./genesis.json:/config/genesis.json:ro + - ./client.toml:/config/client.toml:ro init: true healthcheck: test: test $(curl -s http://127.0.0.1:8081/status/blocks) -gt 0 @@ -88,7 +90,8 @@ services: - 1339:1339 - 8082:8082 volumes: - - ./:/config + - ./genesis.json:/config/genesis.json:ro + - ./client.toml:/config/client.toml:ro init: true healthcheck: test: test $(curl -s http://127.0.0.1:8082/status/blocks) -gt 0 @@ -113,7 +116,8 @@ services: - 1340:1340 - 8083:8083 volumes: - - ./:/config + - ./genesis.json:/config/genesis.json:ro + - ./client.toml:/config/client.toml:ro init: true healthcheck: test: test $(curl -s http://127.0.0.1:8083/status/blocks) -gt 0 diff --git a/defaults/docker-compose.single.yml b/defaults/docker-compose.single.yml index 896ba485ec0..40e6fc7b5d1 100644 --- a/defaults/docker-compose.single.yml +++ b/defaults/docker-compose.single.yml @@ -21,7 +21,8 @@ services: - 1337:1337 - 8080:8080 volumes: - - ./:/config + - ./genesis.json:/config/genesis.json:ro + - ./client.toml:/config/client.toml:ro init: true healthcheck: test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0 diff --git a/defaults/docker-compose.yml b/defaults/docker-compose.yml index 04fb842c5f9..c9edf40efa8 100644 --- a/defaults/docker-compose.yml +++ b/defaults/docker-compose.yml @@ -4,7 +4,7 @@ services: irohad0: - image: bastos525/iroha:dev + image: hyperledger/iroha:dev environment: CHAIN: 00000000-0000-0000-0000-000000000000 PUBLIC_KEY: ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D @@ -46,7 +46,7 @@ services: exec irohad " irohad1: - image: bastos525/iroha:dev + image: hyperledger/iroha:dev environment: CHAIN: 00000000-0000-0000-0000-000000000000 PUBLIC_KEY: ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D @@ -69,7 +69,7 @@ services: retries: 30 start_period: 4s irohad2: - image: bastos525/iroha:dev + image: hyperledger/iroha:dev environment: CHAIN: 00000000-0000-0000-0000-000000000000 PUBLIC_KEY: ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10 @@ -92,7 +92,7 @@ services: retries: 30 start_period: 4s irohad3: - image: bastos525/iroha:dev + image: hyperledger/iroha:dev environment: CHAIN: 00000000-0000-0000-0000-000000000000 PUBLIC_KEY: ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE @@ -114,6 +114,3 @@ services: timeout: 1s retries: 30 start_period: 4s - -# volumes: -# executor.wasm: \ No newline at end of file