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

add sim-ln service #324

Merged
merged 10 commits into from
Apr 5, 2024
Merged

Conversation

pinheadmz
Copy link
Contributor

@pinheadmz pinheadmz commented Mar 26, 2024

This is a WIP, pushing commits slowly to bang on CI

Strategy:

  • Move the backend/compose/services directory up to src/
  • Add graphml options to add those services only when needed
  • refactor the BaseService to accomodate both backends
  • add sim-ln service that can be optionally added to any warnet with either backend
  • export network data into the simln container so it can do its thing

TODO:

  • DOCS (follow up PR)

@pinheadmz pinheadmz force-pushed the simln-service branch 7 times, most recently from fc6561d to cf7ddda Compare April 1, 2024 17:26
@pinheadmz pinheadmz marked this pull request as ready for review April 1, 2024 17:37
@pinheadmz pinheadmz force-pushed the simln-service branch 8 times, most recently from b798047 to 4559410 Compare April 2, 2024 20:15
Copy link
Contributor

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

General ACK.

Left a few comments scattered through the (numerous) PRs, nothing blocking really expect perhaps using pip install -e . in the RPC dockerfile?

Some nice cleanups interspersed with the new features, which I think is OK in this repo when making a change of this size, as there's little point in breaking this into multiple dependant PRs and waiting on all of them.

@@ -109,9 +109,23 @@ def get_tank_ipv4(self, index: int) -> str:
"""
raise NotImplementedError("This method should be overridden by child class")

@abstractmethod
def get_lnnode_hostname(self, index: int) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

A nice (future) improvement could be to combine this with the get_tank_ipv4 function above, and have it return the hostname for tanks or lnnodes

@@ -16,38 +16,33 @@
doc += "### GraphML file format and headers\n"
doc += "```xml\n"
doc += '<?xml version="1.0" encoding="UTF-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns">\n'
for name, details in graph_schema["node"]["properties"].items():
Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing as you've put so much work into this, we could (in the future) add a CI job which ran the script and checked to docs were up-to-date

@abstractmethod
def service_from_json(self, json: object):
"""
Create a single container from an object of settings
Copy link
Contributor

Choose a reason for hiding this comment

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

In backends: add method to deploy generic service JSON

This seems odd to label it "object", isn't it coming from a dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

damn me and my years of javascript!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in #333

@@ -506,3 +506,22 @@ def wait_for_healthy_tanks(self, warnet, timeout=60) -> bool:
raise Exception(f"Tanks did not reach healthy status in {timeout} seconds")

return healthy

def service_from_json(self, obj) -> object:
Copy link
Contributor

Choose a reason for hiding this comment

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

In backends: add method to deploy generic service JSON

Also here it seems weird to return a generic object, why not dict again?
Also also, its fine as it's internal I'd guess, but there's no code handling if the service doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit addressed in #333

if the service doesnt exist, there would be nothing to pass to this function anyway so thats really the caller's problem

src/templates/rpc/Dockerfile_rpc Outdated Show resolved Hide resolved
@pinheadmz pinheadmz force-pushed the simln-service branch 3 times, most recently from b651a4d to 0eb3be3 Compare April 3, 2024 20:19
@pinheadmz pinheadmz mentioned this pull request Apr 4, 2024
@pinheadmz pinheadmz force-pushed the simln-service branch 8 times, most recently from 68c131f to 87c0ab1 Compare April 5, 2024 18:39
@pinheadmz pinheadmz merged commit 81724ef into bitcoin-dev-project:main Apr 5, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants