Skip to content

Conversation

@nesitor
Copy link
Member

@nesitor nesitor commented Apr 25, 2023

No description provided.

@nesitor nesitor requested review from aliel, hoh and odesenfans April 25, 2023 17:32
@nesitor nesitor self-assigned this Apr 25, 2023
Copy link
Contributor

@odesenfans odesenfans left a 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
Copy link
Contributor

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?

Copy link
Member Author

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")
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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:

  1. They would never be filtered, if a filter would be applied
  2. They could never be filtered, as otherwise you'd have to pass in a List, mixed with str and NoneType into the node software
  3. 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,
Copy link
Contributor

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_image
  • image
  • disk_image

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

???



@app.command()
def unpersist(
Copy link
Contributor

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?

Copy link
Member Author

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"
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

@nesitor nesitor requested a review from odesenfans May 11, 2023 09:40
@MHHukiewitz
Copy link
Member

I am going to migrate the SDK part to https://github.com/aleph-im/aleph-sdk-python, while keeping all CLI functionality mergeable.

Copy link
Member

@hoh hoh left a 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")
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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",

@MHHukiewitz
Copy link
Member

Being superseded by #178

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.

5 participants