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

fix: makes parsec endpoint names scalable; fixes #312 #313

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docker-compose-parsec-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
image: opencbdc-tx-parsec
platform: linux/amd64
tty: true
command: ./scripts/wait-for-it.sh -s agent0:8080 -t 60 -- ./build/tools/bench/parsec/evm/evm_bench --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loadgen_accounts=8192 --loadgen_txtype=erc20 --telemetry=1
command: ./scripts/wait-for-it.sh -s agent0:8080 -t 60 -- ./build/tools/bench/parsec/evm/evm_bench --shard_count=1 --shard0_count=1 --shard0_0_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loadgen_accounts=8192 --loadgen_txtype=erc20 --telemetry=1
networks:
- parsec-network
healthcheck:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose-parsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
platform: linux/amd64
tty: true
restart: always
command: ./scripts/wait-for-it.sh -s ticket0:7777 -t 60 -- ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/agent/agentd --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN --runner_type="evm"
command: ./scripts/wait-for-it.sh -s ticket0:7777 -t 60 -- ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/agent/agentd --shard_count=1 --shard0_count=1 --shard0_0_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN --runner_type="evm"
ports:
- 8080:8080
networks:
Expand All @@ -28,7 +28,7 @@ services:
image: opencbdc-tx-parsec
platform: linux/amd64
tty: true
command: ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/ticket_machine/ticket_machined --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
command: ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/ticket_machine/ticket_machined --shard_count=1 --shard0_count=1 --shard0_0_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
networks:
- parsec-network
healthcheck:
Expand All @@ -45,7 +45,7 @@ services:
image: opencbdc-tx-parsec
platform: linux/amd64
tty: true
command: ./build/src/parsec/runtime_locking_shard/runtime_locking_shardd --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
command: ./build/src/parsec/runtime_locking_shard/runtime_locking_shardd --shard_count=1 --shard0_count=1 --shard0_0_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
networks:
- parsec-network
healthcheck:
Expand Down
2 changes: 1 addition & 1 deletion scripts/lua_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for arg in "$@"; do
done
./build/tools/bench/parsec/lua/lua_bench --component_id=0 \
--ticket_machine0_endpoint=$IP:7777 --ticket_machine_count=1 \
--shard_count=1 --shard0_count=1 --shard00_endpoint=$IP:5556 \
--shard_count=1 --shard0_count=1 --shard0_0_endpoint=$IP:5556 \
--agent_count=1 --agent0_endpoint=$IP:$PORT \
--loglevel=$LOGLEVEL scripts/gen_bytecode.lua $N_WALLETS
echo done
33 changes: 18 additions & 15 deletions scripts/parsec-run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,26 @@ echo Running agent on $IP:$PORT
echo Log level = $LOGLEVEL
echo Runner type = $RUNNER_TYPE

./build/src/parsec/runtime_locking_shard/runtime_locking_shardd --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 \
--shard00_raft_endpoint=$IP:5557 --node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:6666 --ticket_machine_count=1 \
--ticket_machine0_endpoint=$IP:7777 --loglevel=$LOGLEVEL \
> logs/shardd.log &
./build/src/parsec/runtime_locking_shard/runtime_locking_shardd \
--shard_count=1 --shard0_count=1 --shard0_0_endpoint=$IP:5556 \
--node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:6666 \
--ticket_machine_count=1 --ticket_machine0_endpoint=$IP:7777 \
--loglevel=$LOGLEVEL > logs/shardd.log &
sleep 1
./scripts/wait-for-it.sh -s $IP:5556 -t 60 -- \
./build/src/parsec/ticket_machine/ticket_machined --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 --node_id=0 \
--component_id=0 --agent_count=1 --agent0_endpoint=$IP:6666 \
./build/src/parsec/ticket_machine/ticket_machined \
--shard_count=1 --shard0_count=1 --shard0_0_endpoint=$IP:5556 \
--node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:6666 \
--ticket_machine_count=1 --ticket_machine0_endpoint=$IP:7777 \
--loglevel=$LOGLEVEL > logs/ticket_machined.log &
sleep 1
./scripts/wait-for-it.sh -s $IP:7777 -t 60 -- ./scripts/wait-for-it.sh -s \
$IP:5556 -t 60 -- ./build/src/parsec/agent/agentd --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 --node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:$PORT --ticket_machine_count=1 \
--ticket_machine0_endpoint=$IP:7777 --loglevel=$LOGLEVEL \
--runner_type=$RUNNER_TYPE > logs/agentd.log &
./scripts/wait-for-it.sh -s $IP:7777 -t 60 -- \
./scripts/wait-for-it.sh -s $IP:5556 -t 60 -- \
./build/src/parsec/agent/agentd \
--shard_count=1 --shard0_count=1 --shard0_0_endpoint=$IP:5556 \
--node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:$PORT \
--ticket_machine_count=1 --ticket_machine0_endpoint=$IP:7777 \
--loglevel=$LOGLEVEL --runner_type=$RUNNER_TYPE > logs/agentd.log &
8 changes: 7 additions & 1 deletion src/parsec/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ namespace cbdc::parsec {
auto count = std::stoull(it->second);

for(size_t i = 0; i < count; i++) {
auto ep_key = component_name + std::to_string(i) + "_endpoint";
auto ep_key = component_name;
// shard(\d)_count -> shard(\d)_(\d)_endpoint
const std::string shard_ep = "shard";
if(component_name.find(shard_ep) == 0) {
ep_key += "_";
}
ep_key += std::to_string(i) + "_endpoint";
it = opts.find(ep_key);
if(it == opts.end()) {
return std::nullopt;
Expand Down
Loading