21 Commits

Author SHA1 Message Date
Alexander Noskov
3ac5e0ec70 Add apt update in gate script
In the case of using cloud VM for testing purposes,
the `apt update` command is missed in the gate script.

Change-Id: If6960c70aa98680f5362a13456eff05814140f40
2020-08-31 14:25:33 -05:00
Stanislav Egorov
f1725f3123 Cleaning for gate scripts
Removed orphaned local scripts because some roles were removed.
Fixed env vars for proper configuration.
Updated documentation accordingly.

Change-Id: I37f0c8d038fb51ddaa57664a65d347056df6f007
2020-07-09 13:16:05 -07:00
Yasin, Siraj (SY495P)
458fb2579b Fix gate scripts for local setup
* when remote_work_dir is set, document pull happens from the
  remote_work_dir (/tmp/airship) with a folder created within
  remote_work_dir with repo name (/tmp/airship/airshipctl).
  However the manifest yamls of kind "Clusterctl"
  refers to a relative path from work_dir and it fails
  finding expected objects.
   example: manifests/function/capm3/v0.3.1
* So trying to avoid document pull, and use current dir for workspace.
  similar to Zuul gate implementation

Change-Id: I63fd5476247f957745e15cbdfceb5fb483758e83
2020-06-12 03:00:32 +00:00
Dmitry Ukov
df2fff0acf Add control plane deployment
K8s control plane is deployed by KubeadmControlPlane controller. This
controller creates CAPI machines and infrastructure objects
(Metal3Machine). Metal3Machine objects are created based on a template
which contins host selector label. Control plane label is assigned to a
particular BareMetalHots object defined inside of the shared
kustomization.

Relates-To: #149
Closes: #221
Change-Id: I3be1750aacf9736ece2944045c036f405e404561
2020-06-11 13:44:42 +00:00
Ruslan Aliev
6577d3fc64 Install netaddr as dependency of ansible ipaddr/ipwrap filter
Currently there is no installation procedure for netaddr package
on ansible controller. The absence of this package causes
apache-wsgi-sushy-emulator or apache-file-exchanger tasks to fail.
There is need to manually install it according to ansible docs [1].

[1] https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html

Change-Id: I29fa7086ea637859655e0021a3fcbe4282fe09ae
Relates-To: #239
Closes: #239
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-05-30 03:03:35 +00:00
Stanislav Egorov
fbd8c89180 Fixed local scripts
Added remote_work_dir for template to use the same config options
that we have for regular gate.

Without this change when we run local srcipts we have a conflict
when 'airshipctl cluster init' tried to use manifests from '/tmp/airship'
which is targetPath from airconfig. But 'airshipctl document pull'
downloded manifests to '/tmp/airship/airshipctl'

Change-Id: I1eaa2f7525471c756f79a0bc1dd566124f40d531
2020-05-28 15:30:44 -07:00
Dmitry Ukov
a301de202b Add CAPI initialization steps to gating
This change enables execute 'airshipctl cluster init' command
as a part of zuul pipeline

Co-Authored-By: Kostyantyn Kalynovskyi <kkalynovskyi@mirantis.com>
Change-Id: I9d499ae66f8d847759c2e61e5d4415f2c9f3c860
2020-05-20 15:17:20 +04:00
Ruslan Aliev
917d6896b6 Remove "cluster initinfra" command
Command "cluster initinfra" should be removed since
"phase apply" was introduced instead.

Change-Id: I263f8988a4456fc03314093a55ee1c1da8048404
Relates-To: #162
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-05-16 01:45:34 -05:00
James Gu
d26df73b4b [#112] Add doc pull in deployment scripts
Added the optional use of doc pull in gate deployment scripts. When the
remote_work_dir is defined, the new pull doc role will invoke airshipctl
document pull command to download the manifests to the remote_work_dir.
This role is not included in zuul job so the zuul job will continue to use
the already checked out manifests in the zuul.project.src directory.

Fixes #112

Change-Id: I754c08661ad0b635819cb3730e05a6986d90f5ca
Signed-off-by: James Gu <james.gu@att.com>
2020-04-30 15:11:44 -07:00
Dmitry Ukov
25e7d92d48 Rename gating test site
* New name for gating site is 'test-site'
* Renamed 'test-bootstrap' type. New name is 'gating'.
* Moved BareMetalHost and its settings from ephemeral function to
  shared directory within the site

Change-Id: I510e74c1a553bb2b1f84e66f8e4a7796640b59cc
2020-04-29 17:32:40 +04:00
James Gu
afcfdb5c6e Proxy support enhancement
Added gate scripts and playbook enhancement to run airshipctl behind proxy.

Change-Id: Icc3cdcd6fd150420103f907cd1871feba1ccd223
Signed-off-by: James Gu <james.gu@att.com>
2020-04-28 18:04:55 +00:00
Zuul
585f885409 Merge "Add initinfra gating tests" 2020-04-23 18:28:27 +00:00
Sreejith Punnapuzha
53c0be6776 Add proxy support for pip3 package installation
This commit adds proxy support for pip installation. if environment
variable http_proxy is set, pip uses it for package installation else
it will continue without proxy

Change-Id: Iffa0f592853f3e05824263734410c64b5774ab33
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-04-23 11:31:16 -05:00
Vamsi Savaram
e40b5ffec5 Add initinfra gating tests
Relates-To: #180

Change-Id: Ie7a8daa532596f2d1d0fb2059ef4630607511711
2020-04-23 14:41:45 +00:00
Alexey Odinokov
1505353333 Switching local gating scripts to Python3 to comply with Zuul
The initial version of gating playbook contained ability
to run them either on Python2 or Python3 ansible.
But it causes a lot of issues e.g. a need to install[1] both
versions of libs to support both possible ways to run,
discrepancy between local and Zuul run[2]
Zuul testing is done with ansible running on Python3 [3].
Meanwhile ppa repo for ansible contains ansible pachage
that depends only from python2. There is no package for
Python3 and we used only Python2-ansyble.
The fact that Zuul runs it with different configuration
means that we'll keep facing the issues with dependencies
in future, since Gating doesn't test it.
This patch changes makes local scripts run as Zuul.

PS
The script partially takes care of reverting intallation
from its previous runs. To cleanup completely it's possible
to run [4] in case these pacakges are not used by anyone else

[1]
https://opendev.org/airship/airshipctl/src/branch/master/roles/libvirt-install/tasks/main.yaml#L38
[2]
https://review.opendev.org/#/c/717841/
https://review.opendev.org/#/c/718590/
[3]
https://zuul.opendev.org/t/openstack/build/4096513604a84cd2b2f2578fc3f98660/log/zuul-info/host-info.primary.yaml#498
[4]
if dpkg -l | grep "ansible.*ppa~bionic"; then
      sudo apt -y remove ansible
      sudo apt -y autoremove
      sudo add-apt-repository -r -y ppa:ansible/ansible
      sudo apt-get -y update
fi
+ possibly
sudo apt remove virtinst python-libvirt python-docker python-requests python-lxml python-libvirt

Change-Id: Ia1ac3aa4128f6c4797dea1709ccb8516ae342a66
2020-04-11 06:53:40 +00:00
Zuul
788dc35b0a Merge "Add copyright for missing files" 2020-04-10 17:51:51 +00:00
Yasin, Siraj (SY495P)
c25d223c7b Add copyright for missing files
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
    missing files. Type:  go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
   > ./tools/add_license.sh

* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments

New Files:
  1. tools/add_license.sh
  2. tools/license_go.txt
  3. tools/license_yaml.txt
  4. tools/license_bash.txt

Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
2020-04-09 08:35:59 -05:00
Stanislav Egorov
9e0b8b2a96 Fixed local gate scripts
Change-Id: I3fc0c597f1b4f050b40905b5415069c5d0b8101f
2020-04-08 18:31:30 -07:00
Stanislav Egorov
2933dfdc51 Moved last role to airshipctl
All roles should be developed in airshipctl roles dir

Change-Id: Ide949c95889746595d41c4db913619f7140daf35
2020-03-25 13:16:38 -07:00
Drew Walters
2a91ed613c tools: Use local connection for ansible runner
The scripts in the tools/gate directory do not run ansible with a local
conenction; the ansible playbooks attempt to SSH to a VM on localhost
and fail. This change adds the local connection flag in order to run
directly on the host.

Change-Id: I3d7c7b6d21fc4972bd8a084ea49c945af4bfc518
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-06 19:42:56 +00:00
Stanislav Egorov
d0e1c0258f [#32]: scripts for local run playbooks
Change-Id: Ia3f0e1461149f4ff887f965dd5b5a00fe2f8f04b
2020-02-28 17:24:32 -08:00