-
Notifications
You must be signed in to change notification settings - Fork 15
Added instance command type #156
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
Conversation
odesenfans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review. We need to implement support for instance messages on CCNs before merging this.
| Post a (create) INSTANCE message. | ||
| :param account: Account to use to sign the message | ||
| :param rootfs: Root filesystem to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is it exactly? A message item hash? A CID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a persistent volume, but with the parent option required, because this persistent volume should be the main hard disk of the instance.
| :param rootfs_name: Name of root filesystem | ||
| :param environment_variables: Environment variables to pass to the program | ||
| :param storage_engine: Storage engine to use (Default: "storage") | ||
| :param channel: Channel to use (Default: "TEST") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to your PR, but why the hell is "TEST" our default channel? Makes no sense. Maybe make it default to None? Channels are useless the way they are implemented anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with that, we can use None by default, but anyway I don't understand exactly what's the use case to use channels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moshe planned to use channels to split the network in smaller parts for performance reasons. This has never been implemented and may not be the way we want to implement it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it kind of weird TBH, if we can leave Channel None. When having None as a valid input, I would expect a drastically different behavior on these messages than on others. Meaning that:
- They would never be filtered, if a filter would be applied
- They could never be filtered, as otherwise you'd have to pass in a
List, mixed withstrandNoneTypeinto the node software - Could only appear if no channel filter is applied at all
When thinking about scaling, this makes me uncomfortable. What would be the primary method of sharding messages then? Sender addresses?
| "seconds": timeout_seconds, | ||
| }, | ||
| "rootfs": { | ||
| "parent": rootfs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent is pretty vague. I guess this is related to the device mapping you implemented on the CRNs. This is an implementation detail and should not appear as clearly. Suggestions:
rootfs_imageimagedisk_image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I don't agree, because we can use the parent option to extend different persistent volumes, not only the main rootfs. I think that parent is a good name for the field, but we can discuss it, obviously.
| ) | ||
|
|
||
| # Ensure that the version of aleph-message used supports the field. | ||
| assert content.on.persistent == persistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
|
|
||
|
|
||
| @app.command() | ||
| def unpersist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really applicable to instances. That's a whole other issue, but we should improve the communication between CCNs and CRNs now that CCNs are more reliable. Having a P2P pubsub channel or a websocket to retrieve operations on programs and instances would make it possible to delete a VM once the instance message is forgotten, for example.
In the meantime: remove this command as it does not make sense to "unpersist" a VM instance.
@hoh do we want a delete command that just forgets the instance instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used the same existing method on the VMs, but we can change it to delete, that also for me have better sense.
| "bd79839bf96e595a06da5ac0b6ba51dea6f7e2591bb913deccded04d831d29f4" | ||
| ) | ||
| DEFAULT_ROOTFS_ID: str = ( | ||
| "549ec451d9b099cad112d4aaa2c00ac40fb6729a92ff252ff22eef0b5c3cb613" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment describing what this rootfs is based on? Is it Ubuntu, Debian, something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I am going to migrate the SDK part to https://github.com/aleph-im/aleph-sdk-python, while keeping all CLI functionality mergeable. |
hoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments I forgot to submit.
| :param rootfs_name: Name of root filesystem | ||
| :param environment_variables: Environment variables to pass to the program | ||
| :param storage_engine: Storage engine to use (Default: "storage") | ||
| :param channel: Channel to use (Default: "TEST") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moshe planned to use channels to split the network in smaller parts for performance reasons. This has never been implemented and may not be the way we want to implement it.
| print_instance_message: bool = typer.Option(False), | ||
| rootfs: str = typer.Option( | ||
| None, | ||
| help="Hash of the rootfs to use for your instance. Defaults to aleph debian with Python3.8 and node. You can also create your own rootfs and pin it", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| help="Hash of the rootfs to use for your instance. Defaults to aleph debian with Python3.8 and node. You can also create your own rootfs and pin it", | |
| help="Hash of the rootfs to use for your instance. Defaults to aleph debian with Python3.9 and node. You can also create your own rootfs and pin it", |
|
Being superseded by #178 |
No description provided.