This commit enables "software install-local" in a Debian
env for a patch.
Test Plan:
[PASS] Verify software install-local installs the patch
[PASS] Verify state machine for install-local workflow
Story: 2010676
Task: 48607
Change-Id: I6fd44653210cecdc0e3e1131bfd4619a756556c8
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
update client to get the correct endpoint when region name is provided.
Story: 2010676
Task: 48618
Test Case:
PASS: run software list command with region name SystemController
Change-Id: If8c7b5779868d2007819b98ef93ca8457b009aee
Signed-off-by: Christopher Souza <Christopher.DeOliveiraSouza@windriver.com>
Sometimes the current script can trigger an issue while
restarting horizon so this commit updates the test patches
script to use a simpler script.
Test Plan:
PASS: build test patch and check the restart script inside
the patch file was updated.
PASS: Applied test patch on latest build
Closes-bug: 2031330
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: Ia907d8b95526c35ba5992d7106178bf480c97986
This commit enables bash completion for Unified Software Management
commands using argcomplete module.
Test Plan:
[PASS] Build and install the iso
[PASS] Test bash completion for software commands
Story: 2010676
Task: 48540
Depends-On: https://review.opendev.org/c/888955
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: Id1d404ff48029c61040f2f137b0169d5ac6919d6
This commit changes the previous platform upgrade health
check, executed with "system health-query-upgrade" to a
standalone executable to be called by the upcoming changes
on the upgrade framework.
More specifically, this commit remove direct sysinv code
importing from health check, converting the required calls
into CLI commands, and also removes deprecated code needed
only for CentOS to Debian upgrades and health checks that
won't matter anymore with the new upgrade approach.
There will be follow-up commits to address the TODO items
on the code, since they depend on work in progress related
to the new unified software management API and database.
Test Plan:
PASS: run the standalone upgrade precheck successfully
Regression:
PASS: run "system health-query" successfully
PASS: run "system health-query-kube-upgrade" successfully
PASS: run "system health-query-upgrade" successfully
Story: 2010651
Task: 48058
Change-Id: Ifb76f7de09b2bffa559c90409f954aa43f172f32
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
The pecan xml template files are used by the API
to format the results of certain operations in certain
response modes.
Those xml files are now included in the setuptools
packaging and are included in the debian files.
This change also moves all the package configuration into
the setup.cfg file.
PBR conflicts with the package_data definitions in the
setup files so pbr is no longer used for versioning.
Test Plan:
PASS Bootstrap AIO-SX and verify files are included
Story: 2010676
Task: 48400
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ibcea8d6f4da8b089b4b59c9c2ca96a988be0795f
This change renames the CLI commands as give below:
1) "software release list" is now "software list"
2) "software release upload" is now "software upload"
3) "software release delete" is now "software delete"
In addition, this change updates the upload and delete
functionalities to use the major version instead of what is
provided in patch metadata while creating directories.
Test Plan:
[PASS] Verify CLI commands have been renamed
Story: 2010676
Task: 48382
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I969ca9d4409a8f51e75a44ab6a1dc5284b396908
Adds validation to whether the .deb files exist.
Validates if the restart script is executable.
This adds in yaml support as the input.
This adds multiple patch support (through the yaml).
Adds support for a sem-ver sw-version (major.minor.micro)
Validates if a sequence of patches use the same
restart script (prohibited).
Test Plan:
Make a sneaky patch using command line args
Make a sneaky patch sequence of 2 patches using yaml
and verify they can both be applied and installed.
Story: 2010547
Task: 48323
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: If8e7745b2054b21a1476b9685629559a376a3841
When the build server is not strong enough we encounter timeout on the
aptly's operation. This change add the option to increase the timeout
directly into the script.
Test Plan:
Pass: ./build_test_patches.py --software-version \
"${SW_VERSION}" --time-out 15
Pass: ./build_test_patches.py --software-version \
"${SW_VERSION}"
Pass: Build patches
Pass: Validate metadata content
Story: 2009969
Task: 48314
Change-Id: I545510f250e1c51d0a2db9386c73624e3bebeb00
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
This commit implements the state machine such that the acceptable
values are as given below:
state - available, unavailable, deploying-start, deploying-host,
deploying-activate, deploying-complete, removing, deployed,
aborted, committed
Test Plan:
1) Verify the exit states after each software operation
2) Verify the state progression in 3 scenarios:
(a) upload, deploy start, deploy host,
deploy activate, deploy complete,
deploy start, deploy host,
deploy activate, deploy complete, delete
(b) upload, deploy start <newer release>,
deploy start <older release>, delete
(c) upload, delete
Story: 2010676
Task: 48190
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I3d8cfe21af76d19586fd1b42a347167c9f808392
When an ostree deployment is created, it uses a kernel.env
from the ostree environment which does not contain local
changes such as selecting a real time kernel.
This change add a post-deployment step to update the kernel.env
using a utility method from puppet to ensure that the proper
kernel is selected, and that other values are preserved from
previous deployments.
Note: Not all patches encounter this issue.
This problem would only be seen if the patch introduced a
new directory under /boot/ostree
Test Plan:
PASS:
- Unlock a AIO-SX RT system.
- lock / host-install a reboot-required patch / unlock.
-- observe the system is running RT mode after reboot.
-- observe that the /boot/ostree was different
Closes-Bug: #2023318
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I571b05ddf92500f4823132f94a07297082bd7a5d
This commit enables "software deploy start" in a Debian env for
all minor releases.
Test Plan:
[PASS] software deploy start
Story: 2010676
Task: 48051
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: Icec0535e210c279ae79364ece9633155519e797e
This provides a sneaky patching mechanism to interact
with ostree and build an ostree commit through the
installation of debian packages in a chroot env.
Test Plan:
PASS: successfully created a reboot required patch
for a single .deb file
PASS: successfully created a reboot required patch
for multiple .deb files
PASS: successfully created a no-reboot required patch
for multiple .deb files
Story: 2010547
Task: 48029
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I31b2828869c3eaeb42c2fb546bd02ad0007265b2
This commit updates the CLI output for all software
commands and also updates variable names to eliminate
the word patch wherever possible.
Test Plan:
[PASS] software deploy query-hosts
[PASS] software release list
[PASS] software release show
[PASS] uploaded and deleted a patch
Story: 2010676
Task: 48053
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I803bcd0dcd621fa70d8e45c3feb1892aafd04ee7
The exceptions were copied from the patching system, and
now their names are updated to properly indicate their
purpose.
Test Plan:
PASS: upload/apply a software release (patch)
Story: 2010676
Task: 48039
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I80625d9955d417b99ce80d41499ee095cae07d67
When an AIO-SX is unlocked, the patching and unified
software management systems were sharing a flag file
to indicate if the system had encountered a patch failure.
The flag was being incorrectly set by the unified software
management system.
This fixes the code that was setting of the flag, and also
renames the flag in the unified software management system.
Test Plan:
PASS: Tox
PASS: build component
PASS: Boostrap/Unlock AIO-SX (no alarms)
Story: 2010676
Task: 48024
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I681a641f563e851d3f4dc4d5a63b74526dd77892
This commit enables "software deploy delete" in a Debian env for
all minor releases.
Test Plan:
[PASS] software deploy delete
Story: 2010676
Task: 47987
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I5fe248109282788290279fae34283299e20f1462
This commit enables software deploy query-hosts in a Debian env for
all minor releases.
Test Plan:
software deploy query-hosts
Story: 2010676
Task: 47982
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: If55e23a4c6a1f5bcdeeb57453a953efa771a4c7a
This commit enables software deploy create in a Debian env for
all patches.
Test Plan:
software deploy create
Story: 2010676
Task: 47961
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I7c4bfb9811be41ae416154e985d1a418f35a9a01
The unified software management 'release' commands for
- upload
- upload-dir
- delete
- list
- show
are similar to the previous sw-patch commands
This component is not currently being used however
these functions appear to be operational.
Test Plan:
PASS: tox
PASS: software release upload --release TEST.patch
PASS: software release upload-dir --release TEST.patch
PASS: software release list
PASS: software release show --release TEST
PASS: software release delete --release TEST
Story: 2010676
Task: 47959
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I723648b8a522c8ef7e1d6e23e806553294780653
This commit enables software deploy host in a Debian env for
all patches. It also includes the ostree_utils required to
checkout a sysroot ostree commit, install/uninstall packages
from a checked-out commit, and write commit to feed ostree -
all of which are not being invoked by software deploy host
as of today but are intended for future use.
Test Plan:
[PASS] software deploy host
Story: 2010676
Task: 47948
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I2178010f3af5cd8e69b28a06866e567248088cba
- cmd files are replaced by software_client
- software_config.py is renamed to config.py and includes
the previous config setup.
- unit tests from sw-patch are being migrated here
Story: 2010676
Task: 47917
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I886b4abd63a9b7057efd2b6440211a9c1f06f6f3
During an upgrade, multiple patch directories may
be detected, and the patch controller may attempt to
iterate over those folders to determine the packages.
The code that iterates over those folder can raise
RuntimeError: dictionary changed size during iteration
if the directory does not exist, but a package does.
The fix is to iterate over the copy of the list.
This issue only occurs in a duplex env, when the neighbor
sync is being done. It will be encountered when a patch
import is invoked after the older directory is removed.
Test Plan:
AIO-DX create multiple folders under /var/www/pages/feed
and trigger a patch-import
Closes-Bug: #2017916
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ic78d30019bdaa93b9493bf57c7122f6de7cc6dab
The ssh host-keys are changing during the patch build.
This change remove the ssh host-key from the new
rootfs dir before creating the patch.
Test plan:
Pass:
- Run ./make_patch.py create --patch-recipe patch_recipe_rr_sample.xml
\ --clone-repo /localdisk/deploy/ostree_test/
- Check if folder {new_rootfs}/usr/etc/ssh/ssh_host has no key file
- Check if patch is built correctly
Story: 2009969
Task: 47898
Change-Id: I902b88987209f80ebf4a48405e9ef51265d14617
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
Current Status:
- CLI commands
- API endpoints
- controller process
- agent process
- Logging
Test Plan:
PASS: Build and Install ISO
PASS: software-agent and software-controller
services are active post unlock
PASS: tox
Story: 2010676
Task: 47817
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I394780ce40fee398c4eacb3aacb575a03ff93332
- Removed the old python2 entries
- Replaced mock with unittest.mock
- Unsuppressed most flake8 and pylint checks
- Added the startup script to flake8 checking and fixed
a python3 syntax issue in the error handling.
- Regenerated an updated / modern pylint.rc
- Updated the upper-constraints to be Debian and python3
Test Plan:
Pass: Build / Install / Unlock
Pass: trigger a patch alarm
Story: 2010642
Task: 47815
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Id8c612a677253dfc53931719af7823572d1536ef
The entry added to debian_stable_wheels.inc by [1]
means that the wheel generation will fail because the
control file does not have an entry for that wheel.
The version needs to be 1.0-1 rather than 1.0.1
Adding the appropriate directives.
[1] https://review.opendev.org/c/starlingx/update/+/877874/7/debian_stable_wheels.inc
Closes-Bug: 2015404
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I5752d72531aeb521e24d9e8661f55748ef4d0624
This reverts commit 3e920a1641a4c0f4b30b2a7dd8c60b3a16488a78.
Reason for revert: It looks like after a post zuul job merges, the change is not used by its first invocation. The original code should work.
Change-Id: Ieab56ef652b69ab47f9de6055c5e71520ea67375
Updating the rsa ssh host key based on:
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/
Note: In the future, StarlingX should have a zuul job and
secret setup for all repos so we do not need to do this
for every repo.
Needed to rename the secret
Partial-Bug: #2015246
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I2b98d3500eac816e72fd5e513763d7633ddc51f3
Current Status:
- minimal debian packaging
- python skeleton
- tox
- zuul integration
- pecan API skeleton
- unit tests
Next Steps:
- CLI commands
- API endpoints
- controller
- agent
- expanded packaging
Test Plan:
PASS: Build and Install ISO
PASS: tox
PASS: 'software' is in the PATH and can be invoked.
PASS: wget http://127.0.0.1:5490 returns 204 when
software-api is running
Story: 2010676
Task: 47754
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I8e2d993ac85dcff7bb970ddf05fd63db9f2abe11
After the secure boot update the $DEPLOY_DIR
and ostree_repo ownership are not root anymore.
As the updated repo is owned by root whenever we
run rsync to create the delta-dir it will treat all files
as different files due to the ownership and that will
generate huge patches.
This adds the --no-owner to ignore the ownership
when comparing the files.
Test plan:
Pass: build-pkgs --reuse and ostree sync
Pass: make_patch.py prepare
Pass: make_patch.py create
Pass: verified patch size
Story: 2009969
Task: 47658
Change-Id: Ia7e026999c051324a4ba2efa7b83262cba1015e5
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
This package contains GObject-Introspection metadata for libostree
which is used to generate dynamic bindings into languages like
Python. This will allow the update repo to make libostree API calls.
Test Plan:
Build and install the iso
Story: 2009969
Task: 47716
Signed-off-by: Jessica Castelino <jessica.castelino@windriver.com>
Change-Id: I30c3494106c981b7300060ec4315e47ef728dcd1
This change add a function that verify if GPG homedir exist
before signing the OSTREE commit. If doesn't exist it's try
to create the homedir and import the key from yaml file
Test Plan:
PASS: Stop, Start container and create patch
PASS: ./make_patch.py create --patch-recipe patch_recipe_rr_sample.xml \
--clone-repo /localdisk/deploy/ostree_test
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
Change-Id: I97b2244e2189879c9d99d7a2a36c8e5e839a095d