Open fschutt opened 2 months ago
Hey @fschutt , long time now see, how are you doing?
Thanks for the feedback. We just had a big revamp of the CLI... there is some fallout.
The problem with wasmer deploy test
is that it doesn't take an argument, and (still!) has the hacky fallback to trying to find a "deploy" package on the registry.
That should be fixed by detecting if a relevant command exists...
cc @xdoardo @syrusakbary
Thanks for creating the issue, we'll investigate and try to address most of the things you commented asap!
Three action items from our side:
wasmer deploy ...
should not go through the run flowwasmer deploy
should wait for y/n inputwasmer login
should finish if the browser completes with: < ... Browser shows "CLI authentication success page" ... >
Hello!
I spent some time investigating these issues, and I'll write here what I found out.
Regarding the first one - wasmer deploy X
reducing to wasmer run deploy...
- this PR was merged and is part of the 4.3.1 release. The current behaviour is this:
$ wasmer deploy X
error: unexpected argument 'X' found
Usage: wasmer deploy [OPTIONS]
For more information, try '--help'.
Regarding the rest, we had no previous experience of the login
and deploy
issues mentioned here - since we mostly use macOS and linux, I tried to reproduce the issues in a Windows VM (Parallels), but I was not able to (sorry in advance for the hard-to-read screenshots).
I downloaded the latest wasmer
binary as shown in the docs ($v="v4.3.1"; iwr https://win.wasmer.io/ -useb | iex
)
As can be seen in the screenshots, I experienced a different issue than those reported here - I guess due to spurious failing SSL handshakes - but which should be fixed with retries as suggested by @fschutt.
Last thing, the wasmer app create
subcommand has, per the release 4.3.1, the --offline
flag that allows users to create locally the files needed to deploy an app. As of now, this does not allow to use templates, which are not embedded in the binary itself but are downloaded from the registry.
Okay, (1) is fixed. It seems that (2) was related to my terminal, I used the Git Bash shell. When I used Windows Terminal, it worked as expected.
I have some criticism regarding the flow of wasmer create flow.
.wasmer
directory is still empty. The token gets saved in the WASMER_DIR, but this fails because the default installation path is C://Program Files (x86)/Wasmer
, which is admin protected. Whatever, I am logged in now.Enter the name of the package? wasmer/hello
seems to be hard coded. I expected it to take into account the previous two questions (owner / package name)wasmer deploy is still not functional, after I now logged in:
wasmer app create --offline
✔ Who should own this app? · fschutt
✔ What should be the name of the app? · m4p
Creating app from a package name running in offline mode
✔ Enter the name of the package · fschutt/m4p // <- I had to retype this from wasmer/hello
✔ Do you want to deploy the app now? · no // <- I am using --offline, so obviously no
Result: nothing happened, I expected it to create an app but no folder was generated, nothing.
EDIT: It created the app.yaml
file, but didn't tell me about it. Please prompt the user with some documentation about app.yaml! From a user perspective, I have no idea what exactly happened now, or what I just "created". I'd expect a "fschutt/m4p" folder (similar to cargo new
) where I could copy my stuff / app / wasmer.toml file into and then tell it to deploy, at least that's how I understand wasmer edge.
I also have no idea what the difference between wasmer deploy
and wasmer app create
is, IMO they should be aliases of each other.
After that I ran wasmer deploy but I can't create the app because it doesn't exist yet (???).
$ wasmer whoami
logged into registry "https://registry.wasmer.io/graphql" as user "fschutt"
$ wasmer deploy
Deploying app m4p (fschutt) to Wasmer Edge...
error: could not create app in the backend
│ 1: could not publish app
╰─▶ 2: GraphQL API failure: The package release `fschutt/m4p@latest` does not exist on the registry.
Yes no shit sherlock... I am trying to create the first version of it! Of course it doesn't exist yet. Now I have to open my browser to "create an app" (I want to create an HTTP server so I can serve my website maps4print.com, whose backend is written in 100% Rust), and run into the next problem, https://docs.wasmer.io/edge/quickstart/http-server is a dead link (the correct link is https://docs.wasmer.io/edge/quickstart/rust-http-server). Please have a dead link scanner or something on docs.wasmer.io, so that this doesn't happen again.
Okay, now when I created the app I forgot to pass in --template
because I didn't know that that was a thing. So I have to destroy the app.yaml file and redo it. Also I have to know beforehand which value the --template
flag accepts, this is not great. It would be best to query available templates from GraphQL during the user flow, then present to the user to select the template (hugo, axum-rust, js, php, etc.)
(3) seems to be because of permission problems when saving the token
That's a good catch, we are going to see how we can fix it. Do you happen to remember how you installed Wasmer so we can try to reproduce the issue? (via cargo install
? Using the pwr
command?)
wasmer.io/login page doesn't have a button for "login with GitHub / Google"
Right now we require you to input the username first, as the login with Github/Google was causing an issue, but we can easily reenable the commented behavior on the login page. (being able to "login with Github / Google" from the /login
page directly, no username input required)
for UX I would ping registry.wasmer.io first to see if it is available and use retries if it doesn't work on the first try
We can investigate this further, we have discussed internally and we don't have a clear idea on how to solve this (perhaps via a --retries
flag?). We need to research a bit more on the ideal case.
in the app create flow, the question Enter the name of the package? wasmer/hello
Oh, I think I know why things were more confusing here. Apps and packages are two different entities.
You can deploy an app that has no "named package" attached, that means that we don't need a package name to deploy an app (please see the CDN example: https://github.com/wasmer-examples/cdn-wasmer-starter, where the wasmer.toml
doesn't have an specific package name).
Just to clarify, the information that we prompt is about the owner and name of the app (not of the package).
In any case, we can move from:
It seems you are trying to create a new app!
✔ Who should own this app? · syrusakbary
✔ What should be the name of the app? · aasa
✔ What would you like to deploy? · Choose an existing package
? Enter the name of the package › wasmer/hello
It seems you are trying to create a new app!
✔ Who should own this app? · syrusakbary
✔ What should be the name of the app? · aasa
✔ What would you like to deploy? · Choose an existing package
? Enter the name of the package to deploy (eg. wasmer/hello) ›
in the app create flow, the flow is stopped if you are not logged in and the questions are confusing ("Do you want to deploy the app now? yes / Do you want to log in? no -> exit")
@xdoardo will investigate further
That's a good catch, we are going to see how we can fix it. Do you happen to remember how you installed Wasmer so we can try to reproduce the issue? (via cargo install? Using the pwr command?)
No, downloading wasmer-windows.exe and double-clicking. The default installation directory is set to C://Program Files (x86)/Wasmer
, so that's what WASMER_DIR
is set to.
Thanks for helping us figure out the issue. I think we have now the steps to reproduce and fix
Describe the bug
Encountered a multitude of bugs when trying out wasmer login / wasmer deploy, just thought I'd give you guys a heads up:
wasmer deploy X
tries to search for a "deploy" user and run a package. Could be done better IMO:wasmer deploy
crashes if user is not logged in, doesn't wait for y/n input (and shows a stack trace instead of allowing the user to log in):wasmer whoami
completely fails ifwasmer login
browser authentication is done with GitHub authentication:So yeah, I cannot log in at all, it seems. Therefore, I cannot use
wasmer login
, therefore I cannot trywasmer deploy
. It might be better to decouplewasmer deploy
fromwasmer login
at least for the app creation phase. It also seems that the server backend sometimes has timeout issues, would be better to implement retries instead of failing on the first try. The backend says "Authentication successful", butwasmer whoami
fails. Also, not sure if it's a good idea to encode secrets in the URL?Also just as a note: if generating UUIDs, use
short-uuid
in order to avoid characters that can mess up in the URL or in a bash script! Do not use underscores or dashes in UUIDs, only "browser-safe" characters (base54)!Using
wasmer-windows.exe
from the4.3.1
release.