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

Provide steps to re-deploy after restarting Vagrant VM #596

Closed
lfzCarlosC opened this issue Jun 8, 2016 · 19 comments
Closed

Provide steps to re-deploy after restarting Vagrant VM #596

lfzCarlosC opened this issue Jun 8, 2016 · 19 comments
Milestone

Comments

@lfzCarlosC
Copy link

problem description

For Hello case
./wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result

returns "error: [Errno 111] Connection refused"

steps to reproduce

  1. Clone openwhisk
    git clone --depth=1 https://github.com/openwhisk/openwhisk.git
  2. Change directory to tools/vagrant/simple
    cd openwhisk/tools/vagrant/simple
  3. Run script to create vm and run hello action
    vagrant up
    ./wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result
@lfzCarlosC
Copy link
Author

I try the quickcase following the guide https://github.com/openwhisk/openwhisk

@lfzCarlosC
Copy link
Author

I run it locally on my laptop

@rabbah rabbah assigned rabbah and csantanapr and unassigned rabbah Jun 8, 2016
@csantanapr
Copy link
Member

This reminds me to ask, @rabbah or @domdom82 do you know if Travis supports vagrant?

It will be awesome to have automate tests checking the vagrant use cases.

@csantanapr
Copy link
Member

csantanapr commented Jun 9, 2016

Hi @lfzCarlosC could you provide more info on your environment to be able to reproduce?

I tried today with latest hash bf3fe240ff56f772837f7c9ccf909483b1893a8c

I'm using Mac OSX El Capitan

$ uname -a
Darwin carlosmac.ibm.com 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
$ vagrant -v
Vagrant 1.8.1
Virtual Box Version 5.0.20 r106931

I clean ~/.vagrant.d/ just in case
I made sure no whisk VMs are listed or running on Virtual Box
No other VMs are running
Steps:

$ rm -rf ~/.vagrant.d/
$ git clone --depth=1 https://github.com/openwhisk/openwhisk.git
$ cd openwhisk/tools/vagrant/simple/
$ ./hello

wait for a while, downloading new vagrant ubuntu to cache (10 minutes) then whisk setup (20 minutes)

==> default: ++ bin/wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result
==> default: {
==> default:     "message": "hello"
==> default: }
{
    "message": "hello"
}
$ git log
commit bf3fe240ff56f772837f7c9ccf909483b1893a8c
Author: Perry Cheng <perry@us.ibm.com>
Date:   Wed Jun 8 21:34:48 2016 -0400

@lfzCarlosC
Copy link
Author

I clean all the things and re-ran the whole steps,This time the behaviour is a little bit different. Hello action work fine the first time when vagrant vm is created , but then if I try to restart vm(via GUI from virtual box) and run hello action , the error happens.I will attach the log info then

@domdom82
Copy link
Contributor

domdom82 commented Jun 9, 2016

@csantanapr I have run a travis build that does install a vagrant box. It would work in theory, however you need to install virtualbox first which in conjunction with our own build + test flow takes longer than travis allows on the free tier and the build gets killed. I suggest making a build on our Jenkins that does a vagrant up and checks the output.

@csantanapr
Copy link
Member

csantanapr commented Jun 9, 2016

@lfzCarlosC Ah I think you are hitting some of the UX, we are seeing and working on fixing.
Restarting I think will cause problems, since you have to deploy ant deploy but the inmortal DB is not up. @houshengbo is working on fixing this workflow.

For now don't restart the VM, just suspend it and then up (not resume). you can use vagrant cli, we have that in the [simple/README.md(https://github.com/openwhisk/openwhisk/blob/master/tools/vagrant/simple/README.md)

# Suspend vagrant vm when done having fun
  vagrant suspend

# Resume vagrant vm to have fun again
  vagrant up

@csantanapr
Copy link
Member

@domdom82 thanks for volunteering 😆

I suggest making a build on our Jenkins that does a vagrant up and checks the output.

I would prefer to see something externally test this, but I guess for now we will use an internal server, but even with that I will suggest to have all the scripts in open (i.e. tools/travis/test-vagrant.sh)

@sjfink
Copy link
Contributor

sjfink commented Jun 9, 2016

I don't think you can run vagrant inside an SL VM. Virtualization inside virtualization usually doesn't work.

@domdom82
Copy link
Contributor

domdom82 commented Jun 9, 2016

relate issue #311

@csantanapr csantanapr added this to the MILESTONE 7 milestone Jun 9, 2016
@lfzCarlosC
Copy link
Author

But I was considering a real development case.If I developed new updates for action/trigger/rule and test it on local vagrant env, next time these updates are not useful because I am not allowed to restart the vm? Or what is the process of development based on local vagrant env?

@rabbah
Copy link
Member

rabbah commented Jun 9, 2016

I don't understand the last comment. If you restart the vm you expect the whisk deployment to still be up?

@lfzCarlosC
Copy link
Author

let us consider a case. If I develop an action A on vagrant vm from my host machine, and then the vm for some reasons dump ,so how should I do to make action A rerun?

@csantanapr
Copy link
Member

Suspending the machine is like shutting it down. It doesn't take resources. Just suspend , when you start the VM your actions, rules, etc are still available.

We also have a custom setup where you can use a persistent remote DB like cloudant or a remote CouchDB

Regardless if you restart the VM the whisk system doesn't start automatically, you need to deploy/start the whisk system.

@lfzCarlosC
Copy link
Author

So, can I use this guide https://developer.ibm.com/open/2016/02/22/openwhisk-a-quick-tech-preview/ if I want to deploy whisk system once I need?

@domdom82
Copy link
Contributor

Regardless if you restart the VM the whisk system doesn't start automatically, you need to deploy/start the whisk system.

@csantanapr not entirely true. The system should come back up in general. Ephemeral couch is a different story, however. If you use cloudant or other peristent db it should recover from a reboot. Part of our RAS strategy.

@lfzCarlosC
Copy link
Author

lfzCarlosC commented Jun 10, 2016

@csantanapr I clean up my history cache file and re run today. But a different error happens.This is the link

#624

csantanapr pushed a commit to csantanapr/incubator-openwhisk that referenced this issue Jun 14, 2016
csantanapr pushed a commit to csantanapr/incubator-openwhisk that referenced this issue Jun 14, 2016
@rabbah rabbah closed this as completed in e8e839a Jun 15, 2016
jberstler pushed a commit to jberstler/openwhisk that referenced this issue Jun 16, 2016
@csantanapr csantanapr changed the title error: [Errno 111] Connection refused Provide steps to re-deploy after restarting Vagrant VM Jun 30, 2016
@csantanapr
Copy link
Member

I'm working on providing instructions on how to re-deploy openwhisk after restarting the Vagrant VM.

@csantanapr
Copy link
Member

This is fix now instructions in vagrant/README.md

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

No branches or pull requests

5 participants