-
Notifications
You must be signed in to change notification settings - Fork 8
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
Configuration driven commands #31
Comments
So, right off the bat, I think these labels would turn into key-value pairs in this TOML file, right? LABEL io.cartesi.sdk_version=0.6.0
LABEL io.cartesi.rollups.ram_size=128Mi
LABEL io.cartesi.rollups.data_size=128Mb ➡️ sdk_version = "0.6.0"
ram_size = "128Mi"
data_size = "128Mb" |
Like that, but with a better structure. First, for drives I'm considering something like: [drives.root]
filename = "rootfs.ext2" Where For the drives that are about to be created by the [drives.root]
builder = "docker"
dockerfile = "Dockerfile"
extraSize = "10Mb" # default 0
format = "ext2" # or "sqfs"
# tags = "my-dapp"
# target optional The above can actually be the default behavior, so It would work as it is now. In addition there are the following properties, which are self-explanatory. shared = true
mount = "/"
user = "dapp" I'm not sure if the drive memory start and size should be configurable. Maybe there is a use case for that. |
For version 0.20, I want to have the simplified API for the machine in place. The one that reduces the number of methods in the class, and that uses JSON to specify the machine configuration to simplify the types. We might also remove the other complicated structures from the C api, such as the proofs and the log, and use JSON for those as well. I believe we should make the drive labels part of the machine config. At the moment, labels are a Labels might be important when we move to lambda. Or when you have overlays etc. Maybe we should add them to the introspection for memory ranges as well. You could programatically iterate over the memory ranges, filter out the drives, and look at the labels to figure out how to treat them. Or go via configs. What do you think? What other use were you conceiving for the labels? As for the file structure, I would prefer if you separated the specification of what a drive is in the machine (this is the machine structure) from the specification of how to build a certain image file. Perhaps something like this?
|
I don't like that format very much. It's not very TOML'ish to have dynamic keys like that, except when "under" a certain key, like what I did with |
That feature of the cartesi-machine may have a positive impact on this feature of the CLI, because the CLI could either accept a machine JSON from the application, instead of replicating those in a TOML format, and leave the TOML only for drive building procedure definition. The other option would be to continue on this path of defining machine configuration in TOML, and generating a JSON for the cartesi-machine, which will most likely be required anyway when 0.20 comes out, unless you keep compatibility with the currently behavior of What are your thoughts on that @diegonehab |
📚 Context
The current CLI commands like
build
andrun
currently allow some level of customization through the following mechanisms:This process is kind of scattered and makes it hard to allow further customization required by some applications or different frameworks like lambada.
✔️ Solution
Implement build and execution driven by a configuration file.
The configuration will be a TOML file containing sections for machine drives, kernel configuration, runtime configuration, etc.
The configuration file content can be discussed further in this issue.
Ideally the file can be considered optional for a project if all options have a default value.
📈 Subtasks
build
command using the configurationrun
command using the configurationdeploy
command using the configuration🎯 Definition of Done
The text was updated successfully, but these errors were encountered: