Add Node Feature Discovery App to StarlingX

Builds and installs a FluxCD package with Node Feature Discovery

This builds a deb format package that contains the .tgz file that can be
installed on the controller using the system application tool.

Test plan:
PASSED: Build process is successful with creation of debian package.
PASSED: Extract the content of the debian package and check if the helm
chart tar file is present.
PASSED: AIO-SX app successfully uploaded, applied, removed and deleted
        using the 'system application' commands
PASSED: AIO-DX app successfully uploaded, applied, removed and deleted
        using the 'system application' commands
PASSED: STANDARD app successfully uploaded, applied, removed and deleted
        using the 'system application' commands
PASSED: AIO-SX and AIO-DX the helm chart has been loaded and the labels
        have been applied to all nodes as expected
PASSED: STANDARD the helm chart has been loaded and the labels have been
        applied to compute nodes as expected
PASSED: ALL the helm chart has been removed as well all K8s resources

Story: 2010769
Task: 48155

Change-Id: Id47ce21bb1d332bad3988cdbcf6dac2c3bb98cef
Signed-off-by: Marcos Paulo Oliveira Silva <Marcos.PauloOliveiraSilva@windriver.com>
This commit is contained in:
Marcos Paulo Oliveira Silva 2023-06-01 09:43:02 -03:00
parent 524479ff99
commit 469d0fbd9e
55 changed files with 1563 additions and 1 deletions

View File

@ -5,13 +5,52 @@
check:
jobs:
- openstack-tox-linters
- k8sapp-node-feature-discovery-tox-py39
- k8sapp-node-feature-discovery-tox-pylint
gate:
jobs:
- openstack-tox-linters
- k8sapp-node-feature-discovery-tox-py39
- k8sapp-node-feature-discovery-tox-pylint
post:
jobs:
- stx-app-node-feature-discovery-upload-git-mirror
- job:
name: k8sapp-node-feature-discovery-tox-py39
parent: tox-py39
description: |
Run py39 for node-feature-discovery app
nodeset: debian-bullseye
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python3-k8sapp-node-feature-discovery/*
vars:
tox_envlist: py39
python_version: 3.9
tox_extra_args: -c python3-k8sapp-node-feature-discovery/k8sapp_node_feature_discovery/tox.ini
- job:
name: k8sapp-node-feature-discovery-tox-pylint
parent: tox
description: |
Run pylint test for node-feature-discovery app
nodeset: ubuntu-bionic
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python3-k8sapp-node-feature-discovery/*
vars:
tox_envlist: pylint
tox_extra_args: -c python3-k8sapp-node-feature-discovery/k8sapp_node_feature_discovery/tox.ini
- job:
name: stx-app-node-feature-discovery-upload-git-mirror
parent: upload-git-mirror

16
CONTRIBUTING.rst Normal file
View File

@ -0,0 +1,16 @@
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
https://docs.openstack.org/infra/manual/developers.html
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs should be filed in Launchpad:
https://bugs.launchpad.net/starlingx

17
HACKING.rst Normal file
View File

@ -0,0 +1,17 @@
StarlingX Node-Feature-Discovery FluxCD App Style Commandments
================================================================
- Step 1: Read the OpenStack style commandments
https://docs.openstack.org/hacking/latest/
- Step 2: Read on
Node-Feature-Discovery FluxCD App Specific Commandments
---------------------------------------------------------
None so far
Running tests
-------------
The approach to running tests is to simply run the command ``tox``. This will
create virtual environments, populate them with dependencies and run all of
the tests that OpenStack CI systems run.

10
bindep.txt Normal file
View File

@ -0,0 +1,10 @@
# This is a cross-platform list tracking distribution packages needed for install and tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.
libffi-dev [platform:dpkg]
libldap2-dev [platform:dpkg]
libxml2-dev [platform:dpkg]
libxslt1-dev [platform:dpkg]
libsasl2-dev [platform:dpkg]
libffi-devel [platform:rpm]
python3-all-dev [platform:dpkg]

1
debian_build_layer.cfg Normal file
View File

@ -0,0 +1 @@
flock

2
debian_iso_image.inc Normal file
View File

@ -0,0 +1,2 @@
#stx-node-feature-discovery-helm
stx-node-feature-discovery-helm

2
debian_pkg_dirs Normal file
View File

@ -0,0 +1,2 @@
python3-k8sapp-node-feature-discovery
stx-node-feature-discovery-helm

2
github_sync.trigger Normal file
View File

@ -0,0 +1,2 @@
# to trigger the upload job to sync to GitHub
1

View File

@ -0,0 +1,5 @@
python3-k8sapp-node-feature-discovery (1.0-1) unstable; urgency=medium
* Initial release.
-- Marcos Paulo Oliveira Silva <mpaulool@windriver.com> Thu, 1 Jun 2023 12:35:25 +0000

View File

@ -0,0 +1,26 @@
Source: python3-k8sapp-node-feature-discovery
Section: libs
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
dh-python,
python3-all,
python3-pbr,
python3-setuptools,
python3-wheel
Standards-Version: 4.5.1
Homepage: https://www.starlingx.io
Package: python3-k8sapp-node-feature-discovery
Section: libs
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}
Description: StarlingX Sysinv Node Feature Discovery Extensions
This package contains sysinv plugins for the node feature discovery K8S app.
Package: python3-k8sapp-node-feature-discovery-wheels
Section: libs
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}, python3-wheel
Description: StarlingX Sysinv Node Feature Discovery Extension Wheels
This package contains python wheels for the node feature discovery K8S app plugins.

View File

@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: python3-k8sapp-node-feature-discovery
Source: https://opendev.org/starlingx/app-node-feature-discovery/
Files: *
Copyright: (c) 2013-2023 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2023 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1 @@
usr/lib/python3/dist-packages/k8sapp_*

View File

@ -0,0 +1,33 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export APP_NAME = node-feature-discovery
export PYBUILD_NAME = k8sapp-node-feature-discovery
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-')
export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export PBR_VERSION = $(MAJOR).$(MINOR_PATCH)
export ROOT = $(CURDIR)/debian/tmp
export SKIP_PIP_INSTALL = 1
%:
dh $@ --with=python3 --buildsystem=pybuild
override_dh_auto_install:
env | sort
python3 setup.py install \
--install-layout=deb \
--root $(ROOT)
python3 setup.py bdist_wheel \
--universal \
-d $(ROOT)/plugins
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
override_dh_auto_test:
PYTHONDIR=$(CURDIR) stestr run

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,9 @@
---
debname: python3-k8sapp-node-feature-discovery
debver: 1.0-1
src_path: k8sapp_node_feature_discovery
revision:
dist: $STX_DIST
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-node-feature-discovery
BASE_SRCREV: 524479ff99a11c6ab7fab04ba4f672fa5f5f6e61

View File

@ -0,0 +1,35 @@
# Compiled files
*.py[co]
*.a
*.o
*.so
# Sphinx
_build
doc/source/api/
# Packages/installer info
*.egg
*.egg-info
dist
build
eggs
parts
var
sdist
develop-eggs
.installed.cfg
# Other
*.DS_Store
.stestr
.testrepository
.tox
.venv
.*.swp
.coverage
bandit.xml
cover
AUTHORS
ChangeLog
*.sqlite

View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=./k8sapp_node_feature_discovery/tests
top_dir=./k8sapp_node_feature_discovery
#parallel_class=True

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 Wind River Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,7 @@
k8sapp-node-feature-discovery
===================
This project contains StarlingX Kubernetes application specific python plugins
for Node Feature Discovery. These plugins are required to integrate the Node Feature Discovery
application into the StarlingX application framework and to support the
various StarlingX deployments.

View File

@ -0,0 +1,28 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Helm: Supported charts:
# These values match the names in the chart package's Chart.yaml
HELM_CHART_NFD = 'node-feature-discovery'
# Namespace to deploy the application
HELM_NS_NFD = 'node-feature-discovery'
# Application Name
HELM_APP_NFD = 'node-feature-discovery'
# Custom Resources and Custom Resource Definitions
HELM_CRD_GROUP_NFD = 'nfd.k8s-sigs.io'
HELM_CRD_NAME_NF_NFD = 'nodefeatures.nfd.k8s-sigs.io'
HELM_CRD_VERSION_NF_NFD = 'v1alpha1'
HELM_CRD_PLURAL_NF_NFD = 'nodefeatures'
HELM_CRD_SHORT_NF_NFD = 'nf'
HELM_CRD_NAME_NFR_NFD = 'nodefeaturerules.nfd.k8s-sigs.io'
HELM_CRD_VERSION_NFR_NFD = 'v1alpha1'
HELM_CRD_PLURAL_NFR_NFD = 'nodefeaturerules'
HELM_CRD_SHORT_NFR_NFD = 'nfr'

View File

@ -0,0 +1,43 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sysinv.common import exception
from sysinv.helm import base
from k8sapp_node_feature_discovery.common import constants as app_constants
class NodeFeatureDiscoveryHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the node feature discovery chart"""
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[app_constants.HELM_NS_NFD]
SUPPORTED_APP_NAMESPACES = {
app_constants.HELM_APP_NFD:
base.BaseHelm.SUPPORTED_NAMESPACES + [app_constants.HELM_NS_NFD],
}
CHART = app_constants.HELM_CHART_NFD
SERVICE_NAME = app_constants.HELM_APP_NFD
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
overrides = {
app_constants.HELM_NS_NFD: {}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
if namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
return overrides

View File

@ -0,0 +1,128 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# All Rights Reserved.
#
""" System inventory App lifecycle operator."""
from oslo_log import log as logging
from sysinv.common import constants
from sysinv.common import kubernetes
from sysinv.common import utils as cutils
from sysinv.helm import lifecycle_base as base
from k8sapp_node_feature_discovery.common import constants as app_constants
LOG = logging.getLogger(__name__)
class NodeFeatureDiscoveryAppLifecycleOperator(base.AppLifecycleOperator):
def app_lifecycle_actions(self, context, conductor_obj, app_op, app, hook_info):
"""Perform lifecycle actions for an operation
:param context: request context, can be None
:param conductor_obj: conductor object, can be None
:param app_op: AppOperator object
:param app: AppOperator.Application object
:param hook_info: LifecycleHookInfo object
"""
if hook_info.lifecycle_type == constants.APP_LIFECYCLE_TYPE_OPERATION:
if hook_info.operation == constants.APP_REMOVE_OP:
if hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_PRE:
return self.pre_remove(app, app_op)
if hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_POST:
return self.post_remove(app, app_op)
super(NodeFeatureDiscoveryAppLifecycleOperator, self).app_lifecycle_actions(
context, conductor_obj, app_op, app, hook_info
)
def pre_remove(self, app, app_op):
# Due to ordering of deletes, to prevent the namespace finalizer from waiting
# indefinitely, we need to ensure that the custom resources, if they exist,
# are deleted.
LOG.debug(
"Executing pre_remove for {} app".format(app_constants.HELM_APP_NFD))
custom_resources_list = []
custom_resources_list = app_op._kube.list_namespaced_custom_resources(
app_constants.HELM_CRD_GROUP_NFD,
app_constants.HELM_CRD_VERSION_NF_NFD,
app_constants.HELM_NS_NFD,
app_constants.HELM_CRD_PLURAL_NF_NFD)
if custom_resources_list:
for custom_resource in custom_resources_list:
app_op._kube.delete_custom_resource(
app_constants.HELM_CRD_GROUP_NFD,
app_constants.HELM_CRD_VERSION_NF_NFD,
app_constants.HELM_NS_NFD,
app_constants.HELM_CRD_PLURAL_NF_NFD,
custom_resource["metadata"]["name"])
custom_resources_list = app_op._kube.list_custom_resources(
app_constants.HELM_CRD_GROUP_NFD,
app_constants.HELM_CRD_VERSION_NFR_NFD,
app_constants.HELM_CRD_PLURAL_NFR_NFD)
if custom_resources_list:
for custom_resource in custom_resources_list:
cmd = ['kubectl', '--kubeconfig',
kubernetes.KUBERNETES_ADMIN_CONF, 'delete',
"{}/{}".format(app_constants.HELM_CRD_SHORT_NFR_NFD,
custom_resource["metadata"]["name"])
]
stdout, stderr = cutils.trycmd(*cmd)
if stderr:
LOG.warn("{} app: cmd={} stdout={} stderr={}".format(app.name,
cmd,
stdout,
stderr))
else:
LOG.debug("{} app: cmd={} stdout={}".format(app.name,
cmd,
stdout))
def post_remove(self, app, app_op):
LOG.debug(
"Executing post_remove for {} app".format(app_constants.HELM_APP_NFD))
# Helm doesn't delete CRDs and the namespace. To clean up after
# application-remove, we need to explicitly delete them.
cmd = ['kubectl', '--kubeconfig', kubernetes.KUBERNETES_ADMIN_CONF,
'delete','crd', app_constants.HELM_CRD_NAME_NF_NFD]
stdout, stderr = cutils.trycmd(*cmd)
if stderr:
LOG.warn("{} app: cmd={} stdout={} stderr={}".format(app.name,
cmd,
stdout,
stderr))
else:
LOG.debug("{} app: cmd={} stdout={}".format(app.name, cmd, stdout))
cmd = ['kubectl', '--kubeconfig', kubernetes.KUBERNETES_ADMIN_CONF,
'delete','crd', app_constants.HELM_CRD_NAME_NFR_NFD]
stdout, stderr = cutils.trycmd(*cmd)
if stderr:
LOG.warn("{} app: cmd={} stdout={} stderr={}".format(app.name,
cmd,
stdout,
stderr))
else:
LOG.debug("{} app: cmd={} stdout={}".format(app.name, cmd, stdout))
app_op._kube.kube_delete_namespace(app_constants.HELM_NS_NFD)

View File

@ -0,0 +1,25 @@
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_node_feature_discovery.tests import test_plugins
from sysinv.db import api as dbapi
from sysinv.tests.db import base as dbbase
from sysinv.tests.db import utils as dbutils
from sysinv.tests.helm import base
class NodeFeatureDiscoveryTestCase(test_plugins.K8SAppNodeFeatureDiscoveryAppMixin,
base.HelmTestCaseMixin):
def setUp(self):
super(NodeFeatureDiscoveryTestCase, self).setUp()
self.app = dbutils.create_test_app(name='node-feature-discovery')
self.dbapi = dbapi.get_instance()
class NodeFeatureDiscoveryTestCaseDummy(NodeFeatureDiscoveryTestCase, dbbase.ProvisionedControllerHostTestCase):
# without a test zuul will fail
def test_dummy(self):
pass

View File

@ -0,0 +1,40 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_node_feature_discovery.common import constants as app_constants
from sysinv.tests.db import base as dbbase
class K8SAppNodeFeatureDiscoveryAppMixin(object):
app_name = app_constants.HELM_APP_NFD
path_name = app_name + '.tgz'
def setUp(self):
super(K8SAppNodeFeatureDiscoveryAppMixin, self).setUp()
# Test Configuration:
# - Controller
# - IPv6
# - Ceph Storage
# - node-feature-discovery app
class K8sAppNodeFeatureDiscoveryControllerTestCase(K8SAppNodeFeatureDiscoveryAppMixin,
dbbase.BaseIPv6Mixin,
dbbase.BaseCephStorageBackendMixin,
dbbase.ControllerHostTestCase):
pass
# Test Configuration:
# - AIO
# - IPv4
# - Ceph Storage
# - node-feature-discovery app
class K8SAppNodeFeatureDiscoveryAIOTestCase(K8SAppNodeFeatureDiscoveryAppMixin,
dbbase.BaseCephStorageBackendMixin,
dbbase.AIOSimplexHostTestCase):
pass

View File

@ -0,0 +1,320 @@
[MASTER]
# Specify a configuration file.
rcfile=pylint.rc
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. Should be base names, not paths.
ignore=tests
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=4
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=lxml.etree,greenlet
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
#
# Python3 checker:
#
# E1601: print-statement
# E1602: parameter-unpacking
# E1603: unpacking-in-except
# E1604: old-raise-syntax
# E1605: backtick
# E1606: long-suffix
# E1607: old-ne-operator
# E1608: old-octal-literal
# E1609: import-star-module-level
# E1610: non-ascii-bytes-literal
# E1611: invalid-unicode-literal
# W1601: apply-builtin
# W1602: basestring-builtin
# W1603: buffer-builtin
# W1604: cmp-builtin
# W1605: coerce-builtin
# W1606: execfile-builtin
# W1607: file-builtin
# W1608: long-builtin
# W1609: raw_input-builtin
# W1610: reduce-builtin
# W1611: standarderror-builtin
# W1612: unicode-builtin
# W1613: xrange-builtin
# W1614: coerce-method
# W1615: delslice-method
# W1616: getslice-method
# W1617: setslice-method
# W1618: no-absolute-import
# W1619: old-division
# W1620: dict-iter-method
# W1621: dict-view-method
# W1622: next-method-called
# W1623: metaclass-assignment
# W1624: indexing-exception
# W1625: raising-string
# W1626: reload-builtin
# W1627: oct-method
# W1628: hex-method
# W1629: nonzero-method
# W1630: cmp-method
# W1632: input-builtin
# W1633: round-builtin
# W1634: intern-builtin
# W1635: unichr-builtin
# W1636: map-builtin-not-iterating
# W1637: zip-builtin-not-iterating
# W1638: range-builtin-not-iterating
# W1639: filter-builtin-not-iterating
# W1640: using-cmp-argument
# W1641: eq-without-hash
# W1642: div-method
# W1643: idiv-method
# W1644: rdiv-method
# W1645: exception-message-attribute
# W1646: invalid-str-codec
# W1647: sys-max-int
# W1648: bad-python3-import
# W1649: deprecated-string-function
# W1650: deprecated-str-translate-call
# W1651: deprecated-itertools-function
# W1652: deprecated-types-field
# W1653: next-method-defined
# W1654: dict-items-not-iterating
# W1655: dict-keys-not-iterating
# W1656: dict-values-not-iterating
# W1657: deprecated-operator-function
# W1658: deprecated-urllib-function
# W1659: xreadlines-attribute
# W1660: deprecated-sys-function
# W1661: exception-escape
# W1662: comprehension-escape
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
# See "Messages Control" section of
# https://pylint.readthedocs.io/en/latest/user_guide
# We are disabling (C)onvention
# We are disabling (R)efactor
# Disable Python3 checkers:
# W0107: unnecessary-pass
# W0212: protected-access
# W1406: redundant-u-string-prefix
# W1618: no-absolute-import
# E0401: import-error
# E0602: undefined-variable
# E0611: no-name-in-module
disable=C, R, W0107, W0212, W1406, W1618, E0401, E0602, E0611
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=85
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually 4 spaces or "\t" (1 tab).
indent-string=' '
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis
ignored-modules=distutils,eventlet.green.subprocess,six,six.moves
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
# pylint is confused by sqlalchemy Table, as well as sqlalchemy Enum types
# ie: (unprovisioned, identity)
# LookupDict in requests library confuses pylint
ignored-classes=SQLObject, optparse.Values, thread._local, _thread._local,
Table, unprovisioned, identity, LookupDict
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[BASIC]
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match functions or classes name which do
# not require a docstring
no-docstring-rgx=__.*__
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception

View File

@ -0,0 +1,2 @@
pbr==5.1.3
PyYAML>=3.13

View File

@ -0,0 +1,43 @@
[metadata]
name = k8sapp-node-feature-discovery
summary = StarlingX sysinv extensions for node-feature-discovery
long_description = file: README.rst
long_description_content_type = text/x-rst
license = Apache 2.0
author = StarlingX
author-email = starlingx-discuss@lists.starlingx.io
home-page = https://www.starlingx.io/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.9
[files]
packages =
k8sapp_node_feature_discovery
[global]
setup-hooks =
pbr.hooks.setup_hook
[entry_points]
systemconfig.helm_applications =
node-feature-discovery = systemconfig.helm_plugins.node_feature_discovery
systemconfig.helm_plugins.node_feature_discovery =
001_node-feature-discovery = k8sapp_node_feature_discovery.helm.node_feature_discovery:NodeFeatureDiscoveryHelm
systemconfig.app_lifecycle =
node-feature-discovery = k8sapp_node_feature_discovery.lifecycle.lifecycle_node_feature_discovery:NodeFeatureDiscoveryAppLifecycleOperator
[bdist_wheel]
universal = 1

View File

@ -0,0 +1,12 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import setuptools
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)

View File

@ -0,0 +1,22 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<=2.0.0 # Apache-2.0
coverage>=3.6
discover
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
passlib>=1.7.0
psycopg2-binary
python-subunit>=0.0.18
requests-mock>=0.6.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testrepository>=0.0.18
testtools>=2.2.0 # MIT
tempest-lib>=0.4.0
ipaddr
pytest
pyudev
migrate
markupsafe

View File

@ -0,0 +1,116 @@
[tox]
envlist = flake8,py39,pylint,bandit
minversion = 1.6
# disable source dist generation because Zuul fails on setting up
# pbr randomly in the sdist step.
skipsdist = True
#,pip-missing-reqs
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_k8snodefeaturediscoverytox
stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
# usedevelop = True
# enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository.
# Note. site-packages is true and rpm-python must be yum installed on your dev machine.
sitepackages = False
# tox is silly... these need to be separated by a newline....
allowlist_externals = bash
find
install_command = pip install -v -v -v --use-deprecated legacy-resolver\
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages}
# Note the hash seed is set to 0 until can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
PYTHONDONTWRITEBYTECODE=1
OS_TEST_PATH=./k8sapp_node_feature_discovery/tests
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
SYSINV_TEST_ENV=True
TOX_WORK_DIR={toxworkdir}
PYLINTHOME={toxworkdir}
# the path to cgcs-patch should be updated to sw-patch
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/fault/fm-api/source
-e{[tox]stxdir}/fault/python-fmclient/fmclient
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
commands =
find . -type f -name "*.pyc" -delete
[flake8]
exclude = build,dist,tools,.eggs
max-line-length=120
[testenv:flake8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
flake8-bugbear
commands =
flake8 {posargs} .
[testenv:py39]
basepython = python3.9
usedevelop = True
install_command = pip install -v -v -v --use-deprecated legacy-resolver\
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
# testenv:flake8 clone
basepython = {[testenv:flake8]basepython}
deps = {[testenv:flake8]deps}
commands = {[testenv:flake8]commands}
[testenv:venv]
commands = {posargs}
[bandit]
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r k8sapp_node_feature_discovery
[testenv:pylint]
basepython = python3
sitepackages = False
deps = {[testenv]deps}
pylint
commands =
pylint {posargs} k8sapp_node_feature_discovery --rcfile=./pylint.rc
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_missing_reqs
-rrequirements.txt
commands=pip-missing-reqs -d --ignore-file=/k8sapp_node_feature_discovery/tests k8sapp_node_feature_discovery

View File

@ -0,0 +1 @@
# Override upstream constraints based on StarlingX load

View File

@ -0,0 +1,5 @@
stx-node-feature-discovery-helm (1.0-1) unstable; urgency=medium
* Initial release.
-- Marcos Paulo Oliveira Silva <mpaulool@windriver.com> Thu, 1 Jun 2023 12:35:25 +0000

View File

@ -0,0 +1,18 @@
Source: stx-node-feature-discovery-helm
Section: libs
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
helm,
procps,
python3-k8sapp-node-feature-discovery,
python3-k8sapp-node-feature-discovery-wheels
Standards-Version: 4.5.1
Homepage: https://www.starlingx.io
Package: stx-node-feature-discovery-helm
Section: libs
Architecture: any
Depends: ${misc:Depends}
Description: StarlingX Node Feature Discovery Application FluxCD Helm Charts
This package contains Fluxcd helm charts for the node feature discovery application.

View File

@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: stx-node-feature-discovery-helm
Source: https://opendev.org/starlingx/app-node-feature-discovery/
Files: *
Copyright: (c) 2013-2023 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2023 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1,67 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export ROOT = debian/tmp
export APP_FOLDER = $(ROOT)/usr/local/share/applications/helm
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export RELEASE = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-')
export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export APP_NAME = node-feature-discovery
export APP_VERSION = $(RELEASE)-$(REVISION)
export APP_TARBALL_FLUXCD = $(APP_NAME)-$(APP_VERSION).tgz
export HELM_REPO = stx-platform
export STAGING_FLUXCD = staging-fluxcd
export FLUXCD_NFD_PKG = helm-charts-node-feature-discovery-0.13.1.tar.gz
%:
dh $@
override_dh_auto_build:
############
# FLUXCD #
############
mkdir -p fluxcd
cd fluxcd ; \
mkdir -p $(APP_NAME); \
tar xvfz ../$(FLUXCD_NFD_PKG) ; \
mv -f helm-charts/* $(APP_NAME)
# Create the TGZ file.
cp files/Makefile fluxcd
cd fluxcd && $(MAKE) $(APP_NAME)
# Setup the staging directory.
mkdir -p $(STAGING_FLUXCD)
cp files/metadata.yaml $(STAGING_FLUXCD)
mkdir -p $(STAGING_FLUXCD)/charts
cp fluxcd/*.tgz $(STAGING_FLUXCD)/charts
# Populate metadata.
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING_FLUXCD)/metadata.yaml
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING_FLUXCD)/metadata.yaml
sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING_FLUXCD)/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING_FLUXCD)/plugins
cp /plugins/*.whl $(STAGING_FLUXCD)/plugins
cp -R fluxcd-manifests $(STAGING_FLUXCD)/
# calculate checksum of all files in app_staging
cd $(STAGING_FLUXCD) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar cfz $(APP_TARBALL_FLUXCD) -C $(STAGING_FLUXCD)/ .
# Cleanup staging
rm -rf $(STAGING_FLUXCD)
override_dh_auto_install:
# Install the app tar file.
install -d -m 755 $(APP_FOLDER)
install -p -D -m 755 $(APP_TARBALL_FLUXCD) $(APP_FOLDER)
override_dh_auto_test:
override_dh_usrlocal:

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1 @@
usr/local/share/applications/helm/*

View File

@ -0,0 +1,14 @@
---
debname: stx-node-feature-discovery-helm
debver: 1.0-1
src_path: stx-node-feature-discovery-helm
dl_files:
helm-charts-node-feature-discovery-0.13.1.tar.gz:
topdir: helm-charts
url: https://github.com/kubernetes-sigs/node-feature-discovery/releases/download/v0.13.1/node-feature-discovery-chart-0.13.1.tgz
md5sum: 57d3dc77effc8bc53eb2b1a6bd7d48a1
revision:
dist: $STX_DIST
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-node-feature-discovery
BASE_SRCREV: 524479ff99a11c6ab7fab04ba4f672fa5f5f6e61

View File

@ -0,0 +1,42 @@
#
# Copyright 2017 The Openstack-Helm Authors.
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
TASK := build
EXCLUDES := doc tests tools logs tmp
CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
all: $(CHARTS)
$(CHARTS):
@if [ -d $@ ]; then \
echo; \
echo "===== Processing [$@] chart ====="; \
$(MAKE) $(TASK)-$@; \
fi
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%: lint-%
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
%:
@:

View File

@ -0,0 +1,21 @@
maintain_user_overrides: true
app_name: @APP_NAME@
app_version: @APP_VERSION@
helm_repo: @HELM_REPO@
upgrades:
auto_update: true
behavior:
platform_managed_app: yes
evaluate_reapply:
triggers:
- type: swact
- type: force-swact
- type: host-delete
filters:
- personality: controller
- type: kube-upgrade-complete
filters:
- availability: services-enabled

View File

@ -0,0 +1,13 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: stx-platform
spec:
url: http://192.168.206.1:8080/helm_charts/stx-platform
interval: 1m

View File

@ -0,0 +1,8 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
resources:
- helmrepository.yaml

View File

@ -0,0 +1,10 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: v1
kind: Namespace
metadata:
name: node-feature-discovery

View File

@ -0,0 +1,12 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: node-feature-discovery
resources:
- base
- node-feature-discovery

View File

@ -0,0 +1,36 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: node-feature-discovery
labels:
chart_group: node-feature-discovery-charts
spec:
releaseName: node-feature-discovery
chart:
spec:
chart: node-feature-discovery
version: 0.13.1
sourceRef:
kind: HelmRepository
name: stx-platform
interval: 1m
timeout: 30m
test:
enable: false
install:
disableHooks: false
upgrade:
disableHooks: false
valuesFrom:
- kind: Secret
name: node-feature-discovery-static-overrides
valuesKey: node-feature-discovery-static-overrides.yaml
- kind: Secret
name: node-feature-discovery-system-overrides
valuesKey: node-feature-discovery-system-overrides.yaml

View File

@ -0,0 +1,18 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
namespace: node-feature-discovery
resources:
- helmrelease.yaml
secretGenerator:
- name: node-feature-discovery-static-overrides
files:
- node-feature-discovery-static-overrides.yaml
- name: node-feature-discovery-system-overrides
files:
- node-feature-discovery-system-overrides.yaml
generatorOptions:
disableNameSuffixHash: true

View File

@ -0,0 +1,15 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
imagePullSecrets: [{"name": "default-registry-key"}]
image:
# cleans the default digest value since sysinv changes the digest when pushing the image to the local registry
digest: ""
repository: registry.k8s.io/nfd/node-feature-discovery
tag: v0.13.1
namespaceOverride: "node-feature-discovery"

View File

@ -0,0 +1,6 @@
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

View File

@ -1,4 +1,4 @@
# hacking pulls in flake8
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=1.1.0,<=2.0.0 # Apache-2.0
bashate >= 0.2