Skip to content

Commit

Permalink
[fix]: rename everywhere to configs/docker_compose
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
  • Loading branch information
0x009922 committed Feb 20, 2024
1 parent e3f5db1 commit 891db4d
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,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/docker_compose/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 Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ docker compose up
With the `docker-compose` instance running, use [Iroha Client CLI](./client_cli/README.md):

```bash
cargo run --bin iroha_client_cli -- --config ./configs/swarm/client.toml
cargo run --bin iroha_client_cli -- --config ./configs/docker_compose/client.toml
```

## Integration
Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ You may deploy Iroha as a [native binary](#native-binary) or by using [Docker](#

### Docker

We provide a sample configuration for Docker in [`docker-compose.yml`](../configs/swarm/docker-compose.yml). We highly recommend that you adjust the `config.json` to include a set of new key pairs.
We provide a sample configuration for Docker in [`docker-compose.yml`](../configs/docker_compose/docker-compose.yml). We highly recommend that you adjust the `config.json` to include a set of new key pairs.

[Generate the keys](#generating-keys) and put them into `services.*.environment` in `docker-compose.yml`. Don't forget to update the public keys of `TRUSTED_PEERS`.

Expand Down
2 changes: 1 addition & 1 deletion client/examples/tutorial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use iroha_client::config::Config;

fn main() {
// #region rust_config_load
let config = Config::load("../configs/swarm/client.toml").unwrap();
let config = Config::load("../configs/docker_compose/client.toml").unwrap();
// #endregion rust_config_load

// Your code goes here…
Expand Down
2 changes: 1 addition & 1 deletion core/benches/blocks/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub fn build_wsv(

{
let path_to_executor = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../configs/swarm/executor.wasm");
.join("../configs/docker_compose/executor.wasm");
let wasm = std::fs::read(&path_to_executor)
.unwrap_or_else(|_| panic!("Failed to read file: {}", path_to_executor.display()));
let executor = Executor::new(WasmSmartContract::from_compiled(wasm));
Expand Down
2 changes: 1 addition & 1 deletion core/benches/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn build_test_and_transient_wsv(keys: KeyPair) -> WorldStateView {

{
let path_to_executor = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../configs/swarm/executor.wasm");
.join("../configs/docker_compose/executor.wasm");
let wasm = std::fs::read(&path_to_executor)
.unwrap_or_else(|_| panic!("Failed to read file: {}", path_to_executor.display()));
let executor = Executor::new(WasmSmartContract::from_compiled(wasm));
Expand Down
7 changes: 4 additions & 3 deletions core/test_network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ impl TestGenesis for GenesisNetwork {

// TODO: Fix this somehow. Probably we need to make `kagami` a library (#3253).
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
let mut genesis =
RawGenesisBlock::from_path(manifest_dir.join("../../configs/swarm/genesis.json"))
.expect("Failed to deserialize genesis block from file");
let mut genesis = RawGenesisBlock::from_path(
manifest_dir.join("../../configs/docker_compose/genesis.json"),
)
.expect("Failed to deserialize genesis block from file");

let rose_definition_id =
AssetDefinitionId::from_str("rose#wonderland").expect("valid names");
Expand Down
2 changes: 1 addition & 1 deletion default_executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Use the [Wasm Builder CLI](../tools/wasm_builder_cli) in order to build it:

```bash
cargo run --bin iroha_wasm_builder_cli -- \
build ./default_executor --optimize --outfile ./configs/swarm/executor.wasm
build ./default_executor --optimize --outfile ./configs/docker_compose/executor.wasm
```
2 changes: 1 addition & 1 deletion scripts/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import urllib.request
import tomli_w

SWARM_CONFIGS_DIRECTORY = pathlib.Path("configs/swarm")
SWARM_CONFIGS_DIRECTORY = pathlib.Path("configs/docker_compose")
SHARED_CONFIG_FILE_NAME = "config.base.toml"

class Network:
Expand Down
18 changes: 9 additions & 9 deletions scripts/tests/consistency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

case $1 in
"genesis")
cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm | diff - configs/swarm/genesis.json || {
echo 'Please re-generate the genesis with `cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm > configs/swarm/genesis.json`'
cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm | diff - configs/docker_compose/genesis.json || {
echo 'Please re-generate the genesis with `cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm > configs/docker_compose/genesis.json`'
exit 1
};;
"schema")
Expand All @@ -19,7 +19,7 @@ case $1 in
# FIXME: not nice; add an option to `kagami swarm` to print content into stdout?
# it is not a default behaviour because Kagami resolves `build` path relative
# to the output file location
temp_file="configs/swarm/docker-compose.TMP.yml"
temp_file="configs/docker_compose/docker-compose.TMP.yml"
full_cmd="$cmd_base --outfile $temp_file"

eval "$full_cmd"
Expand All @@ -30,19 +30,19 @@ case $1 in
}

command_base_for_single() {
echo "cargo run --release --bin iroha_swarm -- -p 1 -s Iroha --force --config-dir ./configs/swarm --health-check --build ."
echo "cargo run --release --bin iroha_swarm -- -p 1 -s Iroha --force --config-dir ./configs/docker_compose --health-check --build ."
}

command_base_for_multiple_local() {
echo "cargo run --release --bin iroha_swarm -- -p 4 -s Iroha --force --config-dir ./configs/swarm --health-check --build ."
echo "cargo run --release --bin iroha_swarm -- -p 4 -s Iroha --force --config-dir ./configs/docker_compose --health-check --build ."
}

command_base_for_default() {
echo "cargo run --release --bin iroha_swarm -- -p 4 -s Iroha --force --config-dir ./configs/swarm --health-check --image hyperledger/iroha2:dev"
echo "cargo run --release --bin iroha_swarm -- -p 4 -s Iroha --force --config-dir ./configs/docker_compose --health-check --image hyperledger/iroha2:dev"
}


do_check "$(command_base_for_single)" "configs/swarm/docker-compose.single.yml"
do_check "$(command_base_for_multiple_local)" "configs/swarm/docker-compose.local.yml"
do_check "$(command_base_for_default)" "configs/swarm/docker-compose.yml"
do_check "$(command_base_for_single)" "configs/docker_compose/docker-compose.single.yml"
do_check "$(command_base_for_multiple_local)" "configs/docker_compose/docker-compose.local.yml"
do_check "$(command_base_for_default)" "configs/docker_compose/docker-compose.yml"
esac
2 changes: 1 addition & 1 deletion scripts/tests/panic_on_invalid_genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ trap 'rm -rf -- "$IROHA2_GENESIS_PATH" "$KURA_BLOCK_STORE_PATH"' EXIT

# Create invalid genesis
# NewAssetDefinition replaced with AssetDefinition
sed 's/NewAssetDefinition/AssetDefinition/' ./configs/swarm/genesis.json > $IROHA2_GENESIS_PATH
sed 's/NewAssetDefinition/AssetDefinition/' ./configs/docker_compose/genesis.json > $IROHA2_GENESIS_PATH

timeout 1m target/debug/iroha --submit-genesis 2>&1 | tee /dev/stderr | grep -q 'Transaction validation failed in genesis block'

0 comments on commit 891db4d

Please sign in to comment.