112 Commits

Author SHA1 Message Date
Prateek Dodda
30200a54d9 Implement Security Context for Divingbell
Change-Id: Ibc93ccac6d6015faff3491211f5f8cb752a0328f
2020-03-30 23:04:50 +00:00
Anderson, Craig (ca846m)
32da2fbd4b Add ability to disable package uninstalls
Allow users to disable auto-uninstall functionality for packages.

Change-Id: Ib59ff175fc474a592118374c23974c6a9439cd72
2020-03-23 10:23:20 -07:00
Zuul
db4f382b59 Merge "Update dpkg commands to be non-interactive" 2020-03-20 20:37:00 +00:00
Michael Beaver
b98efc4f29 Update dpkg commands to be non-interactive
The current `dpkg --configure -a` command does not always work if the
package that needs to be configured has a modified conffile which can
require user input to resolve. This change adds flags to make these
lines work as intended in that scenario.

Change-Id: I8f459b0c1c2fc7ecbe1ff478bdb77fd9af31dc90
2020-03-19 14:10:44 +00:00
Crank, Daniel
f0eb0b7582 [ad-hoc] Fix test case exit conditions
While working on another change, I discovered conditions
in many test cases that echoed fail messages but did not
actually exit, so the gate could succeed even though some
tests failed. This patchset aims to fix those problems, and
then fix the problems masked by those problems:

1) fix bug in revert function of file permissions module
preventing permissions from being reverted.
2) fix various syntax and logic problems in test script
3) add wait_for_tiller_ready function to avoid race condition
with test script using helm too early
4) add install for ethtool in test script
5) ignore ethtool pod failures (see note #1 in [0])
6) make logging of test results more uniform
7) Fix error message logic in perm.sh
8) Fix case in _shcommon.tpl where error message was not
logged, causing test script to unnecessarily wait for
container timeout

[0]: https://review.opendev.org/676010

Change-Id: I22182d35250c37c96e73d9f5f49abfb2246f2a35
2020-03-12 15:25:30 +00:00
Drew Walters
7d968220c7 Add SECURITY.md
All Airship projects are moving to GitHub issues. This change adds a
GitHub security policy that links to the official Airship vulnerability
management process [0]. When users on GitHub click "New Issue" on this
GitHub repository, they will see an option to report a security
vulnerability, which will direct them to our official policy.

[0] https://airship-docs.readthedocs.io/en/latest/security/vulnerabilities.html

Change-Id: Iaf060dd0085c21f0c4f18f100e3e053b5ceedbed
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-02-20 17:07:16 -06:00
KAVVA, JAGAN MOHAN REDDY (jk330k)
37594c8d16 Add Docker default AppArmor profile to divingbell
This adds default AppArmor profile to divingbell.

Also, update to gate script to install ethtool if it is not present.

Change-Id: I7abb13a533b596f4db5fe65fdae5eb7fc57ec00a
2020-02-13 14:43:44 -08:00
Michael Beaver
fe0a034ec7 Add --no-install-recommends to apt install
This change adds the --no-install-recommends flag to the apt-get
install command portion of _apt.sh.tpl. This will modify Divingbell
to only install direct dependencies of packages instead of following
the default apt behavior, which is to also install recommended packages

Change-Id: I118a72e1e591101b0e2878e088e9fbaa96067d2c
2020-01-29 18:29:06 -06:00
Drew Walters
fe270ec595 apt: Add whitelist for strict mode
This change adds a whitelist of packages that will be ignored when using
strict mode.

Change-Id: I9138f35a72618100e6094575271f6160336332f4
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-01-27 21:23:27 +00:00
Crank, Daniel
3cc1620319 Remove 'autoremove' from strict mode apt purge
This patchset makes two changes for strict mode only:

1) Removes the --autoremove flag from the apt-get purge
   command line
2) Causes the install stage to call apt-get install on
   all packages regardless of whether they're already
   installed. This will have the effect of marking all
   requested packages as manually installed if they
   were previously auto-installed.

Change-Id: Ic1a39205c941973af9d82685180d28457ea2011f
2020-01-25 13:15:46 -06:00
Crank, Daniel
44525162a5 Add "strict" mode for apt package removal
Currently, divingbell-apt will only remove packages that aren't
on the current requested package list when they were previously
installed by divingbell-apt. This patchset adds a "strict" mode
which causes it to remove packages not on the requested package
list regardless of whether divingbell installed them (i.e., it
can remove unwanted packages that were part of the host's base
image).

Change-Id: Ie2ba5d47646bfaaf030cb54673e644ab0e917fd4
2020-01-24 12:19:22 -06:00
Schiefelbein, Andrew (as3525) as3525@att.com
ac357b9bff This is to allow for ganged install of packages instead of single
package installations with apt

Change-Id: Ifd268e7eca212fb5686b30213c1c7c1e47f5eb25
2020-01-17 16:03:03 -06:00
Phil Sphicas
788501e806 apt: chart update: allow conf.apt.packages as map
This change allows conf.apt.packages to be defined as a map of lists,
allowing for logical grouping and easier substitution when values.yaml
is being assembled from multiple sources.

The existing format (conf.apt.packages as a list) is still supported.

Change-Id: I4d4c09723b2e9ac1f0ecf847e786d991cc6e669a
2020-01-07 12:31:53 -08:00
Phil Sphicas
524c1b1e32 Fix airship-divingbell-ubuntu zuul gate
Fixes the airship-divingbell-ubuntu zuul gate.

Change-Id: I83642d43f4a4ae8a4882b120e965fcacd166700a
2020-01-07 12:31:53 -08:00
Drew Walters
66e9241d37 docs: Update copyright footer
During the recent Airship Working Committee meeting, the committee
addressed feedback from the Airship confirmation review [0]. One such
item was concerned with copyright footers mistakenly claiming rights to
all Airship documentation.

This change updates the footer to attribute documentation to the
Divingbell authors.

[0] https://etherpad.openstack.org/p/airship-wc-meeting-2019-12-09

Change-Id: I954141c18175a263973d4288c7d559c0419e08dc
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-12-09 22:05:56 +00:00
Sphicas, Phil (ps3910)
0576ecde4b doc update for blacklistpkgs
blacklistpkgs supports a list of package names only.

This updates the documentation to match the current functionality.

Change-Id: Ic6f586aa89773ea22e9bf54610ea968243583ac5
2019-11-26 15:58:50 -08:00
Zuul
010b5c6c03 Merge "apt: Add allow-downgrades option per package" 2019-10-17 18:26:23 +00:00
anthony.bellino
d917166a73 apt: Add allow-downgrades option per package
This change adds the ability to include the --allow-downgrades
option per package install.

Change-Id: I2e0c6f11a51c1b78994e77084e3b2046c179d888
2019-10-17 03:11:19 +00:00
Evgeny L
9be717e860 Allow to configure service network policy
The patch introduces network policy configuration similar
to openstack-helm services. It allows users to configure
policies depending on the environment.

* Network policies are disabled by default.
* When enabled default policies allow all ingress and
  egress traffic (i.e. policy set to {}), this may be
  changed in future patch-sets.

Change-Id: I2adb5e652c1da0a1982ab18c498f033910a47cd8
2019-09-27 20:48:09 +00:00
Anderson, Craig (ca846m)
e541ec72b7 Fix gate script trackback printout
Change-Id: I9111cddf89ad57641b163309e5d2202a44cd36eb
2019-08-26 13:53:58 -07:00
Drew Walters
2e5ffaccca apt: Add full-system upgrade feature
Currently, the APT daemonset allows the installation of new packages or
upgrade of existing packages to a newer version. Sometimes, it may be
desirable to trigger an update for all packages. This change introduces
the ability to trigger a full-system upgrade using the .conf.apt.upgrade
chart value. The new option is disabled by default.

Change-Id: I611422c2093b9dbbae4e2d7cc05ebd726e895c88
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-08-21 16:07:54 +00:00
Zuul
c503961841 Merge "ignore ethtool failures, other gate improvements" 2019-08-16 20:17:27 +00:00
Anderson, Craig (ca846m)
34c6d930e4 ignore ethtool failures, other gate improvements
Gate enhancements:

1. On certain opendev hardware, it's not possible to change
   ethtool tunables, or the expected tunables are unavailable.
   Until we have a mechanism to schedule to the right hardware,
   we will issue a warning whenever these tests fail instead of
   failing the gate.
2. Add a check so that gate script will not run until there are
   no other instances of the gate script running on the same node,
   as this can cause spurious gate failures.
3. Print gate script tracebacks in the event of gate script faliure
4. Increase check interval for two exec tests that were seen to fail
   on one ocassion due to insufficient wait time.

Change-Id: Ifdbb203a1b14242e3801ba10ef7e932931771878
2019-08-16 00:30:26 -07:00
Zuul
8e523b029c Merge "Change DaemonSet apiVersion to apps/v1" 2019-08-12 21:36:19 +00:00
Roman Gorshunov
1504533fb1 Change DaemonSet apiVersion to apps/v1
DaemonSet apiVersion: extensions/v1beta1 is deprecated starting from
Kubernetes v1.8.0-alpha.3 [0].

DaemonSet uses apiVersion: apps/v1 starting from v1.9.0 [1].

We run Kubernetes v1.13.4 and up at the moment.

[0] -
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.8.md
[1] -
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.9.md

Change-Id: Ic286e208836cf17be09fa78ba4d0f45084ae47fb
2019-08-01 20:25:43 +00:00
Roman Gorshunov
13ce2562b7 Fix: read the docs project name, webhook trigger
The docs-on-readthedocs template job requires rtd_project_name
parameter, because it's different from the project name.

Change-Id: Ibb2610c9bf997e77803bf10fdb1ee1c5423c6c96
2019-08-01 20:24:36 +00:00
Zuul
d3b1a5c985 Merge "Various gate fixes to make gate green" 2019-08-01 19:46:37 +00:00
Zuul
f727f6adf1 Merge "Add release uuid annotation to POD spec" 2019-07-30 19:04:16 +00:00
Anderson, Craig (ca846m)
c68a3ff61f Various gate fixes to make gate green
1. There is an ocassional timing issue when container logs are
   unavailabile at certain points in the crash loop at the same
   time the gate script tries to request them. The gate will now retry
   this operation, instead of terminating right away with failure.
2. Re-enable uamlite security context so that useradd operations would
   succeed.
3. Change apt pinning tests to use a version of the package that is
   available in the apt repo. Upstream repos change, so we should not
   pin to an explicit version that will be removed in the future and
   break the gate.
4. Update helm version to 2.14.1 to sync with openstack-helm-infra
5. Fix divingbell build script: git --depth=1 incompatible with explicit
   non-master commit checkout
6. Enhance overrides test case #7 to test for the issue identified in
   [0].
7. Change hostname scheduling to match minikube hostname now configured
   by OSH gate, instead of using the node's actual hostname
8. Re-enable gate voting

[0] https://storyboard.openstack.org/#!/story/2005936

Depends-On: https://review.opendev.org/671875/
Change-Id: Iad983ce363711e16ccd54e663c23d30a4a6a1177
2019-07-29 14:42:18 -07:00
Zuul
49fc3ccc7e Merge "Update uamlite.sh to handle empty user_sshkeys arrays" 2019-07-24 15:48:58 +00:00
Kumar, Nishant(nk613n)
d5a65962fe Add release uuid annotation to POD spec
Change-Id: I6158af07b15dbc098ae4e67c949b00c293b30894
2019-07-24 14:50:25 +00:00
Roman Gorshunov
45bb1f5e9c Fix: airship-divingbell gates, osh-infra path
This patch fixes osh-infra path in Divingbell gates.

Change-Id: I4b217e38e5f1670e601d8f08b91995ed23fa8bf3
2019-07-17 15:35:53 +00:00
Kaspars Skels
a98a4f911f Add Zuul job for mirroring to GitHub
Change-Id: If5e680fd4952df8eb582af82a6b767afe4ceee1c
2019-07-16 16:02:44 +00:00
Zuul
24e2119a6a Merge "Make apt container privileged" 2019-07-16 15:30:24 +00:00
Drew Walters
a900ddcf70 CI: Make Divingbell Ubuntu Job non-voting
The Divingbell Ubuntu job is currently a voting job, even though it does
not run as a gate job on merged changes. Since the OpenDev migration,
the job has failed consistently. New issues have surfaced while
attempting to correct the issue [0].

This change moves the job to non-voting in order to allow the merge of
critical work while the cause of the failures is investigated.

[0] https://review.opendev.org/663392

Change-Id: Ie44bb7f0160acc362af212028cc553ec99090acd
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-07-16 13:38:12 +00:00
Matt McEuen
ab6db0f11c Make apt container privileged
This makes the main container within the apt daemonset run as
privileged, which is required to perform kernel upgrades through it.
It was confirmed that even with all capabilities enabled, an
unprivileged apt is unable to perform the necessary updates to
the boot partition during a kernel upgrade.

Change-Id: I4e996794f24fcfc9d8ced7a58cecd2ceec36f6c5
2019-07-15 17:21:38 -05:00
Zuul
2464c3b036 Merge "Update documentation based on change to using unprivileged containers" 2019-07-02 15:58:48 +00:00
Matt Carter
4c6ac4712d Update uamlite.sh to handle empty user_sshkeys arrays
Previously _uamlite.sh.tpl would fail to render if any user data
had an empty user_sshkeys array. This is because the template would
check to see if the key existed, but not actually make sure that the
array contained within that key had any elements. "first" would be
called against the empty array, which would return nil, and then
the outer eq function call would fail (as it can't be used to
compare nil values).

This patch set adds a default statement after the "first" function,
so that if the array is empty and first returns nil, a default of
"Unmanaged" will be returned, which will end up making the eq
statement evaluate to false, and the code inside the if statement to
not be run.

Change-Id: I52713795284cd1d0961bd430858061f9df9c5f78
2019-06-25 15:16:31 -05:00
Zuul
00cebd8b3b Merge "Use common logger for consistent log output" 2019-04-24 18:24:35 +00:00
OpenDev Sysadmins
c45e4faa12 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:52:20 +00:00
Zuul
213040b429 Merge "CI: Add chart build job for latest Helm toolkit" 2019-04-17 16:17:26 +00:00
Anderson, Craig (ca846m)
87268308f8 Use common logger for consistent log output
Use the common logger for consistent log output for some echo statements
that were not making use of it.

Change-Id: I7fae2a950318f5cd3245a4571dc464009726d4ae
2019-04-11 13:23:05 -07:00
Dmitrii Kabanov
2fb6a299a3 Add support of older versions of Helm
This PS allows to avoid of using assignments which are not supported
in older versions of Helm (GO<1.11).
Change-Id: Ic0dad4d1b60071c4366c63834f1ad7e3a76fdcd8
2019-04-11 12:14:20 -07:00
Dmitrii Kabanov
8f102a878a Add possibility to add repository and GPG key
The PS adds possibility to add repository and GPG key.

Change-Id: Ie4bfc3ba9501b8af484515e9d2946725bd9eff4b
2019-04-04 01:35:53 -07:00
Drew Walters
4846a2d5c1 CI: Add chart build job for latest Helm toolkit
This commit introduces a non-voting job to lint Helm charts against the
latest version of Helm toolkit from OpenStack-Helm Infra. This job
should serve as an indicator of when it's safe to advance the version of
Helm toolkit used by Airship.

Additionally, this commit modifies all Helm chart lint jobs to run on
each commit, regardless of the files modified by a change. This should
not introduce a noticeable difference in CI runtime, as these jobs
execute quicker than the tox jobs.

Change-Id: Iffbe718f2f8cabaac74910e0c40a13e17e3f0578
2019-04-03 14:25:44 +00:00
Zuul
4798052180 Merge "Minor: Git URI schema and URL change" 2019-04-02 19:00:46 +00:00
Drew Walters
9a632008a1 tools: Update Helm to v2.13.1
Helm v2.13.1 has been released [0]. This change uplifts Helm to v2.13.1
and restores usage of the latest Helm toolkit to match other Airship
projects.

[0] https://github.com/helm/helm/releases/tag/v2.13.1

Depends-On: https://review.openstack.org/647812
Change-Id: I613d78284bab8784e2cbe18bd6c8ad2fb5f0f49b
2019-03-28 15:20:13 +00:00
BARTRA, RICK
bb582048d9 Update documentation based on change to using unprivileged containers
A recent change made most Divingbell Daemonsets run as unprivileged containers:
https://review.openstack.org/#/c/639435/

Change-Id: If4e04368a3de3c7de7a3cf64692e5dd1294234b6
2019-03-25 11:29:46 -04:00
Roman Gorshunov
9ac079dd35 Minor: Git URI schema and URL change
Change-Id: I0ec3bf08fc3f18b31ad16e7e96a2cd66605d68e4
2019-03-21 00:57:07 +01:00
Zuul
b8f2792eb6 Merge "Run Divingbell containers as unprivileged" 2019-03-20 17:31:05 +00:00