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-<app>
- Standardized plugin debian files (rules, *.install)
- Plugin wheels saved to /plugin instead of /plugin/<app>

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: 47193

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: I601800969134661ff40d6fb6277ffad3ce403eb7
This commit is contained in:
Leonardo Fagundes Luz Serrano 2022-12-21 06:45:05 -03:00
parent 4c765c3550
commit f5cf584d8d
38 changed files with 29 additions and 28 deletions

View File

@ -33,9 +33,9 @@
- starlingx/utilities - starlingx/utilities
- starlingx/root - starlingx/root
files: files:
- python-k8sapp-platform/* - python3-k8sapp-platform/*
vars: vars:
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python3-k8sapp-platform/k8sapp_platform/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job: - job:
@ -45,10 +45,10 @@
Run flake8 test for k8sapp_platform Run flake8 test for k8sapp_platform
nodeset: debian-bullseye nodeset: debian-bullseye
files: files:
- python-k8sapp-platform/* - python3-k8sapp-platform/*
vars: vars:
tox_envlist: flake8 tox_envlist: flake8
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python3-k8sapp-platform/k8sapp_platform/tox.ini
- job: - job:
name: k8sapp-platform-tox-pylint name: k8sapp-platform-tox-pylint
@ -63,10 +63,10 @@
- starlingx/utilities - starlingx/utilities
- starlingx/root - starlingx/root
files: files:
- python-k8sapp-platform/* - python3-k8sapp-platform/*
vars: vars:
tox_envlist: pylint tox_envlist: pylint
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python3-k8sapp-platform/k8sapp_platform/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job: - job:
@ -76,10 +76,10 @@
Run bandit test for k8sapp_platform Run bandit test for k8sapp_platform
nodeset: debian-bullseye nodeset: debian-bullseye
files: files:
- python-k8sapp-platform/* - python3-k8sapp-platform/*
vars: vars:
tox_envlist: bandit tox_envlist: bandit
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python3-k8sapp-platform/k8sapp_platform/tox.ini
- job: - job:
name: stx-platform-armada-app-upload-git-mirror name: stx-platform-armada-app-upload-git-mirror

View File

@ -1,3 +1,3 @@
python-k8sapp-platform
stx-platform-helm
platform-helm platform-helm
python3-k8sapp-platform
stx-platform-helm

View File

@ -1 +0,0 @@
plugins/platform-integ-apps/*.whl

View File

@ -1,2 +0,0 @@
usr/lib/python3/dist-packages/k8sapp_platform-*.egg-info/*
usr/lib/python3/dist-packages/k8sapp_platform/*

View File

@ -0,0 +1 @@
plugins/*.whl

View File

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

View File

@ -2,30 +2,32 @@
# export DH_VERBOSE = 1 # export DH_VERBOSE = 1
export APP_NAME = platform-integ-apps export APP_NAME = platform-integ-apps
export PYBUILD_NAME = k8sapp-platform
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-') export MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-')
export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export PBR_VERSION = $(MAJOR).$(MINOR_PATCH) export PBR_VERSION = $(MAJOR).$(MINOR_PATCH)
export PYBUILD_NAME=k8sapp-platform export ROOT = $(CURDIR)/debian/tmp
export SKIP_PIP_INSTALL = 1 export SKIP_PIP_INSTALL = 1
export ROOT=debian/tmp
%: %:
dh $@ --with=python3 --buildsystem=pybuild dh $@ --with=python3 --buildsystem=pybuild
override_dh_auto_install: override_dh_auto_install:
python3 setup.py install --install-layout=deb --root $(ROOT) env | sort
python3 setup.py install \
--install-layout=deb \
--root $(ROOT)
python3 setup.py bdist_wheel \ python3 setup.py bdist_wheel \
--universal \ --universal \
-d $(ROOT)/plugins/$(APP_NAME) -d $(ROOT)/plugins
override_dh_python3: override_dh_python3:
dh_python3 --shebang=/usr/bin/python3 dh_python3 --shebang=/usr/bin/python3
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test: override_dh_auto_test:
# (tbogue) FIXME PYTHONDIR=$(CURDIR) stestr run
PYTHONDIR=$(CURDIR) stestr run || true
endif

View File

@ -5,5 +5,5 @@ src_path: k8sapp_platform
revision: revision:
dist: $STX_DIST dist: $STX_DIST
GITREVCOUNT: GITREVCOUNT:
BASE_SRCREV: c608f2aaa92064b712e7076e4141a162b78fe995
SRC_DIR: ${MY_REPO}/stx/platform-armada-app SRC_DIR: ${MY_REPO}/stx/platform-armada-app
BASE_SRCREV: 301e310b67f608c309a34c7431848f680e2ea827

View File

@ -41,5 +41,5 @@ systemconfig.fluxcd.kustomize_ops =
systemconfig.app_lifecycle = systemconfig.app_lifecycle =
platform-integ-apps = k8sapp_platform.lifecycle.lifecycle_platform:PlatformAppLifecycleOperator platform-integ-apps = k8sapp_platform.lifecycle.lifecycle_platform:PlatformAppLifecycleOperator
[wheel] [bdist_wheel]
universal = 1 universal = 1

View File

@ -39,7 +39,7 @@ override_dh_auto_build:
# Copy the plugins: installed in the buildroot # Copy the plugins: installed in the buildroot
mkdir -p $(STAGING_FLUXCD)/plugins mkdir -p $(STAGING_FLUXCD)/plugins
cp /plugins/$(APP_NAME)/*.whl $(STAGING_FLUXCD)/plugins cp /plugins/*.whl $(STAGING_FLUXCD)/plugins
# Create the app package. # Create the app package.
cd $(STAGING_FLUXCD) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 cd $(STAGING_FLUXCD) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5

View File

@ -7,5 +7,5 @@ src_files:
revision: revision:
dist: $STX_DIST dist: $STX_DIST
GITREVCOUNT: GITREVCOUNT:
BASE_SRCREV: c608f2aaa92064b712e7076e4141a162b78fe995
SRC_DIR: ${MY_REPO}/stx/platform-armada-app SRC_DIR: ${MY_REPO}/stx/platform-armada-app
BASE_SRCREV: 301e310b67f608c309a34c7431848f680e2ea827