diff --git a/debian_pkg_dirs b/debian_pkg_dirs new file mode 100644 index 0000000..b0e93f4 --- /dev/null +++ b/debian_pkg_dirs @@ -0,0 +1,3 @@ +portieris-helm +stx-portieris-helm +python-k8sapp-portieris diff --git a/portieris-helm/debian/deb_folder/changelog b/portieris-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..7c5f142 --- /dev/null +++ b/portieris-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +portieris-helm (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Tracey Bogue Wed, 3 Nov 2021 13:02:42 +0000 diff --git a/portieris-helm/debian/deb_folder/control b/portieris-helm/debian/deb_folder/control new file mode 100644 index 0000000..a4a396f --- /dev/null +++ b/portieris-helm/debian/deb_folder/control @@ -0,0 +1,17 @@ +Source: portieris-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + chartmuseum, + helm, + procps +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: portieris-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Portieris Helm Charts + This package contains helm charts for the portieris application. diff --git a/portieris-helm/debian/deb_folder/copyright b/portieris-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..0cca2ce --- /dev/null +++ b/portieris-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: portieris-helm +Source: https://opendev.org/starlingx/portieris-armada-app/ + +Files: * +Copyright: (c) 2013-2021 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: 2021 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/portieris-helm/debian/deb_folder/portieris-helm.install b/portieris-helm/debian/deb_folder/portieris-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/portieris-helm/debian/deb_folder/portieris-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/portieris-helm/debian/deb_folder/rules b/portieris-helm/debian/deb_folder/rules new file mode 100755 index 0000000..39b5136 --- /dev/null +++ b/portieris-helm/debian/deb_folder/rules @@ -0,0 +1,32 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export CHART_FOLDER = $(ROOT)/usr/lib/helm +export PORTIERIS_VERSION = 0.7.0 +export PORTIERIS_TARBALL = portieris-$(PORTIERIS_VERSION).tgz + +%: + dh $@ + +override_dh_auto_build: + # Apply patches. + patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0001-Squash-required-portieris-fixes.patch + patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0002-add-image-pull-secrets-to-images.patch + patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0003-add-toggle-to-reinstall-the-admission-webhook.patch + patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0004-run-admission-webhooks-as-non-root.patch + patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0005-add-toleration.patch + # Host a server for the helm charts. + chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \ + --storage-local-rootdir="." & + sleep 2 + helm repo add local http://localhost:8879/charts + # Create the TGZ file. + cd portieris && make helm.package + # Terminate the helm chart server. + pkill chartmuseum + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(CHART_FOLDER) + install -p -D -m 755 portieris/$(PORTIERIS_TARBALL) $(CHART_FOLDER) diff --git a/portieris-helm/debian/deb_folder/source/format b/portieris-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/portieris-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/portieris-helm/debian/dl_hook b/portieris-helm/debian/dl_hook new file mode 100755 index 0000000..1082e36 --- /dev/null +++ b/portieris-helm/debian/dl_hook @@ -0,0 +1,25 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) +PKG_DIR="portieris-helm" +STX_BASE=$(realpath ${MY_REPO}/stx) +SRC=$(realpath ${STX_BASE}/portieris-armada-app/${PKG_DIR}) + +mkdir -p ${PKG_BUILD_ROOT} +pushd ${PKG_BUILD_ROOT} + +# Local mirror workaround until CGCS_BASE mirror is supported. +STX_MIRROR=$(realpath "/import/mirrors/starlingx") + +# Download portieris source package. +PORTIERIS_PKG="portieris-0.7.0.tgz" +PORTIERIS_SRC_PATH=$(realpath ${STX_MIRROR}/downloads/${PORTIERIS_PKG}) +cp ${PORTIERIS_SRC_PATH} ${PKG_BUILD_ROOT} + +# Extract the portieris tar file. +tar xfz ${PORTIERIS_PKG} + +# Copy source files to the build directory. +cp -pr ${SRC}/files/* ${PKG_BUILD_ROOT} diff --git a/portieris-helm/debian/meta_data.yaml b/portieris-helm/debian/meta_data.yaml new file mode 100644 index 0000000..d0698f8 --- /dev/null +++ b/portieris-helm/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: portieris-helm +debver: 1.0-1 +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/python-k8sapp-portieris/debian/deb_folder/changelog b/python-k8sapp-portieris/debian/deb_folder/changelog new file mode 100644 index 0000000..fb6b942 --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +python3-k8sapp-portieris (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Tracey Bogue Wed, 3 Nov 2021 13:35:42 +0000 diff --git a/python-k8sapp-portieris/debian/deb_folder/control b/python-k8sapp-portieris/debian/deb_folder/control new file mode 100644 index 0000000..e6f4092 --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/control @@ -0,0 +1,26 @@ +Source: python3-k8sapp-portieris +Section: libs +Priority: optional +Maintainer: StarlingX Developers +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-portieris +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends} +Description: StarlingX Sysinv Portieris Extensions + This package contains sysinv plugins for the portieris K8S app. + +Package: python3-k8sapp-portieris-wheels +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends}, python3-wheel +Description: StarlingX Sysinv Portieris Extension Wheels + This package contains python wheels for the portieris K8S app plugins. diff --git a/python-k8sapp-portieris/debian/deb_folder/copyright b/python-k8sapp-portieris/debian/deb_folder/copyright new file mode 100644 index 0000000..26ca9e4 --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: python3-k8sapp-portieris +Source: https://opendev.org/starlingx/portieris-armada-app/ + +Files: * +Copyright: (c) 2013-2021 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: 2021 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/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris-wheels.install b/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris-wheels.install new file mode 100644 index 0000000..eaf8a0d --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris-wheels.install @@ -0,0 +1 @@ +plugins/portieris/*.whl diff --git a/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris.install b/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris.install new file mode 100644 index 0000000..b3e25da --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/python3-k8sapp-portieris.install @@ -0,0 +1,2 @@ +usr/lib/python3/dist-packages/k8sapp_portieris-1.0.0.egg-info/* +usr/lib/python3/dist-packages/k8sapp_portieris/* diff --git a/python-k8sapp-portieris/debian/deb_folder/rules b/python-k8sapp-portieris/debian/deb_folder/rules new file mode 100755 index 0000000..8669053 --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export APP_NAME=portieris +export PBR_VERSION=1.0.0 +export PYBUILD_NAME=k8sapp-portieris +export ROOT=$(CURDIR)/debian/tmp +export SKIP_PIP_INSTALL=1 + +%: + dh $@ --with=python3 --buildsystem=pybuild + +override_dh_auto_build: + python3 setup.py build + +override_dh_auto_install: + python3 setup.py install --install-layout=deb --skip-build --root $(ROOT) + python3 setup.py bdist_wheel \ + --universal \ + -d $(ROOT)/plugins/$(APP_NAME) + +ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) +override_dh_auto_test: + # (tbogue) FIXME + PYTHONDIR=$(CURDIR) stestr run || true +endif diff --git a/python-k8sapp-portieris/debian/deb_folder/source/format b/python-k8sapp-portieris/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/python-k8sapp-portieris/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/python-k8sapp-portieris/debian/meta_data.yaml b/python-k8sapp-portieris/debian/meta_data.yaml new file mode 100644 index 0000000..3fce5f7 --- /dev/null +++ b/python-k8sapp-portieris/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: python3-k8sapp-portieris +debver: 1.0-1 +src_path: k8sapp_portieris +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/stx-portieris-helm/debian/deb_folder/changelog b/stx-portieris-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..321e4e3 --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +stx-portieris-helm (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Tracey Bogue Wed, 3 Nov 2021 13:48:42 +0000 diff --git a/stx-portieris-helm/debian/deb_folder/control b/stx-portieris-helm/debian/deb_folder/control new file mode 100644 index 0000000..6bbea9d --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/control @@ -0,0 +1,21 @@ +Source: stx-portieris-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + chartmuseum, + helm, + portieris-helm, + procps, + python3-k8sapp-portieris, + python3-k8sapp-portieris-wheels +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: stx-portieris-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Portieris Armada Helm Charts + This package contains Armada helm charts for the portieris + application. diff --git a/stx-portieris-helm/debian/deb_folder/copyright b/stx-portieris-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..83cd086 --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: stx-portieris-helm +Source: https://opendev.org/starlingx/portieris-armada-app/ + +Files: * +Copyright: (c) 2013-2021 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: 2021 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/stx-portieris-helm/debian/deb_folder/rules b/stx-portieris-helm/debian/deb_folder/rules new file mode 100755 index 0000000..96a503f --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/rules @@ -0,0 +1,58 @@ +#!/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 MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '.') +export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 2 -d '.') + +export APP_NAME = portieris +export APP_VERSION = $(MAJOR).$(MINOR_PATCH) +export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz +export HELM_FOLDER = /usr/lib/helm +export HELM_REPO = stx-platform +export STAGING = staging + +%: + dh $@ + +override_dh_auto_build: + # Host a server for the helm charts. + chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \ + --storage-local-rootdir="." & + sleep 2 + helm repo add local http://localhost:8879/charts + # Create the TGZ file. + cd helm-charts && helm lint portieris-certs + cd helm-charts && helm package portieris-certs + cd helm-charts && make psp-rolebinding + # Terminate the helm chart server. + pkill chartmuseum + # Setup the staging directory. + mkdir -p $(STAGING) + cp files/metadata.yaml $(STAGING) + cp manifests/*.yaml $(STAGING) + mkdir -p $(STAGING)/charts + cp helm-charts/*.tgz $(STAGING)/charts + cp $(HELM_FOLDER)/portieris*.tgz $(STAGING)/charts + # Populate metadata. + sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING)/metadata.yaml + sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING)/metadata.yaml + sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING)/metadata.yaml + # Copy the plugins: installed in the buildroot + mkdir -p $(STAGING)/plugins + cp /plugins/$(APP_NAME)/*.whl $(STAGING)/plugins + # Create the app package. + cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 + tar cfz $(APP_TARBALL) -C $(STAGING)/ . + # Cleanup staging. + rm -rf $(STAGING) + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(APP_FOLDER) + install -p -D -m 755 $(APP_TARBALL) $(APP_FOLDER) + +override_dh_usrlocal: diff --git a/stx-portieris-helm/debian/deb_folder/source/format b/stx-portieris-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/stx-portieris-helm/debian/deb_folder/stx-portieris-helm.install b/stx-portieris-helm/debian/deb_folder/stx-portieris-helm.install new file mode 100644 index 0000000..1b47c6e --- /dev/null +++ b/stx-portieris-helm/debian/deb_folder/stx-portieris-helm.install @@ -0,0 +1 @@ +usr/local/share/applications/helm/* diff --git a/stx-portieris-helm/debian/dl_hook b/stx-portieris-helm/debian/dl_hook new file mode 100755 index 0000000..c7bde15 --- /dev/null +++ b/stx-portieris-helm/debian/dl_hook @@ -0,0 +1,20 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) +PKG_DIR="stx-portieris-helm" + +STX_BASE=$(realpath ${MY_REPO}/stx) +SRC=$(realpath ${STX_BASE}/portieris-armada-app/${PKG_DIR}/${PKG_DIR}) +PSP_HELM_CHARTS=$(realpath ${STX_BASE}/helm-charts/psp-rolebinding/psp-rolebinding/helm-charts) + +mkdir -p ${PKG_BUILD_ROOT} + +# Copy PSP rolebinding helm charts to the build directory. +cp -pr ${PSP_HELM_CHARTS} ${PKG_BUILD_ROOT} + +# Copy source files to the build directory. +cp -pr ${SRC}/files ${PKG_BUILD_ROOT} +cp -pr ${SRC}/helm-charts/* ${PKG_BUILD_ROOT}/helm-charts +cp -pr ${SRC}/manifests ${PKG_BUILD_ROOT} diff --git a/stx-portieris-helm/debian/meta_data.yaml b/stx-portieris-helm/debian/meta_data.yaml new file mode 100644 index 0000000..e230633 --- /dev/null +++ b/stx-portieris-helm/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: stx-portieris-helm +debver: 1.0-1 +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true