863 Commits

Author SHA1 Message Date
Zuul
901c314f02 Merge "New CLI option to get/set manifest" 2020-06-29 15:18:39 +00:00
Zuul
8832cb96f8 Merge "install python3-pip explicitly." 2020-06-29 14:21:47 +00:00
Sreejith Punnapuzha
a1226660d6 New CLI option to get/set manifest
This commit adds get-manifests and set-manifests option for airshipctl
config. get-manifests prints all the manifests in current config file.
set-manifests helps in setting/creating new manifests in current config
file.

Closes: #115
Change-Id: I7c677ed491a1d456744d27bf105f21e2b3c4e6aa
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-25 18:47:51 -05:00
Zuul
671881e1d5 Merge "Introduce phases and phase plan" 2020-06-25 21:20:58 +00:00
Zuul
4f37d71db4 Merge "Update airshipctl docs" 2020-06-25 20:37:58 +00:00
Zuul
47c1f613dd Merge "Optimize memory usage for gating" 2020-06-25 20:11:00 +00:00
Zuul
a28b8e18ad Merge "Remove config file requirement for plugin command" 2020-06-25 20:10:40 +00:00
Alexander Hughes
15d2684c50 Adding/updating documentation
The `update-golden` make target generates updated documentation for
each command, but has not been run for recently merged changesets.
This leads to out of date documentation, and requires remediation in
two steps:

1. (This patch) update documentation
2. Update gates to determine if commands have changed that warrants
   new documentation, and prevent patches from being merged without
   running `make update-golden` first. This can be added to
   tools/git_diff_check

Change-Id: Ide31f24caf8818e811d15397616805ed79bdea10
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-06-25 12:22:15 -04:00
Nikolay Fedorov
4d54110ac4 Optimize memory usage for gating
This CR brings  feature for Ephemeral node deploy.
Here is using a hard disk instead of tmpfs in RAM for kubelet.

Relates-To: #287

Change-Id: I6b67f20eee10ce71ace0c7f3cbf901e3a68864bd
2020-06-25 18:48:05 +04:00
Zuul
4af678018c Merge "Implement document filtering using api objects" 2020-06-25 01:10:36 +00:00
Zuul
17628c48fd Merge "Make API compatible with k8s apimachinary" 2020-06-24 23:14:07 +00:00
Sirajudeen
1fd55a7abd install python3-pip explicitly.
* zuul gate failing due to pip3 missing, so had to install it explicitly

Change-Id: I8d24cc506d58312f338e3632e97a567b23dc71a1
2020-06-24 16:54:34 -05:00
Sreejith Punnapuzha
4a21ca3446 Update airshipctl docs
This commit adds generated documentation for get/set management-config
command flag

Change-Id: I21844e4e9cf15a2ae18846aa3f0eb180d470f2ee
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-24 13:46:12 -05:00
Sirajudeen
6aaceb1e7f Use sudo to install python3-setuptools
Change-Id: I4119486e8388ca69fce8a135d785f66cc9c4e880
2020-06-23 17:47:38 -05:00
Sirajudeen
08c5d6acbb Add python3-setuptools to required packages
* This commit adds python3-setuptools to required packages, so that
  the job airship-airshipctl-update-github-issues will not fail

Change-Id: I7b5a93e83175bb19dd6145f1af6bf7f6fd7a4d61
2020-06-23 09:30:26 -05:00
Dmitry Ukov
325d824503 Introduce phases and phase plan
Airship API is extended with Phase and PhasePlan objects which
implemet k8s runtime.Object interface. Phase plan command is
added to airshipctl.

Closes: #262
Closes: #261
Closes: #260
Change-Id: I4c299ec9078af4ace29ab46bd6440f47ae18a094
2020-06-23 13:12:36 +04:00
Dmitry Ukov
c05286d3f6 Implement document filtering using api objects
Change-Id: I9ac70ed85c949224d091e9e3afead70084b38170
Co-Authored-By: Vladimir Kozhukalov <kozhukalov@gmail.com>
2020-06-23 13:12:33 +04:00
Dmitry Ukov
cad8177fee Make API compatible with k8s apimachinary
Each object must implement runtime.Object interface. Therefore we
need DeepCopy methods implemented for each API struct.
Implementation is generated by controller-get utility.

Relates-To: #259
Change-Id: I535bf9ec3ff61597a778f73ca449313b7455b989
2020-06-23 13:01:16 +04:00
Matt McEuen
6af3da8d7b Remove config file requirement for plugin command
Change 725820 [1] configured airshipctl to fail an airship config file
isn't present.  The present change makes an exception to that behavior
for the document plugin subcommand, and moves the plugin loading from
the parent document command into the pull subcommand.

There are multiple reasons we don't want config enforcement in place for plugins:

- If a non-standard config file location is configured via an environment variable,
  the plugin won't know about it (since it's invoked separately by kustomize), and it
  would look for a potentially non-existant default config file, and fail.

- If a user is using the kustomize cli by hand along with airshipctl plugins
  (as opposed to driving the process via airshipctl itself), then they do not
  need the config anyway -- the plugin subcommand doesn't actually use it.
  Forcing the user to create a config file seems awkward here.

[1]: https://review.opendev.org/#/c/725820/16

Change-Id: Ic1b652efb14439ed2757eb9fb0a86feb8b3ef21c
2020-06-22 21:32:18 -05:00
Zuul
f1471d1189 Merge "Zuul Job with Bash oriented gate tests" 2020-06-22 18:36:31 +00:00
Sreejith Punnapuzha
c64ad2db4f Update kubectl version
This commit updates kubectl version from 1.16.2 to 1.17.4 as part of
gate setup

Change-Id: I88728be65474ee7ce57f243e1356b84c7609a45f
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-19 14:31:31 -05:00
Sirajudeen
c37b27b8d0 Zuul Job with Bash oriented gate tests
* Added bash scripts in place of ansible playbooks/roles
* zuul will run bash scripts, and this means that they are actually tested
  which will make development experience easier

Change-Id: I60d1dac589ae8ad835d3f1dda5e2a45523367496
Relates-To: #222
2020-06-19 15:44:27 +00:00
Sreejith Punnapuzha
c3002cabda Add bash scripts to run airshipctl
* Add playbook to run the scripts
 * Add script to install kubectl
 * Add script to create airshipctl executable
 * Add script to generate test configuration
 * Add script to pull site documents
 * Add script to build ephemeral iso
 * Add script to deploy ephemeral node
 * Add script to deploy control plane

Closes: #223
Closes: #224
Closes: #225
Closes: #226
Closes: #227

Change-Id: Ied63e2a733c3abcc6b1a822624c5ffce92e05a44
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-19 15:44:06 +00:00
Sreejith Punnapuzha
1108d4d2bf Add python3-setuptools to needed packages
This commit adds python3-setuptools to needed packages so that
sushy-tool installation will not fail

Change-Id: I7b6de0ebf09b7c187061030463327831c7d856f3
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-19 08:25:13 -05:00
Zuul
7617a95049 Merge "Add new constructor to create documents" 2020-06-18 14:28:48 +00:00
Zuul
835eb89480 Merge "Move mock document file system to testutils" 2020-06-18 14:23:16 +00:00
Zuul
cd42b055d0 Merge "Add more genernic Kubectl Factory interface" 2020-06-18 14:22:39 +00:00
Kostiantyn Kalynovskyi
36facd30eb Add new constructor to create documents
The change would allow to build a document object from bytes

Change-Id: I15c13a960b4e989cffa4525c85b8f32f2a51a0e1
Relates-To: #238
Relates-To: #279
Closes: #279
2020-06-17 22:31:24 +00:00
Kostiantyn Kalynovskyi
6a896704b5 Move mock document file system to testutils
This commit makes mock filesystem reusable by moving it to importable
package in testutils

Change-Id: I4885480a9ef3b8c81da0058db708c32187af8e12
Relates-To: #277
Relates-To: #238
Closes: #277
2020-06-17 22:31:12 +00:00
Kostiantyn Kalynovskyi
cd7e99ac15 Add more genernic Kubectl Factory interface
Adds FakeFactory function, that allows to inject custom handlers
for HTTP and Unstructured client, which in turn enables better
testing for kubernetes api related packages

Relates-To: #276
Relates-To: #238

Change-Id: Ic27352bdc64bfccb91cc6a49afa6164e4624b1e1
Closes: #276
2020-06-17 17:30:14 -05:00
Drew Walters
5e4a3d66a0 Add links to other airship projects
This change adds documentation links to other airship projects, bringing
airshipctl in line with the latest docs.airshipit.org theme changes.

Change-Id: I42fe5371770437d0f106bfdfc1173c9fdade746b
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-06-17 13:54:44 +00:00
Ruslan Aliev
19c37fef7f Fix contol plane deployment ansible task
There is need to ensure that appropriate directory does not exist
before clonining source code into it, otherwise git throws an error.
The destination folder name for cloning was fixed. Variable name which
uses for task fail verification was corrected.

Relates-To: #271
Closes: #271
Change-Id: I9c2bd03f68e6c34fc28b900f11dbaadd190087e8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-06-15 02:17:22 -05:00
Zuul
42857f527b Merge "Return an error if there is a problem to access config file" 2020-06-13 00:14:57 +00:00
Zuul
953e55f04b Merge "Remove deprecated fields of remoteDirect" 2020-06-12 19:59:49 +00:00
Ruslan Aliev
ad7f80f2bf Return an error if there is a problem to access config file
Currently, if config file doesn't exist - airshipctl doesn't
throw an error and uses empty config object instead. It seems
this behavior was an attempt to hide an error if there was a call
of subcommand which is not require proper config file. Since we
moved config load calls to the specific subcommands from
root level - current behavior should be changed and we have to
throw an error instead if it's not possible to access config file.

Change-Id: I7e949fbc9d48d682e26500e0b6b6b9bd12665e24
Relates-To: #199
Closes: #199
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-06-12 11:22:47 -05:00
Zuul
f05693a8bf Merge "Added new command for Image Build." 2020-06-12 14:09:55 +00:00
Yasin, Siraj (SY495P)
54e13ceaad Added new command for Image Build.
* command: airshipctl image build
* For now it is just a wrapper for baremetal isogen.
* Removed isogen subcommand from baremetal

Change-Id: I5c1260c4b167e5768eba27a7cd83c9b60ab29184
Relates-To:#251
Closes:#251
2020-06-12 03:01:26 +00: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
Ian Howell
3f79bf8bbd Make get-management-config print in order
This causes the `airshipctl config get-management-config` command to
print all management configurations in order.

This fixes an issue where unit tests would randomly fail, since the
output order from the command was not consistent.

Change-Id: I83da272d56b90026dac8c07d7522119500935406
2020-06-11 15:45:29 -05:00
Zuul
eb7ae187f5 Merge "Fix: remove duplicate NewImportCommand" 2020-06-11 20:06:34 +00:00
Sreejith Punnapuzha
39178c10b1 Fix: remove duplicate NewImportCommand
This commit removed dulicate NewImportCommand from command defination

Change-Id: Ifc73a58de37f51c484197a6036e03a1d98d51d3d
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-06-11 11:13:51 -05: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
Dmitry Ukov
fbaed0b7c8 Set document validation job non-voting
This is temporary solution an job can be enabled for voting once
phase framework is implemented

Change-Id: Iab5087144485ece0495de02edfecf1a7af941614
Closes: #270
2020-06-11 13:44:29 +00:00
Zuul
9e364d78d9 Merge "Add get-management-config command" 2020-06-11 12:36:31 +00:00
Zuul
7ca1ca719a Merge "Implement airshipctl cluster status" 2020-06-11 07:16:20 +00:00
Drew Walters
44b610de4f Add get-management-config command
This change adds a get-management-config command that allows the user to
view defined management configurations on stdout.

Change-Id: I9c49016bbedcc3a4609d1b17631ecc9e1f4be104
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-06-11 06:26:15 +00:00
Zuul
ccb83371ec Merge "Add set-management-configuration command" 2020-06-10 16:23:06 +00:00
Ian Howell
5a187e1810 Remove deprecated fields of remoteDirect
This change removes the deprecated "remoteType", "useProxy", and
"insecure" fields from the remoteDirect field of bootstrapInfo

Change-Id: I64d28b715b81464c871f99ad0348fadc2e9fc5f6
Relates-To: #242
2020-06-10 10:23:41 -05:00
Ian Howell
eecc417495 Implement airshipctl cluster status
This change introduces the subcommand `status` to the `airshipctl
cluster` command. The `status` command will iterate over all defined
custom resources in the target path, check their status against the
resources currently in the cluster, and then report results on stdout.

Change-Id: Ieaff6b91fd9055f995c5ba8ce79959356a2a8a02
Relates-To: #73
2020-06-10 10:14:12 -05:00
Zuul
fcb1202e11 Merge "Remove erroneusly duplicated gating lint-unit test job" 2020-06-09 20:06:35 +00:00