Skip to content

Commit

Permalink
fix(docker): update docker compose files
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed May 28, 2024
1 parent 2150821 commit f951afc
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 76 deletions.
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
6 changes: 3 additions & 3 deletions client/tests/integration/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ fn stored_vs_granted_token_payload() -> Result<()> {
Permission::from_str_unchecked(
"CanSetKeyValueInUserAsset".parse().unwrap(),
// NOTE: Introduced additional whitespaces in the serialized form
&*format!(r###"{{ "asset_id" : "xor#wonderland#{mouse_id}" }}"###),
&format!(r###"{{ "asset_id" : "xor#wonderland#{mouse_id}" }}"###),
),
alice_id,
);
Expand Down Expand Up @@ -352,7 +352,7 @@ fn permissions_are_unified() {
Permission::from_str_unchecked(
"CanTransferUserAsset".parse().unwrap(),
// NOTE: Introduced additional whitespaces in the serialized form
&*format!(r###"{{ "asset_id" : "rose#wonderland#{alice_id}" }}"###),
&format!(r###"{{ "asset_id" : "rose#wonderland#{alice_id}" }}"###),
),
alice_id.clone(),
);
Expand All @@ -361,7 +361,7 @@ fn permissions_are_unified() {
Permission::from_str_unchecked(
"CanTransferUserAsset".parse().unwrap(),
// NOTE: Introduced additional whitespaces in the serialized form
&*format!(r###"{{ "asset_id" : "rose##{alice_id}" }}"###),
&format!(r###"{{ "asset_id" : "rose##{alice_id}" }}"###),
),
alice_id,
);
Expand Down
12 changes: 6 additions & 6 deletions config/base/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ mod tests {
extends: Option<ExtendsPaths>,
}

impl ExtendsPaths {
fn as_str_vec(&self) -> Vec<&str> {
self.iter().map(|p| p.to_str().unwrap()).collect()
}
}

#[test]
fn parse_empty_extends() {
let value: TestExtends = toml::from_str("").expect("should be fine with empty input");
Expand Down Expand Up @@ -224,12 +230,6 @@ mod tests {

#[test]
fn iterating_over_extends() {
impl ExtendsPaths {
fn as_str_vec(&self) -> Vec<&str> {
self.iter().map(|p| p.to_str().unwrap()).collect()
}
}

let single = ExtendsPaths::Single("single".into());
assert_eq!(single.as_str_vec(), vec!["single"]);

Expand Down
34 changes: 17 additions & 17 deletions configs/swarm/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@

version: '3.8'
services:
iroha0:
irohad0:
build: ../..
platform: linux/amd64
environment:
CHAIN_ID: 00000000-0000-0000-0000-000000000000
PUBLIC_KEY: ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB
PRIVATE_KEY: 8026408F4C15E5D664DA3F13778801D23D4E89B76E94C1B94B389544168B6CB894F84F8BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB
PUBLIC_KEY: ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731
PRIVATE_KEY: 802640418A3712F4841FFE7A90B14E90BF76A6EF2A2546AC8DBBB1F442FFB8250426B082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731
P2P_ADDRESS: 0.0.0.0:1337
API_ADDRESS: 0.0.0.0:8080
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
GENESIS_PRIVATE_KEY: 80264082B3BDE54AEBECA4146257DA0DE8D59D8E46D5FE34887DCD8072866792FCB3AD4164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
GENESIS_FILE: /config/genesis.json
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]'
SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]'
ports:
- 1337:1337
- 8080:8080
volumes:
- ./:/config
init: true
command: iroha --submit-genesis
command: irohad --submit-genesis
healthcheck:
test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0
interval: 2s
timeout: 1s
retries: 30
start_period: 4s
iroha1:
irohad1:
build: ../..
platform: linux/amd64
environment:
CHAIN_ID: 00000000-0000-0000-0000-000000000000
PUBLIC_KEY: ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F
PRIVATE_KEY: 802640C02FFAD5E455E7EC620D74DE5769681E4D8385906BCE5A437EB67452A9EFBBC2815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F
PUBLIC_KEY: ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D
PRIVATE_KEY: 8026403895C6FA512EF0C2D73DE2F2F2953C3F385ED636D9579BCC5022531228B8DBAF83C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D
P2P_ADDRESS: 0.0.0.0:1338
API_ADDRESS: 0.0.0.0:8081
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]'
SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]'
ports:
- 1338:1338
- 8081:8081
Expand All @@ -52,17 +52,17 @@ services:
timeout: 1s
retries: 30
start_period: 4s
iroha2:
irohad2:
build: ../..
platform: linux/amd64
environment:
CHAIN_ID: 00000000-0000-0000-0000-000000000000
PUBLIC_KEY: ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736
PRIVATE_KEY: 80264029C5ED1409CB10FD791BC4FF8A6CB5E22A5FAE7E36F448EF3EA2988B1319A88BF417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736
PUBLIC_KEY: ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E
PRIVATE_KEY: 802640DB566C53DFF72340CA72E690F882D67B75E47C6B1A5D7A1723B3B2082279BB9AA37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E
P2P_ADDRESS: 0.0.0.0:1339
API_ADDRESS: 0.0.0.0:8082
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"}]'
SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]'
ports:
- 1339:1339
- 8082:8082
Expand All @@ -75,17 +75,17 @@ services:
timeout: 1s
retries: 30
start_period: 4s
iroha3:
irohad3:
build: ../..
platform: linux/amd64
environment:
CHAIN_ID: 00000000-0000-0000-0000-000000000000
PUBLIC_KEY: ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61
PRIVATE_KEY: 8026405EED4855FAD183C451AAC39DFC50831607E4CF408C98E2B977F3CE4A2DF42CE2A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61
PUBLIC_KEY: ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E
PRIVATE_KEY: 802640E28031CC65994ADE240E32FCFD0405DF30A47BDD6ABAF76C8C3C5A4F3DE96F75B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E
P2P_ADDRESS: 0.0.0.0:1340
API_ADDRESS: 0.0.0.0:8083
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]'
SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"}]'
ports:
- 1340:1340
- 8083:8083
Expand Down
8 changes: 4 additions & 4 deletions configs/swarm/docker-compose.single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

version: '3.8'
services:
iroha0:
irohad0:
build: ../..
platform: linux/amd64
environment:
CHAIN_ID: 00000000-0000-0000-0000-000000000000
PUBLIC_KEY: ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB
PRIVATE_KEY: 8026408F4C15E5D664DA3F13778801D23D4E89B76E94C1B94B389544168B6CB894F84F8BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB
PUBLIC_KEY: ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731
PRIVATE_KEY: 802640418A3712F4841FFE7A90B14E90BF76A6EF2A2546AC8DBBB1F442FFB8250426B082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731
P2P_ADDRESS: 0.0.0.0:1337
API_ADDRESS: 0.0.0.0:8080
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
Expand All @@ -21,7 +21,7 @@ services:
volumes:
- ./:/config
init: true
command: iroha --submit-genesis
command: irohad --submit-genesis
healthcheck:
test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0
interval: 2s
Expand Down
Loading

0 comments on commit f951afc

Please sign in to comment.