80 Commits

Author SHA1 Message Date
Lance Bragstad
8e0e94ba9b Register default network policies in code
This commit uses the existing policy-in-code module to move all
default policies for networks into code. This commit also adds
helpful documetation about each API those policies protect, which
will be generated in sample policy files.

bp policy-and-docs-in-code

Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: I3d5486c2b4d696c364eef1d16db403db6504da70
2017-10-10 05:32:33 +00:00
Kien Nguyen
8fa8843dbc Check glance is enabled or not
- Check glance is enabled or not before upload sandbox
image to glance.
- Remove unused function is_zun_enabled.

Change-Id: I426298816e1144c66fd13f21949afdb058bce9cb
Closes-Bug: #1650245
2017-10-05 11:17:07 +07:00
Jenkins
7c34835223 Merge "Remove SCREEN_LOGDIR from devstack setting" 2017-09-22 06:19:05 +00:00
deepakmourya
e81ff780b2 Remove SCREEN_LOGDIR from devstack setting
Screen support has been completely removed from devstack.
So we don't need anymore

[1] the change id of I8c27182f60b0f5310b3a8bf5feb02beb7ffbb26a
    the change set of  cdba1b371628aa0e8bc5b687351c5ee9b39e9bc6

Change-Id: Id0b5243746aaf519d2f7e887bdbfe9d0a9e78c2f
2017-09-21 14:32:48 +05:30
Pradeep Kumar Velusamy
08d7d18d05 Modifying devstack link in README.rst
Change-Id: Ide92883fbb7e1ab4128253d2173a8f4504b68424
2017-09-20 22:18:33 +05:30
Hongbin Lu
6dc2866167 Mova NovaDocker driver to contrib
We decided to deprecated NovaDocker driver in the team meeting [1].
Therefore, we moved the driver to the contrib folder. NovaDocker
was an experimental driver that attempts to leverage Nova to provide
networking to containers. However, as kuryr integration implemented,
this driver is not needed anymore.

[1] http://eavesdrop.openstack.org/meetings/zun/2017/
    zun.2017-07-11-03.00.log.html

Change-Id: I770fe13a004dc56ad20fe8eca545f05c4504e48e
2017-09-14 12:09:47 -04:00
Jenkins
d2eb42646f Merge "Needn't separately process start_zun_compute" 2017-09-12 10:21:33 +00:00
Feng Shengqin
e26ab1a8aa Needn't separately process start_zun_compute
Change-Id: I191b2ca1c4d33acbf64a096845496c0807c5e989
2017-09-11 16:57:18 +08:00
Feng Shengqin
488b9f6573 Fix the name of stop_zun_etcd
Change-Id: I92ab8f89c13bf43b1aaef5cb490095445d1303f4
2017-09-11 16:47:08 +08:00
Hongbin Lu
4d0a4f8b02 Make docker cluster store point to right cluster
Devstack set the docker cluster store to point to the etcd cluster
in current host. In multinode gate, each node setup an independent
etcd cluster so docker in each host uses an independent store.
This will result in an issue that resources (i.e. network) created
in one node cannot be found in another node.

This commit fix it by making all nodes use the same etcd cluster
in service host.

Partial-Implements: blueprint multi-node-ci
Change-Id: Ieeecc2ef14a1077a2ef91ee369b317f53d7ffb81
2017-09-01 10:38:13 -04:00
Kien Nguyen
9a64e23333 [Multinode gate] Fix error failed to update store
By default, kuryr-libnetwork set DOCKER_CLUSTER_STORE to localhost [1]
It will raise error failed to update store [2]

NOTE: This fix won't fix all error with multinode gate. The gate still failed
      because the error KuryrException: Another pool with same cidr exist.

[1] https://github.com/openstack/kuryr-libnetwork/blob/master/devstack/settings#L23
[2]
http://logs.openstack.org/11/494111/11/experimental/gate-tempest-dsvm-zun-multinode-docker-sql-ubuntu-xenial-nv/d2145e8/logs/screen-zun-compute.txt.gz#_Aug_20_06_16_07_462697

Change-Id: I95baae5d42af6a61ddf684673433621297f000ab
2017-08-21 09:43:32 +07:00
Kevin Zhao
51f54b8e7b Add new entrypoint 'experimental' for capsules
According to the comment in https://review.openstack.org/#/c/484602/,
introduce the new api endpoint for capsules will reduce the API burden
when changing.

Change-Id: Ia686406449fdfa3ac4947fd997d9e2a8baf8f4b6
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
2017-08-16 18:04:43 +08:00
Hongbin Lu
7aba2d5f8a Switch from mode_wsgi to uwsgi
When the wsgi community goal was first approved, the push was to
use mod_wsgi. mod_wsgi has many issues when being used in devstack
for development or testing (see [1]). This commit will switch the
deployment of zun-api to uwsgi.

[1] https://governance.openstack.org/tc/goals/pike/deploy-api-in-wsgi
    .html#uwsgi-vs-mod-wsgi

Change-Id: Iec05ccb8aceee6874e3c04280fe7596f8292e333
Closes-Bug: #1692382
2017-08-07 17:07:46 +00:00
Hongbin Lu
ffb5762344 Get python3 tempest tests job to pass
* Switch to file backend if python35 is enabled because the default
  backend is swift that hasn't migrate to py35 yet.
* Safe decode bytes string of response body.

Depends-On: Ib222bf2e84f4b06b0dc3981fc3554510658d4ef0
Partial-Implements: blueprint support-python-35
Change-Id: I2d9a95dda8ead16421186116118badfce1de7ba6
2017-08-04 18:48:02 +00:00
melissaml
bb278a4e5c Update URLs in documents according to document migration
Change-Id: I18371b565836357e027b1c618b052ea132f3ef33
2017-07-13 21:48:56 +08:00
zhurong
98654e6111 Devstack stop zun-wsproxy process when service enabled
Change-Id: I0a934f45e7a7fabac31825e33cc84a8e2ef2ddc4
2017-07-10 17:28:39 +08:00
Hongbin Lu
73ead98af1 Switch to devstack-plugin-container
Change-Id: Ib59e665dfb9a1fb69216e49ff9020e18c3ab92c3
2017-05-24 19:23:21 +00:00
Feng Shengqin
677ba36549 Change to git.openstack.org
Change-Id: Ia8a68c5ba22cdb80ae0b5bd868ff499ac25f3207
Closes-Bug: #1692586
2017-05-24 01:55:50 +00:00
Hongbin Lu
bdaf7796fa Set docker_remote_api_ip in devstack
This config is set to hostname by default, but this won't work in
multi-host setup. Therefore, we set it to host_ip instead.

Change-Id: I023bf4823513bae277ab08db62f103642b87accb
2017-05-19 15:23:53 +00:00
Yongfeng Du
3e0cce8f49 MultiHost support
For the nodes other than service host, only enable zun-compute.
q-agt and kuryr is also required to provide network connection,
which need to be specified in local.conf.

Change-Id: I78055c75ad545cf8809dae973d1180dce2ecf77f
Closes-Bug: #1691606
2017-05-18 14:41:29 +08:00
Yongfeng Du
9f0609016f Fix the zun.conf file for MultiHost env
In the MultiHost case, should use SERVICE_HOST instead of HOST_IP

Change-Id: Icf1c8de53996a4b73db057d598bffa859ad91ccd
Partial-Bug: #1691606
2017-05-18 11:42:28 +08:00
Kevin Zhao
24c37bce01 Add a new service wsproxy to Zun
Implements: blueprint stream-via-rest-api

Change-Id: I22dc9e39a2133d1cb2951f54c76edee286582ad0
Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
2017-05-16 07:58:41 +00:00
Feng Shengqin
416e11205d Optimize the link address
Use https instead of http to ensure the safety

Change-Id: Ib99c018d77cced1c6d3770d2a1b9d28d6491e03c
2017-05-09 10:50:20 +00:00
cooldharma06
bed9d80a4d Add docker-ce in check_docker and updated docker daemon with proxy configuration
For devstack-plugin-container plugin, existing docker-ce checks added in zun
and kuryr-libnetwork. Update - Proxy configuration changes and
docker daemon command is deprecated since 1.12, update with dockerd command

Change-Id: Ibd5ac7f933570688523ba273e0413a0d8eae1681
Related-Bug: #1684057
2017-04-26 02:51:25 -04:00
Hongbin Lu
fc6ac8d177 Avoid running multiple etcd process
If both Zun and Kuryr-libnetwork are enabled in devstack, the script
might fail since etcd will be installed and started twice. This commit
fixed it.

Change-Id: Ieffbb7a86e99a3e9a03cbfcadb2daf92d8f62cfb
2017-04-19 23:47:43 +00:00
Hongbin Lu
b4fc4e3ea1 Make ETCD's port configurable in devstack
Change-Id: I1e75f6e942cf6bd95b0604fc5944c40514d9052d
2017-04-18 18:18:17 -04:00
Jenkins
ce1089603b Merge "Document how to run tempest tests locally" 2017-04-06 14:25:42 +00:00
Hongbin Lu
d17fe49109 Document how to run tempest tests locally
* Add a dev document for how to run tempest tests locally.
* Pull the instruction of running unit tests out of quickstart
  guide and make it a standalone document.
* Fix the unit tests guide to make it work at Ubuntu 16.04.
* Add a sample local.conf as minimal to run devstack
* Add osprofiler guide to the index page.

Change-Id: I31794733c9225478f5df029279c8415a23b1caa0
2017-04-04 04:05:41 +00:00
Hongbin Lu
b48df2f5bb Enable WSGI mode in gate only
In before, zun devstack plugin enabled wsgi mode by default. This
patch proposed the reverse: disable wsgi mode by default. This fall
back to the screen mode if users haven't explicitly set
ZUN_USE_MOD_WSGI to True. However, we enable wsgi mode in gate to
satisfy the requirement of community wsgi goal [1].

The rational of this change is to ease the development process by
running zun-api at screen, which is more dev-friendly than running
it in apache2/httpd. In screen, it is easier to do dev operations
like shutdown/restart/debug.

[1] https://governance.openstack.org/tc/goals/pike/
    deploy-api-in-wsgi.html

Change-Id: I8b47a23e94de8676c415a66da2097fc69ceb8336
2017-03-31 15:22:39 +00:00
Hongbin Lu
48c57fa33f Properly tear down zun-api at wsgi mode
If wsgi mode is enabled, zun-api should be disabled in apache,
otherwise shutdown the process as before.

Change-Id: I33979a5454a3d68415fcfff01e9de6e99f8b31d6
2017-03-27 21:32:34 -05:00
Feng Shengqin
05b72e7025 Optimize the devstack setup for wsgi deployment
1. Rename zun_error.log to zun_api.log
2. Start the zun-api and create two tabs in devstack screen:
the first tab is for taling the zun_api.log, the second tab
is for tailing the zun_access.log

Change-Id: I10a75c09e7a577615c331ceb0f422375443afeee
Closes-Bug: #1674028
2017-03-21 06:36:31 +00:00
zhurong
f925296126 Fix sudo cat Permission denied error
Last commit [0], using sudo cat, this will gievs the error:
/etc/systemd/system/docker.service.d/docker.conf: Permission denied

This patch will fix this.

[0]: I2154919c394e546edac56934c8860d4177fc9603

Change-Id: I87a8b7397d2dad2d26eac9a020d5ea3b21645aa2
2017-03-07 21:58:44 +08:00
zhurong
31500cec93 Fix devstack docker install in centos
Now devstack docker install in centos will gives the error:
sed: can't read /etc/systemd/system/docker.service.d/docker.conf: No such file or directory

ref the docker install guide [0], fix this error.

[0]: https://docs.docker.com/engine/admin/#centos--red-hat-enterprise-linux--fedora

Change-Id: I2154919c394e546edac56934c8860d4177fc9603
2017-03-06 11:13:29 +08:00
Jenkins
ea5a9783b0 Merge "devstack: enable wsgi on devstack" 2017-03-01 06:11:53 +00:00
Eli Qiao
e0ab1808cd devstack: enable wsgi on devstack
Added new config which is used in devstack zun lib,
      ``ZUN_USE_MOD_WSGI``, default value is False.

Added ZUN_USE_MOD_WSGI=True in Setting file of zun gate.

Implements: blueprint deploy-zun-api-in-wsgi
Change-Id: I99fe6bf762942d306b305619199575a060ba82f5
2017-02-28 15:12:39 +08:00
Hongbin Lu
e7ea7bf7ff Let API listen to 0.0.0.0 in devstack
In dev environment, it is convient to let zun-api listen to all
addresses.

Change-Id: I0aa27222023d00109c127018cbdd4c408980ae67
2017-02-27 12:38:05 -06:00
Eli Qiao
6251630dec devstack: restore xtrace in zun nova lib
Change-Id: I196efbffbeb22b18ee07b6392373c877d9e1117b
2017-02-22 16:01:59 +08:00
Hongbin Lu
ae65dae1db Remove gate_hook.sh from /devstack folder
This script has moved to /zun/tests/contrib
https://review.openstack.org/#/c/432843/
https://review.openstack.org/#/c/432844/

Change-Id: Ide12f6e2da3b161300c93a292ae01bda3f9352b5
Depends-On: I957c5b3ecabfe634623179bb84496bc1bcb67e30
2017-02-12 23:14:38 -06:00
Kevin Zhao
7a354bf1ab Add support for zun attach/resize in server
Change-Id: I56a9ddaabd20cffc956ecd2dc202e8a661a0338d
Partially-Implements: BP support-interactive-mode
2017-02-09 16:15:20 +08:00
zhangjl
c809cc0408 Ensure the plugin of zun for devstack can work on ubuntu 14
Because of the wrong usage of sed command, we cannot deploy zun
with devstack on ubuntu 14. This patch aims to fix this problem.

Change-Id: I7a6ea3ccf3dda1429d37974e6c142b4b1d97865d
Close-Bug: #1662788
2017-02-08 07:22:40 +00:00
Hongbin Lu
eb8cebf35e Enable zun-etcd only if db type is etcd
Change-Id: Iccdae37a9c60aba92b4deb5c8c35d5ff898fb032
2017-02-04 01:48:18 +00:00
Kevin Zhao
00c79963b9 Add support for Docker Remote API
Change-Id: I581450f6294b1117bb22dfdc63c36bf0e2ccc336
Partially-Implements: BP support-interactive-mode
2017-01-19 16:59:46 +08:00
prameswar
d72dcd96bd [devstack] Copy bash_completion script during zun installation
Copy zun.bash_completion script to /etc/bash_completion.d
so that users/developers can take advantage of auto completion
of zun commands.

Closes-Bug: #1657004

Change-Id: Icb47fe4864176d4ca3699b0616f2c222eba22ae3
2017-01-18 17:51:17 +00:00
Wenzhi Yu
96bd39afad Enable etcd DB backend testing pipeline
As disussed in project plan, we decided to adopt etcd to store
container data which is faster and more flexible than mysql.

This commit enable etcd DB backend testing pipeline in Zun
and adjust the code correspondingly:

1. Set the value of 'db_type' to 'etcd' when runing etcd
   pipeline: 'gate-zun-devstack-dsvm-docker-etcd-nv'.
2. Drop the 'get_XXX_by_id' methods from etcd API since 'id'
   attribute makes no sense in etcd data model.
3. Adjust DB related test cases.
4. Make etcd write request thead-safe.

After the etcd related code been well tested, we'll change the
default DB type from 'mysql' to 'etcd'.

Part of blueprint etcd-db-driver

Change-Id: I06ac9b719ce93898cd4f67f1c7bdc2e0803e086e
2017-01-11 10:45:07 +08:00
Hongbin Lu
11ce4753ea Rename config host to host_ip in api group
The 'host' config is actually an IP address. Let's rename it to
make it clear and consistent with other projects (i.e. Ironic).

Change-Id: I48a8a69c5049341afff545fcabebf0053ab1d242
2017-01-02 12:32:48 -06:00
Hongbin Lu
4d16326bb9 Rename virt driver from 'docker' to 'zun'
The rationals are as following:
* Make it clear that the in-tree virt driver is not the same as the
  nova-docker driver
* Justify that Zun is going to support additional runtime
* Avoid name collision with nova-docker on packaging.

Change-Id: I08f9cc0100837f62c57e2e77cd7f6cd727b91b69
Closes-Bug: #1652387
2016-12-24 15:50:52 -06:00
Hongbin Lu
546882333e Enable Nova driver in gate pipeline
This setup the CI to run devstack with Nova driver. Then, run the
tempest tests againest it.

In addition, this commit performed the following fixes in order to
pass the CI check:
* Switch from hv_type to fields.HVType
* Switch from vm_mode to fields.VMMode
See the related changes in Nova [1][2].

[1] https://review.openstack.org/#/c/356424/
[2] https://review.openstack.org/#/c/356553/

Closes-Bug: #1649021
Change-Id: Icf3c48d00b49ee16fe42adfc6d0bd41bfecaf938
2016-12-10 16:37:03 -06:00
Jenkins
96dbcead9b Merge "Fix the check of docker installation" 2016-12-06 03:22:13 +00:00
Hongbin Lu
d43b709ef8 Fix the check of docker installation
In before, we checked docker installation by:

  $ rpm -q docker-engine

However, this doesn't work for all cases. In some cases, the docker
installation is of name "docker" instead of "docker-engine". This
commit added check for "docker" as well.

Change-Id: I49ef8cfe4bcf1d22770ba143c6301d8b54e9d372
Closes-Bug: #1647459
2016-12-05 14:06:14 -06:00
Hongbin Lu
050dfaed64 Add more functional tests
* Add positive tests for each container operation with basic
  scenario.
* Fix some container operations that don't return latest container
  information.

Partial-Implements: blueprint zun-functional-test
Change-Id: Idd79d2b1e5e0e06ae4a477bd0a5e4ed2d7cb5687
2016-11-27 13:16:59 -06:00