diff --git a/debian_pkg_dirs b/debian_pkg_dirs index c68999b..ee979ba 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,5 +1,6 @@ helm-charts/upstream/intel-device-plugins-operator-helm helm-charts/upstream/intel-device-plugins-dsa-helm +helm-charts/upstream/intel-device-plugins-gpu-helm helm-charts/upstream/intel-device-plugins-qat-helm helm-charts/custom/intel-device-plugins-secret-observer-helm python3-k8sapp-intel-device-plugins-operator diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/changelog b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..3ef266c --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +intel-device-plugins-gpu-helm (0.30-0) unstable; urgency=medium + + * Initial release. + + -- Md Irshad Sheikh Tue, 4 June 2024 05:48:16 -0400 diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/control b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/control new file mode 100644 index 0000000..86f616a --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: intel-device-plugins-gpu-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + helm +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: intel-device-plugins-gpu-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Intel Device Plugins GPU Helm Charts + This package contains helm charts for the Intel Device Plugins application. diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/copyright b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..2fadc2e --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: intel-device-plugins-operator-helm +Source: https://opendev.org/starlingx/app-intel-device-plugins/ + +Files: * +Copyright: (c) 2024 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: 2024 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'. diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/intel-device-plugins-gpu-helm.install b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/intel-device-plugins-gpu-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/intel-device-plugins-gpu-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/rules b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/rules new file mode 100644 index 0000000..75e6f43 --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/rules @@ -0,0 +1,29 @@ +#!/usr/bin/make -f +export DH_VERBOSE = 1 + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export CHART_BASE_VERSION = $(shell echo $(DEB_VERSION) | sed 's/-/./' | cut -d '.' -f 1-3) +export CHART_VERSION = $(CHART_BASE_VERSION)+STX.$(PATCH_VERSION) + +export ROOT = debian/tmp +export APP_FOLDER = $(ROOT)/usr/lib/helm + +%: + dh $@ + +override_dh_auto_build: + + mkdir -p intel-device-plugins-gpu + cp Chart.yaml intel-device-plugins-gpu + cp -r templates/ intel-device-plugins-gpu + cp values.yaml intel-device-plugins-gpu + + make intel-device-plugins-gpu + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(APP_FOLDER) + install -p -D -m 755 intel-device-plugins-gpu*.tgz $(APP_FOLDER) + +override_dh_auto_test: diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/source/format b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/meta_data.yaml b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/meta_data.yaml new file mode 100644 index 0000000..4484290 --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/debian/meta_data.yaml @@ -0,0 +1,15 @@ +--- +debname: intel-device-plugins-gpu-helm +debver: 0.30-0 +dl_path: + name: intel-device-plugins-gpu-v0.30.0.tgz + url: https://github.com/intel/helm-charts/releases/download/intel-device-plugins-gpu-0.30.0/intel-device-plugins-gpu-0.30.0.tgz + sha256sum: de21d597167ff1c72eaeb4266deeb08466c6995754fd06a5ccd2665ff4dc229d +src_files: + - intel-device-plugins-gpu-helm/files/Makefile +revision: + stx_patch: -1 + dist: $STX_DIST + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/app-intel-device-plugins/helm-charts/upstream/intel-device-plugins-gpu-helm + BASE_SRCREV: b03870271175204eddf3fe11e2149d4440f28674 diff --git a/helm-charts/upstream/intel-device-plugins-gpu-helm/intel-device-plugins-gpu-helm/files/Makefile b/helm-charts/upstream/intel-device-plugins-gpu-helm/intel-device-plugins-gpu-helm/files/Makefile new file mode 100644 index 0000000..0d0aeba --- /dev/null +++ b/helm-charts/upstream/intel-device-plugins-gpu-helm/intel-device-plugins-gpu-helm/files/Makefile @@ -0,0 +1,42 @@ +# +# Copyright 2017 The Openstack-Helm Authors. +# +# Copyright (c) 2024 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 --version $(CHART_VERSION) $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -f *tgz */charts/*tgz + rm -rf */charts */tmpcharts + +%: + @: diff --git a/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/common/constants.py b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/common/constants.py index 33e0d21..59189ae 100644 --- a/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/common/constants.py +++ b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/common/constants.py @@ -15,6 +15,7 @@ HELM_CHART_INTEL_DEVICE_PLUGINS_OPERATOR = 'intel-device-plugins-operator' # Helm: Supported charts: HELM_CHART_INTEL_DEVICE_PLUGINS_DSA = 'intel-device-plugins-dsa' +HELM_CHART_INTEL_DEVICE_PLUGINS_GPU = 'intel-device-plugins-gpu' HELM_CHART_INTEL_DEVICE_PLUGINS_QAT = 'intel-device-plugins-qat' HELM_CHART_SECRET_OBSERVER = 'secret-observer' HELM_CHART_SECRET_OBSERVER_RELEASE = 'intel-device-plugins-secret-observer' diff --git a/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/helm/intel_device_plugins_gpu.py b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/helm/intel_device_plugins_gpu.py new file mode 100644 index 0000000..98006ea --- /dev/null +++ b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/k8sapp_intel_device_plugins_operator/helm/intel_device_plugins_gpu.py @@ -0,0 +1,75 @@ +# +# Copyright (c) 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +from sysinv.common import exception +from sysinv.helm import base + +from k8sapp_intel_device_plugins_operator.common import constants as app_constants +from oslo_log import log as logging + +LOG = logging.getLogger(__name__) + + +class IntelDevicePluginsGpuHelm(base.FluxCDBaseHelm): + """Class to encapsulate helm operations for the intel-device-plugins-gpu chart.""" + + SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \ + [app_constants.HELM_NS_INTEL_DEVICE_PLUGINS_OPERATOR] + SUPPORTED_APP_NAMESPACES = { + app_constants.HELM_APP_INTEL_DEVICE_PLUGINS_OPERATOR: + base.BaseHelm.SUPPORTED_NAMESPACES + + [app_constants.HELM_NS_INTEL_DEVICE_PLUGINS_OPERATOR], + } + + CHART = app_constants.HELM_CHART_INTEL_DEVICE_PLUGINS_GPU + HELM_RELEASE = app_constants.HELM_CHART_INTEL_DEVICE_PLUGINS_GPU + + SERVICE_NAME = app_constants.HELM_CHART_INTEL_DEVICE_PLUGINS_GPU + + def _is_enabled(self, app_name, chart_name, namespace): + """ + Check if the chart is enable at a system level + + :param app_name: Application name + :param chart_name: Chart supplied with the application + :param namespace: Namespace where the chart will be executed + + Returns true by default if an exception occurs as most charts are + enabled. + """ + return super(IntelDevicePluginsGpuHelm, self)._is_enabled( + app_name, chart_name, namespace) + + def execute_kustomize_updates(self, operator): + """ + Update the elements of FluxCD kustomize manifests. + + This allows a helm chart plugin to use the FluxCDKustomizeOperator to + make dynamic structural changes to the application manifest based on the + current conditions in the platform + + Changes currenty include updates to the top level kustomize manifest to + disable helm releases. + + :param operator: + an instance of the FluxCDKustomizeOperator + """ + if not self._is_enabled(operator.APP, self.CHART, + app_constants.HELM_NS_INTEL_DEVICE_PLUGINS_OPERATOR): + operator.helm_release_resource_delete(self.HELM_RELEASE) + + def get_overrides(self, namespace=None): + overrides = { + app_constants.HELM_NS_INTEL_DEVICE_PLUGINS_OPERATOR: {} + } + + if namespace in self.SUPPORTED_NAMESPACES: + return overrides[namespace] + elif namespace: + raise exception.InvalidHelmNamespace( + chart=self.CHART, namespace=namespace) + else: + return overrides diff --git a/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/setup.cfg b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/setup.cfg index afcff48..740920e 100644 --- a/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/setup.cfg +++ b/python3-k8sapp-intel-device-plugins-operator/k8sapp_intel_device_plugins_operator/setup.cfg @@ -38,6 +38,8 @@ systemconfig.helm_plugins.intel_device_plugins_operator = 002_intel-device-plugins-qat = k8sapp_intel_device_plugins_operator.helm.intel_device_plugins_qat:IntelDevicePluginsQatHelm 003_intel-device-plugins-dsa = k8sapp_intel_device_plugins_operator.helm.intel_device_plugins_dsa:IntelDevicePluginsDsaHelm 004_secret-observer = k8sapp_intel_device_plugins_operator.helm.secret_observer:SecretObserverHelm + 005_intel-device-plugins-gpu = k8sapp_intel_device_plugins_operator.helm.intel_device_plugins_gpu:IntelDevicePluginsGpuHelm + systemconfig.fluxcd.kustomize_ops = intel-device-plugins-operator = k8sapp_intel_device_plugins_operator.kustomize.kustomize_intel_device_plugins:IntelDevicePluginsFluxCDKustomizeOperator diff --git a/stx-intel-device-plugins-operator-helm/debian/deb_folder/control b/stx-intel-device-plugins-operator-helm/debian/deb_folder/control index 92f52bc..c6ddd9a 100644 --- a/stx-intel-device-plugins-operator-helm/debian/deb_folder/control +++ b/stx-intel-device-plugins-operator-helm/debian/deb_folder/control @@ -7,6 +7,7 @@ Build-Depends: debhelper-compat (= 13), python3-k8sapp-intel-device-plugins-operator, python3-k8sapp-intel-device-plugins-operator-wheels, intel-device-plugins-dsa-helm, + intel-device-plugins-gpu-helm, intel-device-plugins-qat-helm, intel-device-plugins-operator-helm, intel-device-plugins-secret-observer-helm, diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/files/metadata.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/files/metadata.yaml index b0d7965..d15638a 100644 --- a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/files/metadata.yaml +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/files/metadata.yaml @@ -6,6 +6,7 @@ maintain_attributes: true disabled_charts: - intel-device-plugins-dsa +- intel-device-plugins-gpu - intel-device-plugins-qat upgrades: diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-static-overrides.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-static-overrides.yaml new file mode 100644 index 0000000..6eae081 --- /dev/null +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-static-overrides.yaml @@ -0,0 +1,5 @@ +# +# Copyright (c) 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# \ No newline at end of file diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-system-overrides.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-system-overrides.yaml new file mode 100644 index 0000000..6eae081 --- /dev/null +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/gpu-system-overrides.yaml @@ -0,0 +1,5 @@ +# +# Copyright (c) 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# \ No newline at end of file diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/helmrelease.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/helmrelease.yaml new file mode 100644 index 0000000..0cc3971 --- /dev/null +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/helmrelease.yaml @@ -0,0 +1,38 @@ +# +# Copyright (c) 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +apiVersion: "helm.toolkit.fluxcd.io/v2beta1" +kind: HelmRelease +metadata: + name: intel-device-plugins-gpu + labels: + chart_group: intel-device-plugins-operator-charts +spec: + releaseName: intel-device-plugins-gpu + chart: + spec: + chart: intel-device-plugins-gpu + version: REPLACE_HELM_CHART_VERSION + sourceRef: + kind: HelmRepository + name: stx-platform + dependsOn: + - name: intel-device-plugins-operator + interval: 1m + timeout: 30m + test: + enable: false + install: + disableHooks: false + upgrade: + disableHooks: false + valuesFrom: + - kind: Secret + name: gpu-static-overrides + valuesKey: gpu-static-overrides.yaml + - kind: Secret + name: gpu-system-overrides + valuesKey: gpu-system-overrides.yaml diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/kustomization.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/kustomization.yaml new file mode 100644 index 0000000..fcee12e --- /dev/null +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/intel-device-plugins-gpu/kustomization.yaml @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +namespace: intel-device-plugins-operator +resources: + - helmrelease.yaml +secretGenerator: + - name: gpu-static-overrides + files: + - gpu-static-overrides.yaml + - name: gpu-system-overrides + files: + - gpu-system-overrides.yaml +generatorOptions: + disableNameSuffixHash: true \ No newline at end of file diff --git a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/kustomization.yaml b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/kustomization.yaml index 01d4573..dd9cda7 100644 --- a/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/kustomization.yaml +++ b/stx-intel-device-plugins-operator-helm/stx-intel-device-plugins-operator-helm/fluxcd-manifests/kustomization.yaml @@ -10,6 +10,7 @@ namespace: intel-device-plugins-operator resources: - base - intel-device-plugins-dsa + - intel-device-plugins-gpu - intel-device-plugins-operator - intel-device-plugins-qat - secret-observer