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

refactor!: rename iroha server and client #4662

Merged
merged 4 commits into from
May 29, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/iroha2-dev-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run tests, with coverage
run: |
mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha_client
mold --run cargo test --all-features --no-fail-fast -p iroha_client -- --skip integration
mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha
mold --run cargo test --all-features --no-fail-fast -p iroha -- --skip integration
env:
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run tests, with no-default-features
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha_client integration -- --skip extra_functional
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:
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha_client extra_functional
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional

# Run the job to check that the docker containers are properly buildable
pr-generator-build:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Build binaries
run: |
cargo build -p iroha_client_cli -p kagami -p iroha
cargo build -p iroha_client_cli -p kagami -p irohad
- name: Setup test Iroha 2 environment on the bare metal
run: |
pip3 install -r scripts/requirements.txt --no-input --break-system-packages
Expand All @@ -129,7 +129,7 @@ jobs:
working-directory: client_cli/pytests
env:
# prepared by `test_env.py`
CLIENT_CLI_BINARY: ../../test/iroha_client_cli
CLIENT_CLI_BINARY: ../../test/iroha
CLIENT_CLI_CONFIG: ../../test/client.toml
run: |
poetry run pytest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ jobs:
with:
name: cargo-build-release
path: target/release/iroha
- name: Archive iroha_client_cli
- name: Archive Iroha client CLI
uses: actions/upload-artifact@v3
with:
name: cargo-client-cli-build-release
path: target/release/iroha_client_cli
path: target/release/iroha
- name: Archive kagami
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -112,11 +112,11 @@ jobs:
TELEMETRY_FILE: ../target/telemetry/debug.json.lz4
run: |
mkdir -p target/telemetry
mold --run cargo test -p iroha_client --all-features -- unstable_network || true
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_client --all-features --release -- unstable_network || true
run: mold --run cargo test -p iroha --all-features --release -- unstable_network || true
- name: Install script dependencies
run: |
apt-get update
Expand Down
148 changes: 0 additions & 148 deletions .github/workflows/iroha2-release-pr.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,3 @@ jobs:
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
labels: commit=${{ github.sha }}

configs:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: iroha2-dev
token: ${{ secrets.G_ACCESS_TOKEN }}
- name: Update configs
run: |
./scripts/update_configs.sh lts
./scripts/update_configs.sh stable
- name: Commit config changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[documentation]: Update lts/stable configs following a release'
branch: iroha2-dev
commit_options: '--signoff'
commit_user_name: sorabot
commit_user_email: <>
commit_author: sorabot <[email protected]>
34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ To pass the *`check-PR-title`* check, the pull request title must adhere to the
<details> <summary> Expand to read the detailed title guidelines</summary>

1. Follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-multi-paragraph-body-and-multiple-footers) format.

2. If the pull request has a single commit, the PR title should be the same as the commit message.

</details>
Expand Down Expand Up @@ -199,7 +199,7 @@ Follow these commit guidelines:
- To run the source-code based tests, execute [`cargo test`](https://doc.rust-lang.org/cargo/commands/cargo-test.html) in the Iroha root. Note that this is a long process.
- To run benchmarks, execute [`cargo bench`](https://doc.rust-lang.org/cargo/commands/cargo-bench.html) from the Iroha root. To help debug benchmark outputs, set the `debug_assertions` environment variable like so: `RUSTFLAGS="--cfg debug_assertions" cargo bench`.
- If you are working on a particular component, be mindful that when you run `cargo test` in a [workspace](https://doc.rust-lang.org/cargo/reference/workspaces.html), it will only run the tests for that workspace, which usually doesn't include any [integration tests](https://www.testingxperts.com/blog/what-is-integration-testing).
- If you want to test your changes on a minimal network, the provided [`docker-compose.yml`](configs/swarm/docker-compose.yml) creates a network of 4 Iroha peers in docker containers that can be used to test consensus and asset propagation-related logic. We recommend interacting with that network using either [`iroha-python`](https://github.com/hyperledger/iroha-python), or the included `iroha_client_cli`.
- If you want to test your changes on a minimal network, the provided [`docker-compose.yml`](configs/swarm/docker-compose.yml) creates a network of 4 Iroha peers in docker containers that can be used to test consensus and asset propagation-related logic. We recommend interacting with that network using either [`iroha-python`](https://github.com/hyperledger/iroha-python), or the included Iroha client CLI.
- Do not remove failing tests. Even tests that are ignored will be run in our pipeline eventually.
- If possible, please benchmark your code both before and after making your changes, as a significant performance regression can break existing users' installations.

Expand All @@ -217,11 +217,11 @@ Set the `LOG_FILE_PATH` environment variable to an appropriate location to store

### Debugging using tokio console

<details> <summary> Expand to learn how to compile iroha with tokio console support.</summary>
<details> <summary> Expand to learn how to compile Iroha with tokio console support.</summary>

Sometimes it might be helpful for debugging to analyze tokio tasks using [tokio-console](https://github.com/tokio-rs/console).

In this case you should compile iroha with support of tokio console like that:
In this case you should compile Iroha with support of tokio console like that:

```bash
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
Expand All @@ -230,34 +230,34 @@ RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
Port for tokio console can by configured through `LOG_TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable).
Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `LOG_LEVEL`.

Example of running iroha with tokio console support using `scripts/test_env.sh`:
Example of running Iroha with tokio console support using `scripts/test_env.sh`:

```bash
# 1. Compile iroha
# 1. Compile Iroha
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
# 2. Run iroha with TRACE log level
# 2. Run Iroha with TRACE log level
LOG_LEVEL=TRACE ./scripts/test_env.sh setup
# 3. Access iroha. Peers will be available on ports 5555, 5556, ...
# 3. Access Iroha. Peers will be available on ports 5555, 5556, ...
tokio-console http://127.0.0.1:5555
```

</details>

### Profiling

<details> <summary> Expand to learn ho to profile iroha. </summary>
<details> <summary> Expand to learn ho to profile Iroha. </summary>

To optimize performance it's useful to profile iroha.
To optimize performance it's useful to profile Iroha.

To do that you should compile iroha with `profiling` profile and with `profiling` feature:
To do that you should compile Iroha with `profiling` profile and with `profiling` feature:

```bash
RUSTFLAGS="-C force-frame-pointers=on" cargo +nightly -Z build-std build --target your-desired-target --profile profiling --features profiling
```

Then start iroha and attach profiler of your choice to the iroha pid.
Then start Iroha and attach profiler of your choice to the Iroha pid.

Alternatively it's possible to build iroha inside docker with profiler support and profile iroha this way.
Alternatively it's possible to build Iroha inside docker with profiler support and profile Iroha this way.

```bash
docker build -f Dockerfile.glibc --build-arg="PROFILE=profiling" --build-arg='RUSTFLAGS=-C force-frame-pointers=on' --build-arg='FEATURES=profiling' --build-arg='CARGOFLAGS=-Z build-std' -t iroha:profiling .
Expand All @@ -272,18 +272,18 @@ sudo perf record -g -p <PID>
sudo perf report
```

To be able to observe profile of the executor during iroha profiling, executor should be compiled without stripping symbols.
To be able to observe profile of the executor during Iroha profiling, executor should be compiled without stripping symbols.
It can be done by running:

```bash
# compile executor without optimizations
cargo run --bin iroha_wasm_builder_cli -- build ./path/to/executor --outfile executor.wasm
cargo run --bin iroha_wasm_builder -- build ./path/to/executor --outfile executor.wasm
```

With profiling feature enabled iroha exposes endpoint to scrap pprof profiles:
With profiling feature enabled Iroha exposes endpoint to scrap pprof profiles:

```bash
# profile iroha for 30 seconds and get protobuf profile
# profile Iroha for 30 seconds and get protobuf profile
curl host:port/debug/pprof/profile?seconds=30 -o profile.pb
# analyze profile in browser (required installed go)
go tool pprof -web profile.pb
Expand Down
Loading
Loading