Skip to content
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

Updates to wadm to support wasmCloud 1.0 #247

Merged
merged 18 commits into from
Apr 8, 2024
Merged

Conversation

brooksmtownsend
Copy link
Member

@brooksmtownsend brooksmtownsend commented Mar 4, 2024

(last updated 3/6 3:48PM EST) wadm builds now and so do the tests, so next step is getting unit tests to work and then moving to integration tests. This will involve making the necessary changes to models to support interface link definitions and configuration, and then for integration tests we'll likely approach the same tests with new application manifests.

(last updated 4/3 9:30PM EST) This PR will test against the first release candidate of 1.0 for wasmCloud, and seek to implement the minimal viable functionality with parity today. I'll create a separate issue to track restoring full integration tests, adding a ConfigScaler, etc.

Feature or Problem

This PR updates wadm to support deploying components, providers, creating links and referencing named configurations inside of links. This required updates to the manifest format itself, detailed below in consumer impact. To sum it up in just a few words, nearly all of the state handling code, control interface interactions, and code related to links needed to change for 1.0 (for the better!) hence the wide variety of changes in this PR.

Related Issues

Filed #253 and #252 as followups.

Release Information

wadm v0.11.0

Consumer Impact

Any consumers of wadm will need to update their manifests to match the new format. Some changes are done in a way that won't be breaking (removing contract_id and link_name from the provider manifest.) The breaking change that developers should pay attention to is in the link.

Previous (wadm 0.10.0) format:

  - type: linkdef
    properties:
      target: httpserver
      values:
        address: 0.0.0.0:8080

New format:

  - type: link
    properties:
      target: hello
      namespace: wasi
      package: http
      interfaces: [incoming-handler]
      source_config:
        - name: httpaddr
          properties:
            address: 0.0.0.0:8080

As of wasmCloud 1.0, links are unidirectional, so the link trait property should go under the component which is the source of the link, and target the other component in the manifest as it did before. Additionally, links are specifically connecting a component or provider's imported WIT function to another component or provider's exported WIT function, so instead of specifying a contract here we specify the namespace, package, and interfaces that will need to be linked.

Testing

Unit Test(s)

Almost all unit tests were modified in order to either accompany new state changes, reduced burden of event handling, or the new manifest format. No unit tests were removed, but I did add a few new ones that handle creating component IDs automatically on behalf of the user.

Acceptance or Integration

Manual Verification

We've manually verified a few working applications deployed with this new wadm on wasmCloud v1.0.0-alpha.4

@brooksmtownsend brooksmtownsend force-pushed the feat/1.0-updates branch 4 times, most recently from a390015 to ca5d7c5 Compare March 6, 2024 23:21
src/commands/mod.rs Show resolved Hide resolved
src/commands/mod.rs Show resolved Hide resolved
src/model/mod.rs Show resolved Hide resolved
src/model/mod.rs Outdated Show resolved Hide resolved
src/scaler/daemonscaler/mod.rs Outdated Show resolved Hide resolved
src/scaler/manager.rs Show resolved Hide resolved
src/scaler/spreadscaler/link.rs Outdated Show resolved Hide resolved
src/scaler/spreadscaler/link.rs Show resolved Hide resolved
src/scaler/spreadscaler/link.rs Outdated Show resolved Hide resolved
src/storage/state.rs Show resolved Hide resolved
@brooksmtownsend brooksmtownsend changed the title WIP: Updates to wadm for wasmCloud 1.0 Updates to wadm to support wasmCloud 1.0 Apr 4, 2024
Signed-off-by: Brooks Townsend <[email protected]>

everything but scalers compile

Signed-off-by: Brooks Townsend <[email protected]>

commands, events, scaler, server, workers compile

Signed-off-by: Brooks Townsend <[email protected]>

scalers compile

Signed-off-by: Brooks Townsend <[email protected]>

all but link scaler

Signed-off-by: Brooks Townsend <[email protected]>

tests running!

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>

test(e2e): wip update to 1.0 manifests

Signed-off-by: Brooks Townsend <[email protected]>

test(e2e_multiple_hosts): update to 1.0

Signed-off-by: Brooks Townsend <[email protected]>

test(e2e_multiple_hosts): update for 1.0

Signed-off-by: Brooks Townsend <[email protected]>

at least

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>

feat(*)!: handle component_scale events

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

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

Some additional feedback. Unless otherwise noted, the callouts of s/actor/component are optional except for user facing things like the model or public facing documentation. That code will likely be some of the most used (for parsing manifests and other things in the wasmcloud-operator at the least) so that should have things replaced with components

src/commands/mod.rs Outdated Show resolved Hide resolved
src/events/data.rs Outdated Show resolved Hide resolved
src/events/types.rs Show resolved Hide resolved
src/events/types.rs Show resolved Hide resolved
src/model/mod.rs Outdated Show resolved Hide resolved
src/scaler/manager.rs Outdated Show resolved Hide resolved
src/scaler/spreadscaler/mod.rs Outdated Show resolved Hide resolved
src/storage/state.rs Outdated Show resolved Hide resolved
src/workers/event.rs Outdated Show resolved Hide resolved
tests/e2e.rs Show resolved Hide resolved
@brooksmtownsend brooksmtownsend marked this pull request as ready for review April 8, 2024 17:15
thomastaylor312
thomastaylor312 previously approved these changes Apr 8, 2024
@brooksmtownsend brooksmtownsend merged commit b6febbb into main Apr 8, 2024
3 checks passed
@brooksmtownsend brooksmtownsend deleted the feat/1.0-updates branch April 8, 2024 20:12
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.

2 participants