From dcd76cd624da2ee75e50ad095bb30dce696585be Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Wed, 21 Dec 2022 06:39:02 -0300 Subject: [PATCH] Standardize app configs Fixed versioning and adjusted some build files to bring them as close to a standard as possible. - Removed centos files - Added version tracking via GITREVCOUNT - Fixed mismatch in plugin name, set to python3-k8sapp- - Standardized plugin debian files (rules, *.install) - Plugin wheels saved to /plugin instead of /plugin/ Test Plan: PASS - Build-pkgs -a PASS - Build-image PASS - Install, bootstrap, unlock PASS - app tarball contains wheel file PASS - wheel versioning updated properly Story: 2010542 Task: 47191 Signed-off-by: Leonardo Fagundes Luz Serrano Change-Id: If383233094d6539483c93016264d62da6dc4753f --- .zuul.yaml | 8 +- centos_build_layer.cfg | 1 - centos_iso_image.inc | 1 - centos_pkg_dirs | 2 - centos_pkg_dirs_containers | 2 - centos_stable_docker_images.inc | 1 - debian_pkg_dirs | 2 +- .../centos/build_srpm.data | 3 - .../python-k8sapp-sriov-fec-operator.spec | 52 ---------- ...3-k8sapp-sriov-fec-operator-wheels.install | 1 - .../python3-k8sapp-sriov-fec-operator.install | 2 - .../debian/deb_folder/rules | 26 ----- .../debian/deb_folder/changelog | 0 .../debian/deb_folder/control | 0 .../debian/deb_folder/copyright | 0 ...3-k8sapp-sriov-fec-operator-wheels.install | 1 + .../python3-k8sapp-sriov-fec-operator.install | 1 + .../debian/deb_folder/rules | 33 +++++++ .../debian/deb_folder/source/format | 0 .../debian/meta_data.yaml | 4 +- .../k8sapp_sriov_fec_operator/.gitignore | 0 .../k8sapp_sriov_fec_operator/.stestr.conf | 0 .../k8sapp_sriov_fec_operator/LICENSE | 0 .../k8sapp_sriov_fec_operator/README.rst | 0 .../k8sapp_sriov_fec_operator/__init__.py | 0 .../common/__init__.py | 0 .../common/constants.py | 0 .../helm/__init__.py | 0 .../helm/sriov_fec_operator.py | 0 .../lifecycle/__init__.py | 0 .../lifecycle/lifecycle_sriov_fec_operator.py | 0 .../tests/__init__.py | 0 .../tests/test_plugins.py | 0 .../tests/test_sriov_fec_operator.py | 0 .../k8sapp_sriov_fec_operator/pylint.rc | 0 .../requirements.txt | 0 .../k8sapp_sriov_fec_operator/setup.cfg | 2 +- .../k8sapp_sriov_fec_operator/setup.py | 0 .../test-requirements.txt | 0 .../k8sapp_sriov_fec_operator/tox.ini | 0 .../upper-constraints.txt | 0 .../centos/build-sriov-fec-operator-image.sh | 90 ------------------ .../sriov-fec-daemon.stable_docker_image | 9 -- .../sriov-fec-labeler.stable_docker_image | 9 -- .../sriov-fec-operator.stable_docker_image | 9 -- .../centos/build_srpm.data | 9 -- .../centos/stx-sriov-fec-operator-helm.spec | 94 ------------------- .../debian/deb_folder/rules | 2 +- .../debian/meta_data.yaml | 4 +- 49 files changed, 48 insertions(+), 320 deletions(-) delete mode 100644 centos_build_layer.cfg delete mode 100644 centos_iso_image.inc delete mode 100644 centos_pkg_dirs delete mode 100644 centos_pkg_dirs_containers delete mode 100644 centos_stable_docker_images.inc delete mode 100644 python-k8sapp-sriov-fec-operator/centos/build_srpm.data delete mode 100644 python-k8sapp-sriov-fec-operator/centos/python-k8sapp-sriov-fec-operator.spec delete mode 100644 python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install delete mode 100644 python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install delete mode 100644 python-k8sapp-sriov-fec-operator/debian/deb_folder/rules rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/debian/deb_folder/changelog (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/debian/deb_folder/control (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/debian/deb_folder/copyright (100%) create mode 100644 python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install create mode 100644 python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install create mode 100644 python3-k8sapp-sriov-fec-operator/debian/deb_folder/rules rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/debian/deb_folder/source/format (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/debian/meta_data.yaml (50%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/.gitignore (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/.stestr.conf (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/LICENSE (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/README.rst (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/__init__.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/__init__.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/constants.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/__init__.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/sriov_fec_operator.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/__init__.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/lifecycle_sriov_fec_operator.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/__init__.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_plugins.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_sriov_fec_operator.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/pylint.rc (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/requirements.txt (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/setup.cfg (98%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/setup.py (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/test-requirements.txt (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/tox.ini (100%) rename {python-k8sapp-sriov-fec-operator => python3-k8sapp-sriov-fec-operator}/k8sapp_sriov_fec_operator/upper-constraints.txt (100%) delete mode 100644 sriov-fec-operator-images/centos/build-sriov-fec-operator-image.sh delete mode 100644 sriov-fec-operator-images/centos/sriov-fec-daemon.stable_docker_image delete mode 100644 sriov-fec-operator-images/centos/sriov-fec-labeler.stable_docker_image delete mode 100644 sriov-fec-operator-images/centos/sriov-fec-operator.stable_docker_image delete mode 100644 stx-sriov-fec-operator-helm/centos/build_srpm.data delete mode 100644 stx-sriov-fec-operator-helm/centos/stx-sriov-fec-operator-helm.spec diff --git a/.zuul.yaml b/.zuul.yaml index e7adce5..dbef0de 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -23,11 +23,11 @@ - starlingx/update - starlingx/utilities files: - - python-k8sapp-sriov-fec-operator/* + - python3-k8sapp-sriov-fec-operator/* vars: tox_envlist: py39 python_version: 3.9 - tox_extra_args: -c python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini + tox_extra_args: -c python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini - job: name: k8sapp-sriov-fec-operator-tox-pylint @@ -41,7 +41,7 @@ - starlingx/utilities nodeset: ubuntu-bionic files: - - python-k8sapp-sriov-fec-operator/* + - python3-k8sapp-sriov-fec-operator/* vars: tox_envlist: pylint - tox_extra_args: -c python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini + tox_extra_args: -c python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini diff --git a/centos_build_layer.cfg b/centos_build_layer.cfg deleted file mode 100644 index c581999..0000000 --- a/centos_build_layer.cfg +++ /dev/null @@ -1 +0,0 @@ -flock diff --git a/centos_iso_image.inc b/centos_iso_image.inc deleted file mode 100644 index 2c8faec..0000000 --- a/centos_iso_image.inc +++ /dev/null @@ -1 +0,0 @@ -stx-sriov-fec-operator-helm diff --git a/centos_pkg_dirs b/centos_pkg_dirs deleted file mode 100644 index 4c210bd..0000000 --- a/centos_pkg_dirs +++ /dev/null @@ -1,2 +0,0 @@ -stx-sriov-fec-operator-helm -python-k8sapp-sriov-fec-operator diff --git a/centos_pkg_dirs_containers b/centos_pkg_dirs_containers deleted file mode 100644 index 4c210bd..0000000 --- a/centos_pkg_dirs_containers +++ /dev/null @@ -1,2 +0,0 @@ -stx-sriov-fec-operator-helm -python-k8sapp-sriov-fec-operator diff --git a/centos_stable_docker_images.inc b/centos_stable_docker_images.inc deleted file mode 100644 index 9aec99a..0000000 --- a/centos_stable_docker_images.inc +++ /dev/null @@ -1 +0,0 @@ -sriov-fec-operator-images diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 77c1d5f..988a3a1 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,2 +1,2 @@ -python-k8sapp-sriov-fec-operator +python3-k8sapp-sriov-fec-operator stx-sriov-fec-operator-helm diff --git a/python-k8sapp-sriov-fec-operator/centos/build_srpm.data b/python-k8sapp-sriov-fec-operator/centos/build_srpm.data deleted file mode 100644 index e64a476..0000000 --- a/python-k8sapp-sriov-fec-operator/centos/build_srpm.data +++ /dev/null @@ -1,3 +0,0 @@ -SRC_DIR="k8sapp_sriov_fec_operator" - -TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/python-k8sapp-sriov-fec-operator/centos/python-k8sapp-sriov-fec-operator.spec b/python-k8sapp-sriov-fec-operator/centos/python-k8sapp-sriov-fec-operator.spec deleted file mode 100644 index ca5360a..0000000 --- a/python-k8sapp-sriov-fec-operator/centos/python-k8sapp-sriov-fec-operator.spec +++ /dev/null @@ -1,52 +0,0 @@ -%global app_name sriov-fec-operator -%global pypi_name k8sapp-sriov-fec-operator -%global sname k8sapp_sriov_fec_operator - -Name: python-%{pypi_name} -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -Summary: StarlingX sysinv extensions: Sriov fec operator - -License: Apache-2.0 -Source0: %{name}-%{version}.tar.gz - -BuildArch: noarch - -BuildRequires: python-setuptools -BuildRequires: python-pbr -BuildRequires: python2-pip -BuildRequires: python2-wheel - -%description -StarlingX sysinv extensions: Sriov fec operator K8S app - -%prep -%setup -# Remove bundled egg-info -rm -rf %{pypi_name}.egg-info - -%build -export PBR_VERSION=%{version} -%{__python2} setup.py build - -%py2_build_wheel - -%install -export PBR_VERSION=%{version}.%{tis_patch_ver} -export SKIP_PIP_INSTALL=1 -%{__python2} setup.py install --skip-build --root %{buildroot} -mkdir -p ${RPM_BUILD_ROOT}/plugins/%{app_name} -install -m 644 dist/*.whl ${RPM_BUILD_ROOT}/plugins/%{app_name}/ - -%files -%{python2_sitelib}/%{sname} -%{python2_sitelib}/%{sname}-*.egg-info - -%package wheels -Summary: %{name} wheels - -%description wheels -Contains python wheels for %{name} - -%files wheels -/plugins/* diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install b/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install deleted file mode 100644 index 91ba0c3..0000000 --- a/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install +++ /dev/null @@ -1 +0,0 @@ -plugins/sriov-fec-operator/*.whl diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install b/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install deleted file mode 100644 index a20354f..0000000 --- a/python-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/python3/dist-packages/k8sapp_sriov_fec_operator-1.0.0.egg-info/* -usr/lib/python3/dist-packages/k8sapp_sriov_fec_operator/* diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/rules b/python-k8sapp-sriov-fec-operator/debian/deb_folder/rules deleted file mode 100644 index 18e361e..0000000 --- a/python-k8sapp-sriov-fec-operator/debian/deb_folder/rules +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/make -f -# export DH_VERBOSE = 1 - -export APP_NAME=sriov-fec-operator -export PBR_VERSION=1.0.0 -export PYBUILD_NAME=k8sapp-sriov-fec-operator -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-sriov-fec-operator/debian/deb_folder/changelog b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/changelog similarity index 100% rename from python-k8sapp-sriov-fec-operator/debian/deb_folder/changelog rename to python3-k8sapp-sriov-fec-operator/debian/deb_folder/changelog diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/control b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/control similarity index 100% rename from python-k8sapp-sriov-fec-operator/debian/deb_folder/control rename to python3-k8sapp-sriov-fec-operator/debian/deb_folder/control diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/copyright b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/copyright similarity index 100% rename from python-k8sapp-sriov-fec-operator/debian/deb_folder/copyright rename to python3-k8sapp-sriov-fec-operator/debian/deb_folder/copyright diff --git a/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install new file mode 100644 index 0000000..19a9e4c --- /dev/null +++ b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator-wheels.install @@ -0,0 +1 @@ +plugins/*.whl diff --git a/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install new file mode 100644 index 0000000..91d1d9d --- /dev/null +++ b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/python3-k8sapp-sriov-fec-operator.install @@ -0,0 +1 @@ +usr/lib/python3/dist-packages/k8sapp_* diff --git a/python3-k8sapp-sriov-fec-operator/debian/deb_folder/rules b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/rules new file mode 100644 index 0000000..52b9ea3 --- /dev/null +++ b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/rules @@ -0,0 +1,33 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export APP_NAME = sriov-fec-operator +export PYBUILD_NAME = k8sapp-sriov-fec-operator + +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 diff --git a/python-k8sapp-sriov-fec-operator/debian/deb_folder/source/format b/python3-k8sapp-sriov-fec-operator/debian/deb_folder/source/format similarity index 100% rename from python-k8sapp-sriov-fec-operator/debian/deb_folder/source/format rename to python3-k8sapp-sriov-fec-operator/debian/deb_folder/source/format diff --git a/python-k8sapp-sriov-fec-operator/debian/meta_data.yaml b/python3-k8sapp-sriov-fec-operator/debian/meta_data.yaml similarity index 50% rename from python-k8sapp-sriov-fec-operator/debian/meta_data.yaml rename to python3-k8sapp-sriov-fec-operator/debian/meta_data.yaml index 1193b93..39c85e0 100644 --- a/python-k8sapp-sriov-fec-operator/debian/meta_data.yaml +++ b/python3-k8sapp-sriov-fec-operator/debian/meta_data.yaml @@ -4,4 +4,6 @@ debver: 1.0-1 src_path: k8sapp_sriov_fec_operator revision: dist: $STX_DIST - PKG_GITREVCOUNT: true + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/app-sriov-fec-operator + BASE_SRCREV: 46a85804ca045e00ce0778d94f9bb4d3faa3f6cd diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.gitignore b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.gitignore similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.gitignore rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.gitignore diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.stestr.conf b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.stestr.conf similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.stestr.conf rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/.stestr.conf diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/LICENSE b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/LICENSE similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/LICENSE rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/LICENSE diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/README.rst b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/README.rst similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/README.rst rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/README.rst diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/__init__.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/__init__.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/__init__.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/__init__.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/__init__.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/__init__.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/__init__.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/__init__.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/constants.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/constants.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/constants.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/common/constants.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/__init__.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/__init__.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/__init__.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/__init__.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/sriov_fec_operator.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/sriov_fec_operator.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/sriov_fec_operator.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/helm/sriov_fec_operator.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/__init__.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/__init__.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/__init__.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/__init__.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/lifecycle_sriov_fec_operator.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/lifecycle_sriov_fec_operator.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/lifecycle_sriov_fec_operator.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/lifecycle/lifecycle_sriov_fec_operator.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/__init__.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/__init__.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/__init__.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/__init__.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_plugins.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_plugins.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_plugins.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_plugins.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_sriov_fec_operator.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_sriov_fec_operator.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_sriov_fec_operator.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/k8sapp_sriov_fec_operator/tests/test_sriov_fec_operator.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/pylint.rc b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/pylint.rc similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/pylint.rc rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/pylint.rc diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/requirements.txt b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/requirements.txt similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/requirements.txt rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/requirements.txt diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg similarity index 98% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg index 1226b24..f7f7fdc 100644 --- a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg +++ b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.cfg @@ -38,5 +38,5 @@ systemconfig.helm_plugins.sriov_fec_operator = systemconfig.app_lifecycle = sriov-fec-operator = k8sapp_sriov_fec_operator.lifecycle.lifecycle_sriov_fec_operator:SriovFecOperatorAppLifecycleOperator -[wheel] +[bdist_wheel] universal = 1 diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.py b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.py similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.py rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/setup.py diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/test-requirements.txt b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/test-requirements.txt similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/test-requirements.txt rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/test-requirements.txt diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/tox.ini diff --git a/python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/upper-constraints.txt b/python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/upper-constraints.txt similarity index 100% rename from python-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/upper-constraints.txt rename to python3-k8sapp-sriov-fec-operator/k8sapp_sriov_fec_operator/upper-constraints.txt diff --git a/sriov-fec-operator-images/centos/build-sriov-fec-operator-image.sh b/sriov-fec-operator-images/centos/build-sriov-fec-operator-image.sh deleted file mode 100644 index 199b3c6..0000000 --- a/sriov-fec-operator-images/centos/build-sriov-fec-operator-image.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2022 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -IMAGE=$1 -IMAGE_TAG=$2 -export CONTAINER_TOOL=docker -export BASE_IMAGE="centos:7.9.2009" - -echo "=============== build script ================" -echo image: "${IMAGE}" -echo image_tag: "${IMAGE_TAG}" -pwd - -if [ -z "${IMAGE_TAG}" ]; then - echo "Image tag must be specified. build ${IMAGE} Aborting..." >&2 - exit 1 -fi - -build_labeler_image() { - export SRIOV_FEC_LABELER_IMAGE=$1 - - sed -i "/FROM.*registry.*/c\FROM ${BASE_IMAGE}" \ - Dockerfile.labeler - echo "labeler_image: ${SRIOV_FEC_LABELER_IMAGE}" - - pwd - make image-sriov-fec-labeler - - echo "Labeler image build done" - - return 0 -} - -build_daemon_image() { - export SRIOV_FEC_DAEMON_IMAGE=$1 - - sed -i "/FROM.*registry.*/c\FROM ${BASE_IMAGE}" \ - Dockerfile.daemon - - echo "daemon_image: ${SRIOV_FEC_DAEMON_IMAGE}" - - pwd - make image-sriov-fec-daemon - - echo "Daemon image build done" - - return 0 -} - -build_operator_image() { - - export SRIOV_FEC_OPERATOR_IMAGE=$1 - - sed -i "/FROM.*registry.*/c\FROM ${BASE_IMAGE}" \ - Dockerfile - - echo "operator_image: ${SRIOV_FEC_OPERATOR_IMAGE}" - - pwd - make image-sriov-fec-operator - - echo "Operator image build done" - - return 0 -} - -case ${IMAGE} in - labeler) - echo "Build image: labeler" - build_labeler_image "${IMAGE_TAG}" - ;; - daemon) - echo "build image: daemon" - build_daemon_image "${IMAGE_TAG}" - ;; - operator) - echo "build image: Operator" - build_operator_image "${IMAGE_TAG}" - ;; - *) - echo "Unsupported ARGS in ${image_build_file}: ${IMAGE}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/sriov-fec-operator-images/centos/sriov-fec-daemon.stable_docker_image b/sriov-fec-operator-images/centos/sriov-fec-daemon.stable_docker_image deleted file mode 100644 index 7d52047..0000000 --- a/sriov-fec-operator-images/centos/sriov-fec-daemon.stable_docker_image +++ /dev/null @@ -1,9 +0,0 @@ -BUILDER=script -LABEL=sriov-fec-daemon -SOURCE_REPO=https://github.com/smart-edge-open/sriov-fec-operator.git -SOURCE_REF=7eec69b3b7151b1eaccaacd480004654af81784b -SOURCE_PATCHES="../files/0001-patch-for-docker-images.patch" -COMMAND=bash -SCRIPT=build-sriov-fec-operator-image.sh -ARGS=daemon - diff --git a/sriov-fec-operator-images/centos/sriov-fec-labeler.stable_docker_image b/sriov-fec-operator-images/centos/sriov-fec-labeler.stable_docker_image deleted file mode 100644 index 9c2f9ba..0000000 --- a/sriov-fec-operator-images/centos/sriov-fec-labeler.stable_docker_image +++ /dev/null @@ -1,9 +0,0 @@ -BUILDER=script -LABEL=sriov-fec-labeler -SOURCE_REPO=https://github.com/smart-edge-open/sriov-fec-operator.git -SOURCE_REF=7eec69b3b7151b1eaccaacd480004654af81784b -SOURCE_PATCHES="../files/0001-patch-for-docker-images.patch" -COMMAND=bash -SCRIPT=build-sriov-fec-operator-image.sh -ARGS=labeler - diff --git a/sriov-fec-operator-images/centos/sriov-fec-operator.stable_docker_image b/sriov-fec-operator-images/centos/sriov-fec-operator.stable_docker_image deleted file mode 100644 index fea67d6..0000000 --- a/sriov-fec-operator-images/centos/sriov-fec-operator.stable_docker_image +++ /dev/null @@ -1,9 +0,0 @@ -BUILDER=script -LABEL=sriov-fec-operator -SOURCE_REPO=https://github.com/smart-edge-open/sriov-fec-operator.git -SOURCE_REF=7eec69b3b7151b1eaccaacd480004654af81784b -SOURCE_PATCHES="../files/0001-patch-for-docker-images.patch" -COMMAND=bash -SCRIPT=build-sriov-fec-operator-image.sh -ARGS=operator - diff --git a/stx-sriov-fec-operator-helm/centos/build_srpm.data b/stx-sriov-fec-operator-helm/centos/build_srpm.data deleted file mode 100644 index bbd8142..0000000 --- a/stx-sriov-fec-operator-helm/centos/build_srpm.data +++ /dev/null @@ -1,9 +0,0 @@ -SRC_DIR="stx-sriov-fec-operator-helm" - -TIS_PATCH_VER=PKG_GITREVCOUNT - -#FluxCD version -SRIOV_FEC_OPERATOR_VERSION=0.1.0 - -COPY_LIST="${PKG_BASE}/${SRC_DIR}/helm-charts/* ${PKG_BASE}/${SRC_DIR}/files/* -${PKG_BASE}/${SRC_DIR}/fluxcd-manifests/*" diff --git a/stx-sriov-fec-operator-helm/centos/stx-sriov-fec-operator-helm.spec b/stx-sriov-fec-operator-helm/centos/stx-sriov-fec-operator-helm.spec deleted file mode 100644 index febcf67..0000000 --- a/stx-sriov-fec-operator-helm/centos/stx-sriov-fec-operator-helm.spec +++ /dev/null @@ -1,94 +0,0 @@ -# Application tunables (maps to metadata) -%global app_name sriov-fec-operator -%global helm_repo stx-platform - -# Install location -%global app_folder /usr/local/share/applications/helm - -# Build variables -%global helm_folder /usr/lib/helm - -Summary: StarlingX Sriov Fec Operator Helm Charts -Name: stx-sriov-fec-operator-helm -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -License: Apache-2.0 -Group: base -Packager: Intel -URL: unknown - -Source0: %{name}-%{version}.tar.gz - -BuildArch: noarch - -BuildRequires: helm -BuildRequires: python-k8sapp-sriov-fec-operator -BuildRequires: python-k8sapp-sriov-fec-operator-wheels - -%description -StarlingX Sriov Fec Operator Helm Charts - -%package fluxcd -Summary: StarlingX Sriov Fec Operator Application FluxCD Helm Charts -Group: base -License: Apache-2.0 - -%description fluxcd -StarlingX Sriov Fec Operator Application FluxCD Helm Charts - -%prep -%setup -n %{name}-%{version} - -%build -# This chart does not require chartmuseum server since -# it has no dependency on local or stable repos. -# Make the charts. These produce a tgz file -cd helm-charts -make sriov-fec-operator - -# switch back to source root -cd - - - -# Create a chart tarball compliant with sysinv kube-app.py -%define app_staging %{_builddir}/staging -%define app_tarball_fluxcd %{app_name}-%{version}-%{tis_patch_ver}.tgz -%define app_path %{_builddir}/%{app_tarball_fluxcd} - -# Setup staging -cd %{_builddir}/%{name}-%{version} -mkdir -p %{app_staging} -cp files/metadata.yaml %{app_staging} -cp -R fluxcd-manifests %{app_staging}/ -mkdir -p %{app_staging}/charts -cp helm-charts/*.tgz %{app_staging}/charts - -# Copy the plugins: installed in the buildroot -mkdir -p %{app_staging}/plugins -cp /plugins/%{app_name}/*.whl %{app_staging}/plugins - -cd %{app_staging} - -# Populate metadata -sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml -sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml -sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml - -# calculate checksum of all files in app_staging -find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 -# package the app -tar -zcf %{app_path} -C %{app_staging}/ . - -# switch back to source root -cd - - -# Cleanup staging -rm -fr %{app_staging} - -%install -install -d -m 755 %{buildroot}/%{app_folder} -install -p -D -m 755 %{app_path} %{buildroot}/%{app_folder} - -%files -%defattr(-,root,root,-) -%{app_folder}/%{app_tarball_fluxcd} diff --git a/stx-sriov-fec-operator-helm/debian/deb_folder/rules b/stx-sriov-fec-operator-helm/debian/deb_folder/rules index 3fdbe8d..1ac108e 100644 --- a/stx-sriov-fec-operator-helm/debian/deb_folder/rules +++ b/stx-sriov-fec-operator-helm/debian/deb_folder/rules @@ -34,7 +34,7 @@ override_dh_auto_build: 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 + cp /plugins/*.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)/ . diff --git a/stx-sriov-fec-operator-helm/debian/meta_data.yaml b/stx-sriov-fec-operator-helm/debian/meta_data.yaml index 608e47c..3c0fc85 100644 --- a/stx-sriov-fec-operator-helm/debian/meta_data.yaml +++ b/stx-sriov-fec-operator-helm/debian/meta_data.yaml @@ -4,4 +4,6 @@ debver: 1.0-1 src_path: stx-sriov-fec-operator-helm revision: dist: $STX_DIST - PKG_GITREVCOUNT: true + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/app-sriov-fec-operator + BASE_SRCREV: 46a85804ca045e00ce0778d94f9bb4d3faa3f6cd