Skip to content

Conversation

@willcl-ark
Copy link
Contributor

Fixes #393

@willcl-ark willcl-ark force-pushed the remote-scenario-file-names branch from a2f2c52 to 0c66be6 Compare July 8, 2024 12:17
additional_args: list[str],
network: str = "warnet",
) -> str:
scenario_path = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I believe we can remove scenario_path = None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in d50ba92

@willcl-ark willcl-ark force-pushed the remote-scenario-file-names branch from 0c66be6 to 1410aa1 Compare July 8, 2024 18:33
@mplsgrant
Copy link
Collaborator

mplsgrant commented Jul 8, 2024

I like this overall and it works well with #384: https://github.com/mplsgrant/warnet/actions/runs/9844946239/job/27179455585#step:8:361

However, I'll need to rerun with the logging changes to be sure.

@willcl-ark willcl-ark force-pushed the remote-scenario-file-names branch from 1410aa1 to 55e4411 Compare July 8, 2024 18:43
@willcl-ark
Copy link
Contributor Author

I like this overall and it works well with #384: mplsgrant/warnet/actions/runs/9844946239/job/27179455585#step:8:361

However, I'll need to rerun with the logging changes to be sure.

Great thanks! I was just trying to address your comment when I spotted that we duplicated most of the code in our two scenario run functions, so refactored that in the push I just made:

https://github.com/bitcoin-dev-project/warnet/compare/0c66be68ec2f75393ba33712df03c3eac9771f0f..55e4411062f5daaf991e482da0b2830a0bb25099

Copy link
Contributor

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK, maybe a nice improvement or two suggested

Comment on lines 364 to 365
# Extract just the filename without path and extension
base_name = os.path.splitext(os.path.basename(scenario_name))[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to do this in cli/scenarios.py and just pass the name to the server. Could even theoretically be an option to add a custom --name when running a scenario. for example if you want to run the same scenario a few times in parallel.

warcli scenarios stop could even accept that name as an option instead of a pid !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in d50ba92

@willcl-ark willcl-ark force-pushed the remote-scenario-file-names branch from 55e4411 to d50ba92 Compare July 9, 2024 07:51
@willcl-ark willcl-ark force-pushed the remote-scenario-file-names branch from d50ba92 to ac4e558 Compare July 9, 2024 11:46
@m3dwards m3dwards merged commit 4388a0d into bitcoin-dev-project:main Jul 9, 2024
@pinheadmz
Copy link
Contributor

post-merge ACK, nice looks good

(.venv) --> warcli scenarios run miner_std
Running scenario miner_std with PID 9231 in the background...
(.venv) --> warcli scenarios active
┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┓
┃ Active ┃ Cmd        ┃ Network ┃ Pid  ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━┩
│ True   │ miner_std  │ warnet  │ 9231 │
└────────┴────────────┴─────────┴──────┘
(.venv) --> warcli scenarios run --name miner2 miner_std --allnodes
-32000: Scenario --name not found at /root/warnet/src/scenarios/--name.py.
(.venv) --> warcli scenarios run-file src/scenarios/tx_flood.py 
Running scenario tx_flood with PID 9337 in the background...
(.venv) --> warcli scenarios active
┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┓
┃ Active ┃ Cmd        ┃ Network ┃ Pid  ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━┩
│ True   │ miner_std  │ warnet  │ 9231 │
│ True   │ tx_flood   │ warnet  │ 9337 │
└────────┴────────────┴─────────┴──────┘
(.venv) --> warcli scenarios run miner_std --allnodes --interval=1 --mature
Running scenario miner_std with PID 9400 in the background...
(.venv) --> warcli scenarios active
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┓
┃ Active ┃ Cmd                                        ┃ Network ┃ Pid  ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━┩
│ True   │ miner_std                                  │ warnet  │ 9231 │
│ True   │ tx_flood                                   │ warnet  │ 9337 │
│ True   │ miner_std --allnodes --interval=1 --mature │ warnet  │ 9400 │
└────────┴────────────────────────────────────────────┴─────────┴──────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scenarios run from file need to be renamed

4 participants