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

Internal: introduce an Executor class #8

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

odesenfans
Copy link
Contributor

Problem: the Node class assumes that the coordinator will use the aleph.im compute resource nodes in all cases. We wish to let the user specify dedicated executor servers as well.

Solution: introduce an Executor class that takes a node and an optional VM function. If running on aleph.im, the API URL of the executor will be https://{node_url}/vm/{function}, otherwise it will default to https://{node_url}.

The result dictionaries now use executors as keys as the model is now hashable.



class LocalNode(Node):
port: int
Copy link
Member

Choose a reason for hiding this comment

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

This port property isn't used at time to set the url.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it's basically there for local tests, which are for a following PR. I'll still work on this a bit before merging, not 100% sure this is the right way.

@odesenfans odesenfans force-pushed the od-improve-node-object branch 2 times, most recently from 18e180d to c03a823 Compare September 25, 2023 10:14
Problem: the `Node` class assumes that the coordinator will use the
aleph.im compute resource nodes in all cases. We wish to let the user
specify dedicated executor servers as well.

Solution: introduce an `Executor` class that takes a node and an
optional VM function. If running on aleph.im, the API URL of the
executor will be https://{node_url}/vm/{function}, otherwise it will
default to https://{node_url}.

The result dictionaries now use executors as keys as the model is now
hashable.
@odesenfans odesenfans merged commit bb91c12 into main Sep 25, 2023
4 checks passed
@odesenfans odesenfans deleted the od-improve-node-object branch September 25, 2023 14:17
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.

2 participants