Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

feat(*) wash burrito support #556

Merged
merged 9 commits into from
Jun 13, 2023
Merged

feat(*) wash burrito support #556

merged 9 commits into from
Jun 13, 2023

Conversation

brooksmtownsend
Copy link
Member

@brooksmtownsend brooksmtownsend commented May 15, 2023

Feature or Problem

This PR adds support for running wasmCloud/wasmcloud-otp#616 artifacts (burrito releases) with wash up. This will be a significant breaking change and will bump the minimum wasmCloud version that wash can manage from 0.57.1 (when we stopped using distillery) to 0.63.0.

PR action items:

  • Add support to launch burrito releases with wash up
  • Stop burrito-release launched hosts with wash down
  • Add maintenance uninstall to the wash drain command (I think this can be done in a separate PR since burritos auto-upgrade)
  • Test on multiple platforms (Works on aarch64 mac, aarch64 linux, and x86 Windows)
  • General code cleanup, TODOs left around the implementation

Related Issues

Fixes #464 after pulling in implementation from #527
Fixed #492

Release Information

wash v0.18.0
wash-lib v0.9.0

?? We may need to hold on merging this PR until we can release 0.18 as scheduled
Changed to v0.18.0 as it makes sense to release this with wadm

Consumer Impact

Consumers won't notice a difference with running the wasmCloud host, only that the downloaded assets are a single binary wasmcloud_host instead of a tarball-ed directory

Testing

Built on platform(s)

  • x86_64-linux
  • aarch64-linux
  • x86_64-darwin
  • aarch64-darwin
  • x86_64-windows

Tested on platform(s)

  • x86_64-linux
  • aarch64-linux
  • x86_64-darwin
  • aarch64-darwin
  • x86_64-windows

Unit Test(s)

Acceptance or Integration

Manual Verification

As of creation, I've run cargo run -- up and cargo run -- up -d which worked great. down now works by using NATS to tell hosts to stop instead of executing the mix release, and I've verified that a variety of scenarios work well.

  1. Stopping one host when multiple are running do not stop NATS/wadm
  2. Stopping the only host will stop all resources
  3. Not specifying a host ID will exit early and display the running hosts to the user
  4. Trying to stop a host when nothing is running will clean up NATS and wadm

@brooksmtownsend brooksmtownsend force-pushed the feat/wash-burritos branch 2 times, most recently from 5af671e to fa2bbba Compare May 17, 2023 15:50
Comment on lines +8 to +9
[lib]
crate-type = ["cdylib", "rlib"]
Copy link
Member Author

Choose a reason for hiding this comment

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

note: this change to the test artifact lets people run cargo install --git <this repo> again. cargo was picking this crate up as a binary you could install

src/up/mod.rs Outdated Show resolved Hide resolved
Comment on lines 160 to 170
// NOTE(brooksmtownsend): This seems like a lot of work when I really just want to use AsyncRead
// to pipe the response body into a file. I'm not sure if there's a better way to do this.
let download_response = reqwest::get(url.clone()).await?;
if download_response.status() != StatusCode::OK {
return Err(anyhow!(
"Failed to download wasmCloud host from {}. Status code: {}",
url,
download_response.status()
));
}
let wasmcloud_host_burrito = reqwest::get(url).await?.bytes().await?.to_vec();
Copy link
Member Author

Choose a reason for hiding this comment

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

@thomastaylor312 Line 170 is the one that feels weird, in tandem with having to copy it with .as_slice()

@brooksmtownsend brooksmtownsend marked this pull request as ready for review June 5, 2023 18:40
@brooksmtownsend brooksmtownsend requested a review from a user June 5, 2023 18:40
Copy link
Contributor

@connorsmith256 connorsmith256 left a comment

Choose a reason for hiding this comment

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

Just nits and questions

crates/wash-lib/src/start/wasmcloud.rs Outdated Show resolved Hide resolved
crates/wash-lib/src/start/wasmcloud.rs Show resolved Hide resolved
crates/wash-lib/src/start/wasmcloud.rs Outdated Show resolved Hide resolved
crates/wash-lib/src/start/wasmcloud.rs Show resolved Hide resolved
src/down/mod.rs Outdated Show resolved Hide resolved
src/up/mod.rs Outdated Show resolved Hide resolved
src/up/mod.rs Outdated Show resolved Hide resolved
src/up/mod.rs Show resolved Hide resolved
src/up/mod.rs Outdated Show resolved Hide resolved
connorsmith256
connorsmith256 previously approved these changes Jun 6, 2023
Copy link
Contributor

@connorsmith256 connorsmith256 left a comment

Choose a reason for hiding this comment

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

:shipit:

connorsmith256
connorsmith256 previously approved these changes Jun 9, 2023
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>

cleanup TODOs, satisfy clippy

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

addressed test failures

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

v2

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

same port fail

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

un-re-de-comment integration build

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

removed test debugs

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

removed moar printlns

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

cfg idk

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

sleepy

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

sleepy

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

added debug info to failing test

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

removed kill-on-drop logic

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.

One really minor change around the default wasmcloud version. The rest is all optional

crates/wash-lib/src/start/wasmcloud.rs Show resolved Hide resolved
crates/wash-lib/src/start/wasmcloud.rs Outdated Show resolved Hide resolved
crates/wash-lib/src/start/wasmcloud.rs Show resolved Hide resolved
src/up/config.rs Outdated Show resolved Hide resolved
@brooksmtownsend brooksmtownsend merged commit 812f0e0 into main Jun 13, 2023
@brooksmtownsend brooksmtownsend deleted the feat/wash-burritos branch June 13, 2023 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Archived in project
3 participants