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

Fix vagrant not use runc #3546

Merged
merged 3 commits into from Apr 19, 2018
Merged

Conversation

csantanapr
Copy link
Member

@csantanapr csantanapr commented Apr 13, 2018

  • minimum build (only builds nodejs)
  • do not use runc by default (readme instruction on how to get runc working)
  • build cli from source
  • cleaned up the readme a bit

Travis doesn't support vagrant, I tried linux and osx.

@csantanapr csantanapr added the wip label Apr 13, 2018
@chetanmeh
Copy link
Member

May be we can pin Docker version to one where runc works. As while working on Mac if I need to try/test out any runc related aspect I rely on Vagrant image. So if it works with some older version we can pin Docker to that and keep runc enabled

@csantanapr
Copy link
Member Author

May be we can pin Docker version to one where runc works. As while working on Mac if I need to try/test out any runc related aspect I rely on Vagrant image. So if it works with some older version we can pin Docker to that and keep runc enabled

The problem vagrant is using ubuntu16 and installs latest stable, for example 18.03.0-ce, so the invoker image would need to be rebuild with the matching version.

If you are trying and testing runc related things, then is better to experiment with the latest stable release.

I added docs for this special case, for an user to experiment with runc.

The version we recommend and we currently test in Travis and have it pinned in the invoker is an older version 1.12

@csantanapr csantanapr added review Review for this PR has been requested and yet needs to be done. and removed wip labels Apr 16, 2018
@csantanapr
Copy link
Member Author

I was able to figure out how to increase the size of the disk with a vagrant plugin.

@mdeuser check if the plugin works on windows.

@csantanapr
Copy link
Member Author

csantanapr commented Apr 18, 2018

@mdeuser can you test this branch one more time.

I remove the disksize plugin since you reported problems running on Windows.

I just a got a clean deploy

    default: Swagger UI URL: https://192.168.33.16/api/v1/docs/index.html?url=/api/v1/api-docs
    default: ++ echo 'Swagger UI URL: https://192.168.33.16/api/v1/docs/index.html?url=/api/v1/api-docs'
    default: ++ wsk action invoke /whisk.system/utils/echo -p message hello --result
    default: {
    default:     "message": "hello"
    default: }
    default: +++ date
    default: ++ echo 'Wed Apr 18 01:21:10 UTC 2018: build-deploy-end'

skipping the runtimes I was able to not run out of disk space

vagrant@ubuntu-xenial:~$ df -h
Filesystem              Size  Used Avail Use% Mounted on
udev                    2.0G     0  2.0G   0% /dev
tmpfs                   396M  6.3M  389M   2% /run
/dev/sda1               9.7G  5.4G  4.3G  56% /
tmpfs                   2.0G     0  2.0G   0% /dev/shm
tmpfs                   5.0M     0  5.0M   0% /run/lock
tmpfs                   2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs                   396M     0  396M   0% /run/user/1000
vagrant                 466G  412G   55G  89% /vagrant
home_vagrant_openwhisk  466G  412G   55G  89% /home/vagrant/openwhisk

My timings:

vagrant@ubuntu-xenial:~$ cat /tmp/vagrant-times.txt
Wed Apr 18 01:03:47 UTC 2018: ubuntu-setup-start
Wed Apr 18 01:06:41 UTC 2018: ubuntu-setup-end
Wed Apr 18 01:06:42 UTC 2018: couchdb-setup-start
Wed Apr 18 01:07:20 UTC 2018: couchdb-setup-end
Wed Apr 18 01:07:27 UTC 2018: build-core-start
Wed Apr 18 01:15:30 UTC 2018: build-core-end
Wed Apr 18 01:15:30 UTC 2018: build-cli-start
Wed Apr 18 01:18:13 UTC 2018: build-cli-end
Wed Apr 18 01:18:13 UTC 2018: deploy-start
Wed Apr 18 01:21:10 UTC 2018: build-deploy-end

@chetanmeh
Copy link
Member

@csantanapr Are the steps to change box size similar to one posted by @neerajmangal here. In that case can we at least leave the config in Vagrantfile and just document steps on how to increase the size

@csantanapr
Copy link
Member Author

@chetanmeh not the same procedure

At least in OSX I was able to use a vagrant plugin to which requires one line in Vagrant :-) tonset new size of disk like 50GB
But this didn’t work on Windows :-( will need to dig with @mdeuser on why it doesn’t work

Another option is to create a second disk and configure docker to use it for images, but I have not figure out how easy to do that.

My intention is to merge this PR to unblock folks and deal with building all images later if required.

@chetanmeh
Copy link
Member

chetanmeh commented Apr 18, 2018

At least in OSX I was able to use a vagrant plugin to which requires one line in Vagrant

Can you share the command so that at least Mac users can workaround if required

My intention is to merge this PR to unblock folks and deal with building all images later if required.

+1. Makes sense to deal with this later. For now ~4GB of free space should be good enough

@csantanapr csantanapr requested a review from mdeuser April 18, 2018 18:25
## Safe Re-deploy (after VM restart)
## Using docker-runc
Only for experimental use:
To use docker-runc the docker-runc CLI use in the invoker needs to match the version on the docker engine host.
Copy link
Contributor

Choose a reason for hiding this comment

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

"To use docker-runc, the docker-runc CLI used in by the invoker"

@@ -156,6 +158,14 @@ vagrant ssh
wsk action invoke /whisk.system/utils/echo -p message hello --result
```

## Other Runntimes
The default vagrant deploy only deploys nodejs:6 runtime kind, as the image runs out of space if all runtimes are built.
Copy link
Contributor

Choose a reason for hiding this comment

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

"runtime kind , asbecause the image runs"

The CLI is available in `../../bin`. There you will find binaries specific to
various operating systems and architectures (e.g. `../../bin/mac/amd64/wsk`).
The CLI is available in `../../bin`.
The CLI in `../../bin/wsk` would be for Linux amd64.
Copy link
Contributor

Choose a reason for hiding this comment

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

"The CLI in ../../bin/wsk would be is"

## Using docker-runc
Only for experimental use:
To use docker-runc the docker-runc CLI use in the invoker needs to match the version on the docker engine host.
Get the version of the docker engine like the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this to find the version of the docker-runc CLI used for deploying openwhisk docker images or the one used by the invoker? i'm thinking this is the former.. probably should say so for clarity

$ docker version | grep Version
Version: 18.03.0-ce
```
Update the Invoker Dockerfile to download a newer version of the docker-cli
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this sentence is implying

  1. compare the docker-runc version obtained on the local system against the docker-runc configured for the invoker
  2. if the versions are different, only then do you need to update the invoker dockerfile to point to the matching docker download

```
Then update line with the curl download command like
```
RUN curl -sSL -o docker-${DOCKER_VERSION}.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz && \
Copy link
Contributor

Choose a reason for hiding this comment

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

just wondering. the current line is RUN curl -sSL -o docker-${DOCKER_VERSION}.tgz https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz && \ it's interesting that the docker 1.12.0 version has a different download template URL (i.e. host name is different, some path segments are different), so i'm wondering if this path may be docker version specific..?

Copy link
Member Author

Choose a reason for hiding this comment

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

newer version have a different location.

ansible-playbook -i environments/local initdb.yml
# recreate main db for entities
ansible-playbook -i environments/local wipe.yml
# teardown all containers expect couchdb container
Copy link
Contributor

Choose a reason for hiding this comment

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

"expect except" typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

actually is all container to take down

su vagrant -c 'ansible-playbook -i environments/local setup.yml'
su vagrant -c 'ansible-playbook -i environments/local prereq.yml'
su vagrant -c 'ansible-playbook -i environments/vagrant setup.yml'
su vagrant -c 'ansible-playbook -i environments/vagrant prereq.yml'
Copy link
Contributor

Choose a reason for hiding this comment

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

currently, the -i environments/local is used for vagrant installations. will that continue to work with this new vagrant installation/environment?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes for the most part is the same

```
Then update the ansible configuration to enable the use of runc, edit [](../../ansible/environments/vagrant/group_vars/all)
```
invoker_use_runc: true
Copy link
Contributor

Choose a reason for hiding this comment

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

will the following Vagrantfile command update in this PR
su vagrant -c 'ansible-playbook -i environments/vagrant openwhisk.yml -e invoker_use_runc=False'
override that ansible property value?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@csantanapr
Copy link
Member Author

@mdeuser updated the readme with your comments.

@mdeuser mdeuser merged commit e9aa8e9 into apache:master Apr 19, 2018
BillZong pushed a commit to BillZong/openwhisk that referenced this pull request Nov 18, 2019
* fix vagrant to not use runc

* setup gitattributes for auth files

* address review comments for readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Review for this PR has been requested and yet needs to be done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants