Skip to content

Release/4.2.8.4 #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inbm-lib/inbm_lib/detect_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LinuxDistType(Enum):
Deby = 3
Debian = 4
CentOS = 5
Mariner = 6 # TODO: Remove this when confirmed that TiberOS is in use
Mariner = 6 # TODO: Remove this when confirmed that Tiber is in use
tiber = 7


Expand Down
24 changes: 10 additions & 14 deletions inbm/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## X.X.X - YYYY-MM-DD
### Changed
- (NEXMANAGE-956) Improve failure reason from TC that is logged in Mjunct DB for FOTA
- (NEXMANAGE-1194) provision-tc/mqtt services will now handle UDM
- (NEXMANAGE-1253) Implement INBS (UDM) decommission command, which removes device credentials

## 4.2.8.4 - 2025-02-14
### Security
- (NEXMANAGE-1236) Upgrade golang.org/x/net from 0.23.0 to 0.33.0, fixing CVE-2024-45338

### Added
- (NEXMANAGE-1222) Add support for Ubuntu 24.04
- (NEXMANAGE-610, NEXMANAGE-692) Add support to handle OOB AMT RPC activation command
- (NEXMANAGE-1222) Add support for Ubuntu 24.04

### Changed
- Renamed/corrected some Tiber references

## 4.2.8.2 - 2024-12-18
### Changed
- (NEXMANAGE-1121) Remove mqtt-ca group from /var/cache/manageability/repository-tool directory
- Update CI setup script to install rchardet v1.8.0

## 4.2.8.1 - 2024-12-17
- (NEX-15262) Returns failure reason that matches the format required by MM
Expand All @@ -44,7 +40,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## 4.2.7 - 2024-11-8
### Changed
- (NEXMANAGE-949) Check the IMAGE_BUILD_DATE instead of VERSION for TiberOS SOTA verification
- (NEXMANAGE-949) Check the IMAGE_BUILD_DATE instead of VERSION for Tiber SOTA verification

### Added
- (NEXMANAGE-950) Add Set Power State Capability to cloudadapter from UDM
Expand All @@ -71,7 +67,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- (NEXMANAGE-737) Enable sota cancel mode

### Fixed
- (NEXMANAGE-872) Fix provision-tc issue in TiberOS - cannot overwrite /etc/dispatcher.environment
- (NEXMANAGE-872) Fix provision-tc issue in Tiber - cannot overwrite /etc/dispatcher.environment
- (NEXMANAGE-846) Fix granular log raise error when granular log file is empty

### Changed
Expand All @@ -81,12 +77,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## 4.2.6 - 2024-10-04
### Added
- (NEXMANAGE-515) Update dispatcher SOTA related classes for supporting TiberOS
- (NEXMANAGE-598) Expanding INBC for handling TiberOS update cmd
- (NEXMANAGE-515) Update dispatcher SOTA related classes for supporting Tiber
- (NEXMANAGE-598) Expanding INBC for handling Tiber update cmd
- Updated proto files to add new RPC calls to allow edge node to update
its status with INBS.
- (NEXMANAGE-610) Add functionality to INBM Cloudadapter-agent to support OOB AMT RPC command requests from INBS
- Update TiberOS name to "tiber"
- Update Tiber name to "tiber"
- (NEXMANAGE-613) Store Scheduled updates in DB, Add nodeUpdate communication stream, and plumbing to return correct jobID on scheduled request.

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def is_dispatcher_state_file_exists() -> bool:
'bios_version': str,
'release_date': datetime,
'mender-version': str,
'tiberos-version': str
'tiber-version': str
}, total=False)


Expand Down
6 changes: 3 additions & 3 deletions inbm/dispatcher-agent/dispatcher/sota/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ def check_release_date(self, release_date: Optional[str]) -> bool:
return self.is_valid_release_date(release_date)


class TiberOSDownloader(Downloader):
"""TiberOSDownloader class, child of Downloader"""
class TiberDownloader(Downloader):
"""TiberDownloader class, child of Downloader"""

def __init__(self) -> None:
super().__init__()
Expand All @@ -203,7 +203,7 @@ def download(self,
"""

if uri is None:
raise SotaError("URI is None while performing TiberOS download")
raise SotaError("URI is None while performing Tiber download")

password = read_release_server_token()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def __init__(self) -> None:
def save_granular_log(self, update_logger: UpdateLogger, check_package: bool = True) -> None:
"""Save the granular log.
In Ubuntu, it saves the package level information.
In TiberOS, it saves the detail of the SOTA update.
In Tiber, it saves the detail of the SOTA update.

@param check_package: True if you want to check the package's status and version and record them in Ubuntu.
"""
log = {}
current_os = detect_os()
# TODO: Remove Mariner when confirmed that TiberOS is in use
# TODO: Remove Mariner when confirmed that Tiber is in use
with self._granular_lock:
if current_os == LinuxDistType.tiber.name or current_os == LinuxDistType.Mariner.name:
# Delete the previous log if exist.
Expand All @@ -49,14 +49,14 @@ def save_granular_log(self, update_logger: UpdateLogger, check_package: bool = T
"StatusDetail.Status": update_logger.detail_status,
"Version": get_image_build_date()
}
# In TiberOS, no package level information needed.
# In Tiber, no package level information needed.
update_logger.save_granular_log_file(log=log, check_package=False)
else:
update_logger.save_granular_log_file(check_package=check_package)

def map_failure_reason(self, error_log: str) -> str:
""" This method parses the error log to map the enum of failure reasons as required by MM.
It is only used for TiberOS.
It is only used for Tiber.

@param error_log: Error message to be checked
@return: Corresponding mapping of the failure reason
Expand Down
22 changes: 11 additions & 11 deletions inbm/dispatcher-agent/dispatcher/sota/os_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .constants import BTRFS
from .downloader import *
from .os_updater import DebianBasedUpdater, WindowsUpdater, YoctoX86_64Updater, OsUpdater, YoctoARMUpdater, \
TiberOSUpdater
TiberUpdater
from .rebooter import *
from .setup_helper import *
from .setup_helper import SetupHelper
Expand Down Expand Up @@ -77,13 +77,13 @@ def get_os(self, os_type) -> "ISotaOs":
elif os_type == OsType.Windows.name:
logger.debug("Windows returned")
return Windows(self._dispatcher_broker)
#TODO: Remove this when confirmed that TiberOS is in use
#TODO: Remove this when confirmed that Tiber is in use
elif os_type == LinuxDistType.Mariner.name:
logger.debug("Mariner returned")
return TiberOSBasedSotaOs(self._dispatcher_broker, self._signature, self._uri)
return TiberBasedSotaOs(self._dispatcher_broker, self._signature, self._uri)
elif os_type == LinuxDistType.tiber.name:
logger.debug("TiberOS returned")
return TiberOSBasedSotaOs(self._dispatcher_broker, self._signature, self._uri)
logger.debug("Tiber returned")
return TiberBasedSotaOs(self._dispatcher_broker, self._signature, self._uri)
raise ValueError('Unsupported OS type: ' + os_type)


Expand Down Expand Up @@ -260,8 +260,8 @@ def create_downloader(self) -> Downloader:
return WindowsDownloader()


class TiberOSBasedSotaOs(ISotaOs):
"""TiberOSBasedSotaOs class, child of ISotaOs"""
class TiberBasedSotaOs(ISotaOs):
"""TiberBasedSotaOs class, child of ISotaOs"""

def __init__(self, dispatcher_broker: DispatcherBroker, signature: Optional[str] = None,
uri: Optional[str] = None) -> None:
Expand All @@ -277,24 +277,24 @@ def __init__(self, dispatcher_broker: DispatcherBroker, signature: Optional[str

def create_setup_helper(self) -> SetupHelper:
logger.debug("")
return TiberOSSetupHelper(self._dispatcher_broker)
return TiberSetupHelper(self._dispatcher_broker)

def create_rebooter(self) -> Rebooter:
logger.debug("")
return LinuxRebooter(self._dispatcher_broker)

def create_os_updater(self) -> OsUpdater:
logger.debug("")
return TiberOSUpdater(signature=self._signature, uri=self._uri)
return TiberUpdater(signature=self._signature, uri=self._uri)

def create_snapshotter(self, sota_cmd: str, snap_num: Optional[str],
proceed_without_rollback: bool, reboot_device: bool) -> Snapshot:
logger.debug("")
trtl = Trtl(PseudoShellRunner(), BTRFS)
return TiberOSSnapshot(trtl, sota_cmd, self._dispatcher_broker, snap_num,
return TiberSnapshot(trtl, sota_cmd, self._dispatcher_broker, snap_num,
proceed_without_rollback, reboot_device)

def create_downloader(self) -> Downloader:
""" Create a downloader object"""
logger.debug("")
return TiberOSDownloader()
return TiberDownloader()
10 changes: 5 additions & 5 deletions inbm/dispatcher-agent/dispatcher/sota/os_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ def download_only(self) -> list[str]:
raise NotImplementedError()


class TiberOSUpdater(OsUpdater):
"""TiberOSUpdater class, child of OsUpdater
class TiberUpdater(OsUpdater):
"""TiberUpdater class, child of OsUpdater

@param signature: signature used to verify image
@param uri: uri provided in the manifest
Expand All @@ -405,12 +405,12 @@ def __init__(self, signature: Optional[str] = None, uri: Optional[str] = None) -

def update_remote_source(self, uri: Optional[CanonicalUri], signature: Optional[str],
repo: irepo.IRepo) -> List[str]:
"""Returns empty list for TiberOS --not applicable"""
logger.error("SOTA full mode is not supported in TiberOS.")
"""Returns empty list for Tiber --not applicable"""
logger.error("SOTA full mode is not supported in Tiber.")
return []

def update_local_source(self, file_path: str) -> List[str]:
"""Concrete class method to create command list to update from a local source for TiberOS.
"""Concrete class method to create command list to update from a local source for Tiber.
@param file_path: path to local file
@return: Command list to execute to perform update.
"""
Expand Down
12 changes: 6 additions & 6 deletions inbm/dispatcher-agent/dispatcher/sota/setup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,24 @@ def get_snapper_snapshot_number(self) -> str:
return ""


class TiberOSSetupHelper(SetupHelper):
class TiberSetupHelper(SetupHelper):
"""
TiberOS specific implementation of SetupHelper.
Tiber specific implementation of SetupHelper.
"""

def __init__(self, broker: DispatcherBroker) -> None:
""" Initializes TiberOSSetupHelper
""" Initializes TiberSetupHelper
@param broker: DispatcherBroker instance used to communicate with other INBM agents
"""
self._broker = broker
super().__init__()

def pre_processing(self) -> bool:
"""Perform checks immediately before applying an OS update or upgrade.
TiberOS: if Update Tool is present, it proceeds to perform the OS update
Tiber: if Update Tool is present, it proceeds to perform the OS update
@return: True if OK to proceed; False otherwise
"""
logger.debug("TiberOS pre processing")
logger.debug("Tiber pre processing")
return self._is_update_tool_exists()

def _is_update_tool_exists(self) -> bool:
Expand All @@ -227,5 +227,5 @@ def get_snapper_snapshot_number(self) -> str:

FIXME this is not OS generic)
"""
logger.debug("TiberOS post processing")
logger.debug("Tiber post processing")
return ""
36 changes: 18 additions & 18 deletions inbm/dispatcher-agent/dispatcher/sota/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ def update_system(self) -> None:
f"'mender-version' not in state or state is not available. state = {str(state)}")


class TiberOSSnapshot(Snapshot):
""" Snapshot for TiberOS.
class TiberSnapshot(Snapshot):
""" Snapshot for Tiber.

@param trtl: TRTL instance
@param sota_cmd: SOTA command (update)
Expand All @@ -459,11 +459,11 @@ def __init__(self, trtl: Trtl, sota_cmd: str,
self._dispatcher_broker = dispatcher_broker

def take_snapshot(self) -> None:
"""This method saves the current TiberOS artifact version info in a dispatcher state file
"""This method saves the current Tiber artifact version info in a dispatcher state file

@raises SotaError: When failed to create a dispatcher state file
"""
logger.debug("TiberOS take_snapshot")
logger.debug("Tiber take_snapshot")
self._dispatcher_broker.telemetry(
"SOTA attempting to create a dispatcher state file before SOTA {}...".
format(self.sota_cmd))
Expand All @@ -478,11 +478,11 @@ def take_snapshot(self) -> None:
if consumed_state:
restart_reason = consumed_state.get('restart_reason', None)
if restart_reason:
state = {'tiberos-version': content}
state = {'tiber-version': content}
else:
state = (
{'restart_reason': "sota",
'tiberos-version': content}
'tiber-version': content}
)
dispatcher_state.write_dispatcher_state_to_state_file(state)
except (DispatcherException, SotaError) as err:
Expand All @@ -494,7 +494,7 @@ def take_snapshot(self) -> None:
"Dispatcher state file creation successful.")

def commit(self) -> int:
"""On TiberOS, this method runs a UT commit command
"""On Tiber, this method runs a UT commit command

Also, delete dispatcher state file.
"""
Expand All @@ -507,7 +507,7 @@ def commit(self) -> int:
def recover(self, rebooter: Rebooter, time_to_wait_before_reboot: int) -> None:
"""Recover from a failed SOTA.

On TiberOS, no action is required other than deleting the
On Tiber, no action is required other than deleting the
state file and rebooting.
@param rebooter: Object implementing reboot() method
@param time_to_wait_before_reboot: If we are rebooting, wait this many seconds first.
Expand All @@ -520,7 +520,7 @@ def recover(self, rebooter: Rebooter, time_to_wait_before_reboot: int) -> None:
def revert(self, rebooter: Rebooter, time_to_wait_before_reboot: int) -> None:
"""Revert after second system SOTA boot when we see a problem with startup.

On TiberOS, we just reboot without commit
On Tiber, we just reboot without commit
@param rebooter: Object implementing reboot() method
@param time_to_wait_before_reboot: If we are rebooting, wait this many seconds first.
"""
Expand All @@ -532,24 +532,24 @@ def revert(self, rebooter: Rebooter, time_to_wait_before_reboot: int) -> None:
def update_system(self) -> None:
"""If the system supports it, check whether the system was updated, after rebooting.

For TiberOS, we compare the image's version stored in dispatcher state file and current os version.
For Tiber, we compare the image's version stored in dispatcher state file and current os version.
"""

logger.debug("attempting to get dispatcher state from state file")
state = dispatcher_state.consume_dispatcher_state_file()
if state is not None and 'tiberos-version' in state:
logger.debug("got tiberos-version from state: " + str(state['tiberos-version']))
if state is not None and 'tiber-version' in state:
logger.debug("got tiber-version from state: " + str(state['tiber-version']))
version = get_image_build_date()
current_tiberos_version = version
previous_tiberos_version = state['tiberos-version']
current_tiber_version = version
previous_tiber_version = state['tiber-version']

if current_tiberos_version == previous_tiberos_version:
if current_tiber_version == previous_tiber_version:
raise SotaError(
f"Requested update version is the same as previous version installed. VERSION: "
f"{current_tiberos_version}")
f"{current_tiber_version}")
else:
logger.debug("success; tiberos version changed")
logger.debug("success; tiber version changed")

else:
raise SotaError(
f"'tiberos-version' not in state or state is not available. state = {str(state)}")
f"'tiber-version' not in state or state is not available. state = {str(state)}")
8 changes: 4 additions & 4 deletions inbm/dispatcher-agent/dispatcher/sota/tiber_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tiber Util module will be called by dispatcher to perform the image downloading in TiberOS.
Tiber Util module will be called by dispatcher to perform the image downloading in Tiber.

Copyright (C) 2017-2024 Intel Corporation
SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -153,7 +153,7 @@ def is_enough_space_to_download(manifest_uri: str,


def read_release_server_token(token_path: str = RELEASE_SERVER_TOKEN_PATH) -> str:
"""Read release server JWT token from a path configured by Tiber OS node-agent. The node agent will renew
"""Read release server JWT token from a path configured by Tiber node-agent. The node agent will renew
the token when the token is expired.

@return: JWT token to access release server
Expand All @@ -167,10 +167,10 @@ def read_release_server_token(token_path: str = RELEASE_SERVER_TOKEN_PATH) -> st
else:
msg = f"{token_path} not exist."
except OSError as err:
raise SotaError(f"Error while performing TiberOS download: {err}")
raise SotaError(f"Error while performing Tiber download: {err}")

if token is None:
msg = f"No JWT token found."

logger.error(msg)
raise SotaError(f"Error while performing TiberOS download: {msg}")
raise SotaError(f"Error while performing Tiber download: {msg}")
Loading