bareon/doc/source/contributing.rst
Vu Cong Tuan 62fb2b10a8 Do not use “-y” for package install
According to "code conventions" [1], do not use "-y" option.
Instead, use apt-get install package, yum install package,
or zypper install package.

[1] https://docs.openstack.org/doc-contrib-guide/writing-style/
code-conventions.html

Change-Id: I19e99efe37ccb15049c920f7e41589c0e22b618a
2017-11-07 11:16:51 +07:00

2.7 KiB

Contributing

Technical Overview

An overview of a typical deployment using bareon is given below:

image

  1. Initiate boot via nova or heat, passing in a reference to the deploy_config and any driver_actions which should be performed
  2. Request IP from neutron
  3. Call ironic to begin deployment
  4. Configure TFTP server
  5. Cache images (deploy kernel & ramdisk, filesystem, cloud_default_deploy_config, deploy_config and driver_actions) and write provision script for bareon
  6. Update MAC and PXE config
  7. Set boot device to PXE
  8. Reboot target node
  9. Target node gets IP
  10. PXE boot image containing bareon
  11. Bareon calls back to tell Ironic that it is ready
  12. Ironic SFTPs across the provision script and forwards the rsync server port by SSH (in secure mode)
  13. Provisioning is triggered by SSH, eg: provision --data_driver ironic --deploy_driver rsync
  14. Partition and clean local storage, mount partitions, rsync filesystem across, write fstab, configure bootloader and unmount partitions
  15. Run driver actions over SSH, eg update BIOS, SFTP file across from Swift
  16. Set boot device to local disk
  17. Reboot the node

Functional testing

Overview

Tests are written using unittest2 and Functional Test Framework (ramdisk-func-test). The framework uses libvirt (python bindings) to configure a network, spawn a slave VM and run test commands. The framework resides in a standalone repo, however the functional tests, as well as commonly changed parts of test data (node templates, etc) are located in the bareon repo, so that these are updated when new functionality is added.

How to run tests (Devstack / CentOS 7.1 environment)

Follow the instructions on Running Bareon on Devstack upto and including "Install Bareon and build images".

cd ~/bareon
sudo yum install ansible
ansible-playbook bareon/tests_functional/ansible/bootstrap_func_tests.yaml
sudo NO_DIB=1 tox -e func

Note

By default each time the tests are ran, the bareon images are built and the golden images fetched (providing they do not currently exist). To suppress this behaviour set environment variables NO_DIB for the bareon images and NO_SYNC for the golden images.

Customizing image build environment

A default environment file could be found at bareon/tests_functional/image_build/centos_minimal_env.sh

You can override these with your own environment. To run the tests using a custom environment:

$ export BUILD_ENV=/path/to/my_bareon_env.sh