Open thomastaylor312 opened 2 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!
Definitely not stale -- working on this now!
Note that wash dev
is now available in the latest version of wash
, v0.34.0
[EDIT] "not" -> "now"
This proposal is to detail a suggested overhaul of the developer experience for those writing components for wasmCloud (although this experience would technically work for anyone working on components). Currently this is more focused on the inner dev loop for components and not providers, although what is defined here could be easily extended to providers in the near-to-medium term future.
Background
This proposal requires a bit of background context to explain the why behind it. One of the key things to understand about how wasmCloud as a project approaches design problems is that we focus on separation of concerns. This is why non-functional requirements are entirely externalized and we focus on developers writing their code while platform engineers and SREs "wire it in" to their platform with whatever dependencies, configuration, and credentials they see fit. This separation of concerns is a key feature of wasmCloud. To restate; devs should rarely care about specific dependencies they need, leaving that to their platform. This means developers should rarely be editing wadm manifests. This key detail is critical for understanding the direction in this proposal.
Key goals
With that in mind, the main thrust of the proposal is that
wash dev
becomes the "platform" for local devs, meaning that it should handle wiring up dependencies. So the main outcomes of this work should be:This proposal is intentionally scoped as small as possible so we can use it as a good foundation on which to build. I currently see this evolving in 3 stages:
wash build
to compile multiple components or providers with one command.wash dev
while the other parts of the project fallback to configured defaultsPlease keep in mind this proposal is only focused on that first stage.
User experience
The user experience should be as simple as this:
The user can then edit their code and on save, the component is rebuilt and redeployed if the build is successful.
Supported automatic linking
By default, all wasi-cloud interfaces and any other common wasmCloud interfaces (like the control interface and wadm) will be supported. After build, wash will introspect the component and figure out which interfaces are being imported and exported. It will then consult its list of built-ins or configured options and generate a wadm manifest on the fly for the built component.
By default we will use the following providers:
Once they are ready, we will also support the control interface provider and the wadm provider.
In addition to the providers,
wash dev
should also start the NATS secrets implementation to support secretsNOTE: Although not part of this phase of work, when we support running a whole repo of components and providers (stage 2),
wash
should automatically fulfill those as well (such as linking two components that export/import an interface from another component—you can see where this gets pretty exciting and cool.)Saving generated manifests
wash dev
should have a flag, such as--output-manifest </path/to/file.yaml>
that will output the generated manifest to a file. Depending on the implementation of the commandwash dev
SHOULD delete the application before shutting down, so this flag would allow the user to save a generated manifest for later consistent use. This generated manifest could be a candidate for deploying to production if only wasmCloud first-party providers are needed.Configuring links and defaults
For most people starting off, these defaults should suffice. However, there will be many needs to override and/or configure the different dependencies. It can also be used to specify custom dependencies not built in to
wash dev
by default. I propose that this be done at a project level using thewasmcloud.toml
file and at a global level using a newdev.toml
file located in the wash dir. I am not married to this file name or location. It could be folded into an existing file as well. All that matters is that the data is structured properly.This will be done by adding a new section to the wasmCloud toml that looks like something below. The global config will follow the same format. This is meant mostly to be a guideline and it may differ when actually implemented. Functionality of the config is documented inline:
Running in production
None of this affects how the component will eventually be run in production. Because everything is behind an interface, the finished component can be handed to a platform team who will create (most likely through automatic generation) a Wadm manifest or deploy it through any other process desired.
wash dev
is purely for local development.