nuvolaris / nuvolaris-cli

The Nuvolaris CLI, an all-in-one tool to do all things Nuvolaris
Apache License 2.0
11 stars 21 forks source link

Fix load .wskprops #16

Closed coccus1991 closed 2 years ago

coccus1991 commented 2 years ago

Hi, i tried your CLI on macos envinroment. After the installation of devcluster and then the setup of nuvolaris, i ran into two problems whan i tried to run the subcommand wsk:

1) Parameter apihost is missing.

I have seen that the cli generates the file .wskprops under the folder /${HOME}/.nuvolaris whereas wsk expects to find it in /${HOME}. So i have implemented a manual parsing of the file under .nuvolaris folder and then push the arguments apihost and auth into the final wsk command as arguments.

2) apihost mapped as https instead of http

I changed the constant wsk_apihost

I wanna emphasize that i am not a expert of openwhisk and i could have missed some steps during the suggested configuration that has generated these two issues which i have reported above.

PS: very cool project 👍

msciabarra commented 2 years ago

Thank you for the PR. Actually, the fact that the .wskprops is in .nuvolaris is on purpose, to avoid clashes with anyone using also wsk, nim or ibm functions. nuv embeds wsk, so if you do for example nuv wsk action list it should work and use our .wskprops. Can you please confirm nuv wsk works for you?

coccus1991 commented 2 years ago

Hi, yes i have imagined that you put .wskprops in .nuvolaris in order to avoid mismatching with plain wsk. Infact my implementation doesn't change that, but read the variables programmatically (from /{HOME}/.nuvolaris/.wskprops) and add them to internal embeded wsk command. For answering at your question nuv wsk doesn't work on my envinronment without this implementation or as alternative moving .wskprops outside of .nuvolaris directly into the folder /{HOME}.

msciabarra commented 2 years ago

Hm that is not what is supposed to happen. I will keep open this PR until further investigation, may I ask you to open an issue describing the environment where you cannot use nuv wsk? Note that there is already an issue open and worked on, because currently nuv does not wait until openwhisk is deployed so the first time you try to use nuv wsk you get an error simply because it is not ready.

coccus1991 commented 2 years ago

Maybe i haven't been clear apologize. The cluster and the namespace with nuvolaris are ready and everything works, is only a problem of wsk which doesn't look into .nuvolaris folder for getting the auth parameters. In order to simplify your debuging i've recorded a video: https://asciinema.org/a/cDYtzchj5jJka30QoCyGjkF3Q

msciabarra commented 2 years ago

I checked your fix and you directly load the .wskprops. That is not wrong, however nuv wsk is supposed to ALREADY use the correct .wskprops by setting internally the environemtn variable WSK_CONFIG_FILE, and it worked in my tests. I opened an issue to investigate.

coccus1991 commented 2 years ago

Ok, but with my implementation i wanted overcome the necessity of create a new env variable and create a new convention, that is the loading of .wskprops directly from .nuvolaris folder, even for avoiding collision with a eventual .wskprops which belongs to plain wsk. But of course is a your architectural decision, this my PR was only a proposal! Maybe for who is not so expert of wsk like me would be useful insert the creation of the environment variable as requisite (unless i did not miss it in the readme). See ya!

msciabarra commented 2 years ago

I am not closing the PR, I plan to merge but before I need to fix the bug :)

msciabarra commented 2 years ago

fixed