1044 Commits

Author SHA1 Message Date
Ruslan Aliev
e81116b1a9 Refactor image* commands
All the image commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.

Change-Id: I3c51f201ec70b194ce1f127ff43a28292cf691f3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-03 23:52:49 -05:00
Ruslan Aliev
a2b8d45cb0 Refactor baremetal* commands
All the baremetal commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.

Change-Id: If75cd3f1a8bc22fc47ea132188bd9fec989ee434
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-03 23:52:49 -05:00
Zuul
b63d107ec7 Merge "Add airshipctl versions catalogue & replacements" 2020-09-04 03:57:34 +00:00
Matt McEuen
f15e7e5e41 Add airshipctl versions catalogue & replacements
This extracts the container, disk image, and Kubernetes versions that
are defined in airshipctl functions, into an `versions-airshipctl`
catalogue in the `airshipctl-catalogues` function.  The default version
values have been left in-place in their resources as well, and will
be used if the user decides not to apply the catalogue via a
transformer at the site level (it's not currently required to actually
use the catalogue or associate replacment rules).

Please see the READMEs in this change for more information.

Note: replacement of CAPI component container versions must be done
through a slightly different mechanism and will be in a
follow-on changeset.

Note that this also incorporates a fix to pin the Ironic images, which
are currently not compatible at the :latest tag.

Co-Authored-By: Alexander Noskov <anoskov@mirantis.com>
Change-Id: Iafe1d185a7e7d3932576055eda819d2270b02482
Relates-To: https://github.com/airshipit/airshipctl/issues/316
2020-09-03 18:12:27 -05:00
Zuul
c486142afb Merge "Add initinfra phase wait timeout override" 2020-09-03 14:57:42 +00:00
Zuul
ed544c46c0 Merge "Refactor document pull command" 2020-09-03 14:45:05 +00:00
Zuul
d324ee6c8a Merge "Introduce new approach of config object loading" 2020-09-03 13:47:23 +00:00
Zuul
ea56139335 Merge "Dynamically determine disk for images & bindmounts" 2020-09-03 12:28:32 +00:00
Ruslan Aliev
285aeeba8c Refactor document pull command
This command was refactored for usage with new config factory.
Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.

Change-Id: Iff75eb66db2fee922e6db1bf2930892c02c3b601
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-02 23:41:05 -05:00
Ruslan Aliev
91529ca046 Introduce new approach of config object loading
The new approach of config loading allows us to combine and move all
the config loading and verifications actions from cmd to pkg module;
it will be executed on demand only and save us from non expected
runtime errors. The examples of usage will be introduced in further
changes.

Change-Id: I1b4c29f9c5b1de3e46a1faf5c28fea5c7b3eb4e1
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-02 23:41:05 -05:00
Ruslan Aliev
4c0d2c0b57 Remove debug field from AirshipCTLSettings
As part of config refactoring process, we should remove debug field
from AirshipCTLSettings structure since debug variable is stored in
log module.

Change-Id: I02f3c7160ed0301605de32e0d0267be8524ccc12
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-02 23:41:05 -05:00
Ruslan Aliev
f1b606f8bf Fix cmd document pull with help test
Previously it was not executed due to typo.

Change-Id: I91e166ded37e818ae1836cc33295579af068bd53
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-02 23:41:05 -05:00
Zuul
ead4f56f25 Merge "Add kubeconfig builder" 2020-09-02 23:58:56 +00:00
Kostiantyn Kalynovskyi
1f932861d4 Add kubeconfig builder
Kubeconfig builder will be a single source of kubeconfig, allowing
to make a decision how to build kubeconfig based on different
parameters, such as path to kubeconfig, dynamic kubeconfig
options, or kubeconfig based on document bundle.

Change-Id: Ia63e11a6f0b327e283d3e7fce169a35d54684dfb
2020-09-02 17:18:19 -05:00
Stanislav Egorov
f0df007945 Extended kubeconfig interface
Added kubeconfig extraction from secret stored in kubernetes cluster

Change-Id: I4399d718857614c6d6dfec2174092cd84c4ee22f
2020-09-02 11:53:57 -07:00
Matt McEuen
76f89f40b3 Dynamically determine disk for images & bindmounts
This removes an assumption in the ephemeral cloud-init that
vda should be used to hold ironic images and container bindmounts.
Cloud-init will now use the ram-backed FS if there's enough
memory, and otherwise will default to vda or sda as appropriate.

Change-Id: If2a05348df7fae99598ff76e171b0e88fc2e6f88
2020-09-02 13:47:46 -05:00
Zuul
eaa66fded7 Merge "Fixed TODO in package config" 2020-09-01 22:17:51 +00:00
Zuul
fe1f1f6955 Merge "Move bootstrapInfo config section to manifests" 2020-09-01 18:54:44 +00:00
Zuul
ad21e64a98 Merge "Substring replacement fix in ReplacementTranformer" 2020-09-01 16:56:23 +00:00
Zuul
65b783f41a Merge "Rename calico folder to use major version part" 2020-09-01 16:50:23 +00:00
Ruslan Aliev
78364d7d44 Refactor document plugin command
AirshipCTLSettings are not used here, so it was removed.

Change-Id: If4bf64b9991b4ac05898632c79bacbacd7872635
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-01 10:15:58 -05:00
Sirajudeen
e6f2e2407f Rename calico folder to use major version part
* Use just the major part for the calico version for folder naming.
* For any minor uprades, it will be just reference updates within manifests.
* When moving to major version, then we will add a new folder with
  that version naming (v4)

Change-Id: I1ee30af26c3030531ef719a3cb649fb999d0244c
2020-09-01 14:53:42 +00:00
Drew Walters
1103946491 Add initinfra phase wait timeout override
The size of the metal3.io image has increased, and timeouts sometimes
occur within the 1000s range. This change enables overriding the wait
timeout for the initinfra phase on the ephemeral node and increases the
timeout to 2000s by default.

Change-Id: I11d7cdcfa0f7982c68cc7223f52ab20007bca69d
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-09-01 14:31:52 +00:00
Zuul
95d6536df2 Merge "Enhance target node deployment on gates" 2020-09-01 14:14:50 +00:00
Zuul
4566efc325 Merge "improve logging" 2020-09-01 12:48:29 +00:00
Zuul
b971df63a2 Merge "Fixed TODO in document/repo package" 2020-09-01 12:31:04 +00:00
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
Sirajudeen
7e391bfc1b Substring replacement fix in ReplacementTranformer
* Substring replacement failing in ReplacementTranformer when
target substring contains periods (.)

* This is temporary fix till the kpt-function way of replacement
  transformer is implemented

* In this fix it is assumed that the substring condition can only occur at
  the end of the path.

  example:
   expected: replace the nginx version from 1.7.9 to 1.17.0 for container named
             `nginx-tagged`

   target condition:
      spec.template.spec.containers[name=nginx-tagged].image%1.7.9%

Change-Id: I76fb65f69a6eedf3cbdd692d3bc1835a214dc8fa
Relates-To: #336
Closes: #336
2020-08-31 17:43:21 +00:00
Vladimir Kozhukalov
e9c8425c30 Move bootstrapInfo config section to manifests
This is a part of two activities
  * Refactor config and store all parameters to document model
  * Implement everything as phases (which are supposed to be purely document driven)

 This patch removes bootstrapInfo section from the airshipctl config and
 makes these to commands
  * airshipctl baremetal isogen
  * airthipctl baremetal remotedirect
 to take necessary parameters from documents

 We introduce two airship API kinds ImageGenerator and RemoteDirect.
 Instead of storing config parameters in cm/secrets we use these two
 API objects.

Relates-To: #246
Closes: #254
Change-Id: I42903c45dce1c73da184c07277fec76fd88c700f
2020-08-31 16:54:46 +03:00
Stanislav Egorov
88da96cdf5 Fixed TODO in package config
Implemented strongly-typed errors for config

Change-Id: I6c91f5abbdba2fb89b831dd897808453d172a826
2020-08-28 22:56:41 -07:00
Stanislav Egorov
61ed8d30b7 Fixed TODO in document/repo package
Implemented strongly-typed errors for document/repo

Change-Id: I572489b4c48ff4cd75a4e2f9a6b1d27ad1f840dd
2020-08-28 12:24:54 -07:00
Schiefelbein, Andrew
20d2a99190 improve logging
This will help on debugging and / or error messages which
will show what package and what line a message came from

This is pared down from what is currently being proposed for the UI
https://review.opendev.org/#/c/747473/

Change-Id: I68eb8b0141a8d56d5ea14aa623a25f9287ff1e75
2020-08-27 16:02:38 -05:00
Zuul
61633d30fc Merge "Refactor airshipctl root command" 2020-08-27 16:35:03 +00:00
Zuul
cc384223c0 Merge "Proper error handling with Sushy emulator" 2020-08-27 16:14:41 +00:00
Sreejith Punnapuzha
f95da5a56c Enhance target node deployment on gates
* Add script to install clusterctl
  * Add controlplane yamls for target node
  * Add script to perform cluster move
  * Add script to zuul jobs

Closes: #288
Change-Id: Ia6891df9c9b1da333396e76f11332deeb17ab807
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-08-27 11:12:05 -05:00
Zuul
69a6c3e406 Merge "Add manifests for Hardware-Classification-Controller" 2020-08-27 14:25:07 +00:00
Alexander Noskov
068718e07d Proper error handling with Sushy emulator
This change adds a more informative error message in case of using airshipctl
with a Sushy emulator.

In the current implementation, by executing `airshipctl baremetal powerstatus`
command with invalid BMH configuration for example, returns:
redfish client encountered an error: BMC responded '500 INTERNAL SERVER ERROR'.

After this change the output looks like this:
redfish client encountered an error: BMC responded '500 INTERNAL SERVER ERROR'.
BMC responded: 'Error finding domain by name/UUID "air-ephemeral1" at libvirt
URI qemu:///system": Domain not found: no domain with matching name 'air-ephemeral1''

In case of using airshipctl with baremetal BMC, extendedInfo contains a valid
error message, so there are no issues.

Relates-To: #320

Change-Id: I437f50d5df4b0561f352804f269b0319badcc755
2020-08-26 15:22:33 -05:00
Zuul
8b891e2d49 Merge "[#310] Declaration redundancy: Unused exported function" 2020-08-26 16:03:52 +00:00
Zuul
70250e356e Merge "Use log module to determine current log level" 2020-08-26 14:50:32 +00:00
Zuul
3bebcba79b Merge "Deploy calico via function." 2020-08-26 14:43:34 +00:00
Ruslan Aliev
abd1317566 Refactor airshipctl root command
As part of config refactoring process, we have to prepare root
level command to future changes, optimize function signatures
and its logic.

Change-Id: I563a7556ce1cca795a74cf2c6a26380467a15a5d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-08-25 17:37:19 -05:00
Ruslan Aliev
160117af3a Use log module to determine current log level
As part of config refactoring process, it makes sense to
remove Debug field of AirshipCTLSettings and use log module
method as source of truth about current log level.

Change-Id: I42e3a9fd3b4e2778c71278f98a0d168421dfd2fb
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-08-25 16:29:19 -05:00
Sirajudeen
b2c059087e Deploy calico via function.
* Deploy Calico to ephemeral and target via function
* Removed the condition to check node ready status in
  25_deploy_ephemeral_node.sh and 30_deploy_controlplane.sh.
  As calico is applied at a later stage, relaxed the dependency to wait
for node ready status.
* updated compoiste/infra for calico manifest

Change-Id: Id582aec3ca402eac02d9baa2305b562c410c1bea
Relates-To: #303
Relates-To: #304
2020-08-25 19:53:51 +00:00
Zuul
60dae58d68 Merge "Extend kubeconfig interface for document bundle" 2020-08-25 15:46:22 +00:00
Vladislav Kuzmin
6742aab691 Extend kubeconfig interface for document bundle
Add new function to extract kubeconfig from a document bundle.
This is a small step to start using kubeconfig from the document bundle.

Closes: #264

Change-Id: Ib601c2212b901da76a2df14e73058cd3a77d1f98
2020-08-25 14:20:04 +04:00
muly
b6e92132db [#310] Declaration redundancy: Unused exported function
* removed a unused exported function

Closes: #310

Change-Id: Ib174b31cd68bdc2cf9a63dd89efd9beb8ab7d78e
2020-08-24 14:35:57 +00:00
Sreejith Punnapuzha
06ae80d3b0 Update Kubectl Version
Kubernetes was uplifted to v1.18.6 uplifting kubectl to the same
version.

Change-Id: Id80a4ee169c06c1957c575ef98f87f6ad56c7947
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-08-24 09:27:43 -05:00
Zuul
0966c5bb3b Merge "Integrate kubernetes apply executor with phases" 2020-08-21 17:52:03 +00:00
Zuul
aedfafa9e5 Merge "Add kubernetes apply executor" 2020-08-21 17:36:14 +00:00
Kostiantyn Kalynovskyi
a3200e8d62 Integrate kubernetes apply executor with phases
Also adds unit test to test GetExecutor() method.

Relates-To #259

Change-Id: I7d89750e671ec1b747a811aa71b86725217b5311
2020-08-21 16:19:01 +00:00