wasmCloud / wash

WAsmcloud SHell - the comprehensive command-line tool for wasmCloud development

Home Page:https://wasmcloud.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] excludePaths from nixify not sufficient

arcmode opened this issue · comments

Describe the bug
Trying to build using the flake.nix file fails due to integration tests requiring some services running.

To Reproduce
Steps to reproduce the behavior:

  1. Running on nix (Nix) 2.13.3 from nix --version
  2. System is aarch64-linux on an m1 macbook air.
  3. The command nix run github:wasmCloud/wash fails due to integration errors not being excluded.
  4. See error below
[1/650/652 built, 391 copied (778.2 MiB), 356.7 MiB DL] building wash-deps-0.18
error: builder for '/nix/store/q84d9mbw2v5cq8055lbxnbx1l35k45bi-wash-0.18.0-alpha.1.drv' failed with exit code 101;
       last 10 log lines:
       >
       >
       > failures:
       >     integration_inspect_actor
       >     integration_inspect_cached
       >     integration_inspect_provider
       >
       > test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s
       >
       > error: test failed, to rerun pass `--test integration_inspect`
       For full logs, run 'nix log /nix/store/q84d9mbw2v5cq8055lbxnbx1l35k45bi-wash-0.18.0-alpha.1.drv'.
...
---- integration_inspect_provider stdout ----
thread 'integration_inspect_provider' panicked at 'assertion failed: get_http_client.status.success()', tests/integration_inspect.rs:124:5

---- integration_inspect_cached stdout ----
thread 'integration_inspect_cached' panicked at 'assertion failed: get_http_client.status.success()', tests/integration_inspect.rs:200:5


failures:
    integration_inspect_actor
    integration_inspect_cached
    integration_inspect_provider
...

Expected behavior
Integration files should be excluded by the nixify boilerplate.

**Environment (please complete the following information) **

  • OS: NixOS Linux
  • Shell: zsh
  • wash Version: 0.18.0-alpha

Additional context
Also tried adding the package directly from the flake into my own flake.

after checking out the changes to flake.nix from #429 it seems integration_keys.rs also fails, at least on my machine

running 5 tests
test integration_keys_gen_basic ... FAILED
test integration_keys_gen_comprehensive ... FAILED
test integration_list_comprehensive ... FAILED
test integration_keys_get_comprehensive ... ok
test integration_keys_get_basic ... FAILED

failures:

---- integration_keys_gen_basic stdout ----
thread 'integration_keys_gen_basic' panicked at 'assertion failed: keys_gen_account.status.success()', tests/integration_keys.rs:17:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- integration_keys_gen_comprehensive stdout ----
thread 'integration_keys_gen_comprehensive' panicked at 'assertion failed: key_gen_command.status.success()', tests/integration_keys.r
s:31:9                                                                                                                               

---- integration_list_comprehensive stdout ----
thread 'integration_list_comprehensive' panicked at 'assertion failed: list_output.status.success()', tests/integration_keys.rs:144:5

---- integration_keys_get_basic stdout ----
thread 'integration_keys_get_basic' panicked at 'assertion failed: key_output.status.success()', tests/integration_keys.rs:71:5


failures:
    integration_keys_gen_basic
    integration_keys_gen_comprehensive
    integration_keys_get_basic
    integration_list_comprehensive

test result: FAILED. 1 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

But then if I exclude integration_keys.rs from the check phase and run nix run . up I get the following

~code/wash (main ✗) nix run . up      
warning: Git tree '/home/arcmode/code/wash' is dirty
>>> ⢋⠁  Starting wadm ...                                                                                                     🟨 Couldn't start wadm: No such file or directory (os error 2)

Another wasmCloud host is already running on this machine with PID

But the down command doesn't do anything to fix it.

~code/wash (main ✗) nix run . down
warning: Git tree '/home/arcmode/code/wash' is dirty

Unable to find wasmcloud pid file for stopping process: No such file or directory (os error 2)

after checking out the changes to flake.nix from #429 it seems integration_keys.rs also fails, at least on my machine

running 5 tests
test integration_keys_gen_basic ... FAILED
test integration_keys_gen_comprehensive ... FAILED
test integration_list_comprehensive ... FAILED
test integration_keys_get_comprehensive ... ok
test integration_keys_get_basic ... FAILED

failures:

---- integration_keys_gen_basic stdout ----
thread 'integration_keys_gen_basic' panicked at 'assertion failed: keys_gen_account.status.success()', tests/integration_keys.rs:17:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- integration_keys_gen_comprehensive stdout ----
thread 'integration_keys_gen_comprehensive' panicked at 'assertion failed: key_gen_command.status.success()', tests/integration_keys.r
s:31:9                                                                                                                               

---- integration_list_comprehensive stdout ----
thread 'integration_list_comprehensive' panicked at 'assertion failed: list_output.status.success()', tests/integration_keys.rs:144:5

---- integration_keys_get_basic stdout ----
thread 'integration_keys_get_basic' panicked at 'assertion failed: key_output.status.success()', tests/integration_keys.rs:71:5


failures:
    integration_keys_gen_basic
    integration_keys_gen_comprehensive
    integration_keys_get_basic
    integration_list_comprehensive

test result: FAILED. 1 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

But then if I exclude integration_keys.rs from the check phase and run nix run . up I get the following

~code/wash (main ✗) nix run . up      
warning: Git tree '/home/arcmode/code/wash' is dirty
>>> ⢋⠁  Starting wadm ...                                                                                                     🟨 Couldn't start wadm: No such file or directory (os error 2)

Another wasmCloud host is already running on this machine with PID

But the down command doesn't do anything to fix it.

~code/wash (main ✗) nix run . down
warning: Git tree '/home/arcmode/code/wash' is dirty

Unable to find wasmcloud pid file for stopping process: No such file or directory (os error 2)

Thank you for reporting! I'll fix the build next week (or you are welcome to open a PR with the fix as seems that you already got it working).

A bigger issue, though, is that the resulting binary will not actually work on NixOS, I'd guess that the error about wasmCloud already running is just a broken blanket error, which is reported on any failure of https://github.com/wasmCloud/wasmcloud-otp to actually start - the binary will not ever run on NixOS without patching, which is something wash does not (and should not) do.

I'd say that to natively run wasmCloud on NixOS you should wait for the Rust host being built at https://github.com/wasmCloud/wasmCloud to become a thing, which will take a while.
Until then, to use this today on NixOS, I'd recommend using Docker or Podman.

Other options, which require much more friction, could be:

  1. patching the https://github.com/wasmCloud/wasmcloud-otp binary release to point all dynamically-linked binaries and libraries to the right location, there's documentation at https://nixos.wiki/wiki/C regarding how to do that - note, that this will have to be a two-step process, where you'd first have to patch the self-extracting binary and then patch the actual artifacts extracted. You'd then want to just run it directly and not rely on wash up to actually start anything. Note also, that AFAIK wash still relies on tarballs and not the newer, self-extracting binary introduced in latest version of the actual upstream project being run, but this will change soon.
  2. Add support to wash to point to a custom URL for wasmcloud-otp build to use for wash up, I'm not familiar with wash, but I'm guessing it does not exist @brooksmtownsend ? This URL would then point to the build from (1.), which we could probably do ourselves in CI, but would need to figure out how to build a custom self-extracting binary, since we'd not be able to rely on https://github.com/burrito-elixir/burrito for it.
  3. Add support to wash to run wasmcloud-otp in a docker or podman container

Writing this, I realize you also won't be able to run any of the binary capability providers on NixOS. So running everything in a docker-compose/podman-compose environment is probably the only way to actually try any of this on NixOS without doing a ton of work

Thanks for looking at it and for the thoughtful answer. I will wait for the Rust host and am interested in contributing if it happens to be something I can do within my weekend time. Is the work required for the Rust host already defined? I am reading the Contributing Readme at the wasmCloud repo and will start getting started with it, as I am not familiar with Elixir/Erlang/OTP I see it as a great excuse for myself to spend some time finally learning about it. I have a question about the Rust host, is it meant to replace the Elixir/OTP one or is it meant for development or non large-scale use cases? If meant for production, does it mean you are trying to implement OTP in Rust or just get rid of all the features of OTP as part of the platform?

Update: I read wasmCloud/wasmCloud#324 so I figured the OTP host will be eventually deprecated.

commented

can we keep this open still until the nix build is fixed for cases where you run nix on systems other than nixos? Right now I'm trying to run wash on a fedora vm using nix (since #582 and #581 make me unable to run it otherwise), however its failing with the error from the OP.

@LennyPenny sure, I didn't realize it was valid outside of nixos

Thanks for looking at it and for the thoughtful answer. I will wait for the Rust host and am interested in contributing if it happens to be something I can do within my weekend time. Is the work required for the Rust host already defined? I am reading the Contributing Readme at the wasmCloud repo and will start getting started with it, as I am not familiar with Elixir/Erlang/OTP I see it as a great excuse for myself to spend some time finally learning about it. I have a question about the Rust host, is it meant to replace the Elixir/OTP one or is it meant for development or non large-scale use cases? If meant for production, does it mean you are trying to implement OTP in Rust or just get rid of all the features of OTP as part of the platform?

Update: I read wasmCloud/wasmCloud#324 so I figured the OTP host will be eventually deprecated.

Sorry for late response, but for the time being we will have both hosts, but focus all the development on the Rust one. It's still a bit too early, but soon (maybe even next week), we should be able to define a set of scoped issues that anyone could contribute to. I will ping you once we're done with bootstrapping