7 Commits

Author SHA1 Message Date
Heitor Matsui
e1eeeca9ee Fix deploy start kubernetes mount points
With commit [1] the kubernetes location was changed from /usr/local
to /var/lib, making the deploy start inside chroot fail.

This commit fixes the issue.

[1] https://review.opendev.org/c/starlingx/stx-puppet/+/916338

Test Plan
PASS: run deploy start successfully

Story: 2010676
Task: 50059

Change-Id: I2065d0130c9916a60ee7b963c865dcb43c733a39
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-05-08 18:44:33 -03:00
Heitor Matsui
f88638a374 Include missing data migration steps on deploy start
There are additional steps needed to enable "deploy host"
operation for major release upgrades. This commit adds these
additional steps, which are:

1. Create TO release platform config directory, done during
   upgrade-start on legacy upgrade procedure
2. Create TO release rabbitmq directory, done by upgrade
   manifest after controller-1 reinstall on legacy upgrade

The commit also fixes some issues:

1. shell-utils logging functions logging nowhere after
   being sourced by other scripts
2. sync-controllers-feed script was only syncing the
   ostree_repo directory instead of the full feed content
3. major release deployment scripts ran from different
   places, now all scripts are executed from the TO release
   feed directory, or from checked out TO release ostree
   repo in case of chroot
4. change umount command from chroot_mounts to lazy umount

Note: Since the "deploy host" endpoint for major release
deployment is not yet implemented, the test plan will have
test cases that simulate the "deploy host" operation.

Test Plan
PASS: simulate "deploy host" successfully for AIO-SX
PASS: simulate "deploy host" successfully for AIO-DX

Depends-on: https://review.opendev.org/c/starlingx/config/+/913715

Story: 2010676
Task: 49703

Change-Id: Ib6ae49b3590a1e50acb305ac7482e28bcc4de403
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-03-22 15:12:14 -03:00
Heitor Matsui
af0a86e357 Improve logging for deploy start shell scripts
This commit improves logging during deploy start by:
1. Creating a common module to be sourced by shell scripts to
   load general-use functions, thus reducing code duplication
   between the scripts
2. Replacing plain "echo" commands on the scripts by logging
   functions present on the common module
3. Adding timestamps to the log messages
4. Centralizing all scripts logs into software.log, favouring
   the troubleshooting, now that log lines contain timestamps
   and the process/script that generated them

This commit also deletes the ostree_mounts.yaml file since
it would be used by apt-ostree integration, which was dropped.

Test Plan
PASS: run deploy start successfully and verify that deploy start
      log messages are logged with the expected format

Story: 2010676
Task: 49607

Change-Id: I0bdebde8147faa5b29a642e35bfaf26e9862ed0a
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-02-28 11:07:03 -03:00
Bin Qian
1b462be12a deploy state changed update
After major release data migration completes, update deploy state to
start-done for successful migration or start-failed if not.
Ths deploy state update from sub process is sent to software_controller
via udp message. Only the updates from a valid agent will be accepted.

story: 2010676
Task: 49590

TCs:
     pass: Update deploy state to start-done after data migration
completes.
     pass: Update deploy state to start-failed after data migration
fails.

Change-Id: If4bfdfea168374bd11185243cffc20aa3af9c160
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2024-02-23 13:43:09 +00:00
Heitor Matsui
83d871a5da Include cleanup mechanism for deploy start
This commit adds a cleanup script in both the success
and failure cases for deploy start. The cleanup does:
- Stop temporary database created for data migration
- Unmount bind filesystems used by data migration
- Removes temporary directories created by deploy start

This commit also improves chroot_mounts.sh script, removing
the duplicated code/filepaths, adding a function to check
if mount points are mounted, simplifying the script logic
and improving the messages returned to the user.

Test Plan
PASS: deploy start executed successfully, verify that cleanup
      was executed properly
PASS: simulate failure scenarios during deploy start, verify that
      cleanup was executed properly
PASS: manage to run deploy start successfully (reentrant) after
      the previous failure test case
PASS: use deploy-cleanup script standalone to clean up the
      deploy start environment
PASS: build iso with the commit to verify build process

Story: 2010676
Task: 49474

Change-Id: I970e32f4a521427e5d56d5fb8e4865fdd9fa4bd8
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-02-08 18:40:29 -03:00
Luis Eduardo Bonatti
65ad281d7d Call script to sync to-release feed to controller-1
This commit do the call of the sync-controllers-feed on
software-deploy-start script.

Test Plan:
Feed synchronized between controllers after deploy start finishes.

Depends-on: https://review.opendev.org/c/starlingx/update/+/901321

Story: 2010676
Task: 49388

Change-Id: I47a802403ff18fbf505143d55d3a25dee0b69e27
Signed-off-by: Luis Eduardo Bonatti <LuizEduardo.Bonatti@windriver.com>
2024-01-08 21:58:43 +00:00
Bin Qian
a8c5688264 Add software deploy start script
Add software_deploy_start to perform software deploy start on
background. This script is to perform below:

0. (until apt-ostree is ready) create ostree repo and root directory
   with deployment
1. collect data from running system for migration,
2. create bind mounts to deployment directory
3. copy necessary data to deployment directory
4. in chroot, start 2nd instance of PostgreSQL database service
5. perform data migration

Story: 2010676
Task: 48959

TCs:
    passed: full cycle of software deploy start for a major/minor
release deploy.

Change-Id: I3e5ff27d2c08597686b1c5892c52d5ad7d1142b2
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2023-12-27 16:06:07 -03:00