-
Notifications
You must be signed in to change notification settings - Fork 8
Declarative dependencies #85
Conversation
wasm: out/component.wasm | ||
composedWasm: out/component-composed.wasm | ||
traits: | ||
- type: worker-rpc |
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.
- type: worker-rpc | |
- type: wasm-rpc |
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.
renamed
- type: worker-rpc | ||
properties: | ||
componentName: component-two | ||
- type: worker-rpc |
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.
- type: worker-rpc | |
- type: wasm-rpc |
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.
renamed
spec: | ||
components: | ||
- name: component-one | ||
type: component-durable |
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.
type: component-durable | |
type: durable |
I'm assuming this would be durable
or ephemeral
(no need, I think, to replicate the component
part since it's already in the components
part of the spec
.
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.
since we won't really support anything else (at least for now) we can make them shorter, but if we imagine that we might have different kind of components (e.g. not workers), then we might want to think more about this. note that here the OAM component and our component naming kinda works out now, but the OAM component is something more general. but for now probably we should go with your recommendation.
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.
now that i'm thinking about it, in our model durable and ephemeral are the property of a component version, and not a component, so maybe we use simply wasm
?
or is it okay that in these files it always references the latest one?
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.
renamed, and kept as a component type for now
properties: | ||
wit: wit | ||
wasm: out/component.wasm | ||
composedWasm: out/component-composed.wasm |
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 think we should stay away from 'composed' terminology as much as possible. A user may think in terms of 'output' or 'target', but probably not 'composed'.
composedWasm: out/component-composed.wasm | |
output-wasm: out/component-final.wasm |
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.
renamed, but with using camelCase
type: component-durable | ||
properties: | ||
wit: wit | ||
wasm: out/component.wasm |
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 this legitimately be called input-wasm
???
wasm: out/component.wasm | |
input-wasm: out/component.wasm |
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.
Other parts of the schema follow camelCase.
I do agree on wasm
and composedWasm
not being good names, i'm just afraid that using input
and output
can be also confusing, given the input is the output of the build step, and e.g. in golem-cli, if we reach the point of not having to compose on the client side, we would have an input wasm alone, or if we would have some other tooling integration, this would be confusing. Given currently this is the property of the component, and not the dependency trait itself - where the input would totally make sense - i'm a bit unsure on this naming. (And we probably do not want to move these to the deps trait, because then it would be redundant when having multiple dependencies)
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.
but happy to change it for now, and let's how it feels
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.
renamed, but with using camelCase
…al validation model
One question, based on the description only: |
wasm-rpc-stubgen/src/lib.rs
Outdated
@@ -40,6 +41,12 @@ pub enum Command { | |||
/// Initializes a Golem-specific cargo-make configuration in a Cargo workspace for automatically | |||
/// generating stubs and composing results. | |||
InitializeWorkspace(InitializeWorkspaceArgs), | |||
/// TODO | |||
#[cfg(feature = "unstable-dec-dep")] | |||
Declarative { |
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 hope this won't be the final name of the command :)
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.
no, this is just the WIP name while it is still behind a feature
commands::dependencies::add_stub_dependency( | ||
&app.stub_wit(dep_component_name), | ||
&app.component_wit(component_name), | ||
true, // TODO: is overwrite ever not needed? |
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 added it to protect the potentially user-written files from getting overwritten. I think in the declarative mode, especially if we do the next planned step which moves the user-defined part "inside", we can assume that all wit directories are managed by this tool so it can freely modify everything except the original user defined wit specs.
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.
Added a note about always using true for this in declarative mode
@vigoo for the ephemeral / durable: if it's okay to have incompatible yaml formats, the we can make it different here (as component-type is mandatory in this model) Another option could be using "component" or "golem" as component type, and only add durability as a property in golem-cli. That way it would compatible and probably even easier to extend in golem-cli. |
… and can be an optional property there) and use "wasm" naming
After discussing with @vigoo:
|
…em sequentially to avoid parallel cargo build problems
Implemented:
Example specification:
Some screenshots about coloring and validation:
TODO:
TODO In follow up PR: