Skip to content
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

chore: prepare release for v1.1.0 #1

Merged
merged 128 commits into from
May 16, 2024
Merged

chore: prepare release for v1.1.0 #1

merged 128 commits into from
May 16, 2024

Conversation

Bodong-Yang
Copy link
Member

@Bodong-Yang Bodong-Yang commented Apr 24, 2024

Introduction

This PR releases the new otaclient-iot-logging-server v1.0.1.

New feature

Logging filtering

Since otaclient iot-logger is expected to run on main ECU, now new iot-logger will parse the ecu_info.yaml file installed on the main ECU.
Only loggings sent from known ECU ids will be accepted and upload to cloud.

Restart(by systemd) on config files changed

Warning

The restart is done by configured systemd service unit file, otaclient-logger itself can only kill itself on config files changed.

With Restart policy configured otaclient-logger systemd service unit file, otaclient-logger can restart itself(by systemd) on detecting any configuration files changed. Currently greengrass config(the in use one), ecu_info.yaml and aws_profile_info.yaml files are monitored.

Other Improvement & refinement

  1. (tpm support) use official supported awsiot_credentialhelper instead of pycurl, significantly reduce the dependency footprint and size, no more compilation during otaclient iot-logger installation.
  2. (tpm support) refine overall iot-logger tpm support.
  3. overall refine the architecture of the iot-logger, simplify the logging piping flow within the iot-logger.
  4. refactor how the iot-logger is configured, now all options are passed via environmental variables.
  5. refactor how the iot-logger completes the information of AWS profile, now it takes an aws_profile_info.yaml file instead of receiving params from command line.
  6. refactor greengrass configuration parsing, now iot-logger can parse the greengrass configuration file by itself, no need to depend on external scripts.
  7. refactor aws_iot_logger, remove the logic of using sequencToken as sequenceToken is now unnecessary and ignored by AWS. See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs/client/put_log_events.html for more details.

CI

Sonarcloud and pre-commit.ci are introduced to this repository.
The following pre-commit hooks are used:

  1. black
  2. flake8
  3. isort
  4. pre-commit-hooks: end-of-file-fixer, trailing-whitespace
  5. pygrep-hooks: python-check-mock-methods, python-use-type-annotations
  6. markdownlint

otaclient iot-logger roles in autoware_ecu_system_setup

Since the package changed a lot, the corresponding ecu_system_setup role in ecu_system_setup is also updated.

Check https://github.com/tier4/autoware_ecu_system_setup/tree/refine/new_otaclient%2Biot-logger/roles/ota_client_logger for more details.

Test files implementation

The unit tests for each components of the iot-logger have been implemented.

Real world test

The iot-logger implemented by this repository has been tested multiple times on the bench environment, and it all works without any problem.

See the following bench test for more details:

…change SERVER_LOGGING_LEVEL field to Literal field
@Bodong-Yang Bodong-Yang changed the title chore: prepare release for v1.0.1 chore: prepare release for v1.1.0 May 8, 2024
Bodong-Yang and others added 12 commits May 13, 2024 01:55
This PR introduces the functionality of killing the server on config files changed.
Currently the in use ecu_info.yaml, aws_profile_info.yaml and greengrass configuration files are monitored.

This feature is expected to be used together with systemd.service Restart policy to achieve automatically restart on config files changed.
@tier4 tier4 deleted a comment from github-actions bot May 14, 2024
Copy link
Contributor

github-actions bot commented May 16, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/otaclient_iot_logging_server
   __init__.py30100% 
   __main__.py18194%49
   _common.py150100% 
   _log_setting.py271062%63, 65–66, 68–69, 73–74, 77–78, 80
   _utils.py54296%73, 137
   _version.py80100% 
   aws_iot_logger.py1015545%65–67, 69–72, 75, 81–87, 90–92, 95–100, 104–107, 111–113, 116–118, 121–126, 139, 145–147, 149–153, 157, 197, 204–207
   boto3_session.py35974%50, 58–59, 61, 78–79, 83, 85, 93
   config_file_monitor.py44686%64–66, 83–85
   configs.py45197%74
   ecu_info.py37197%75
   greengrass_config.py97594%155, 266–269
   log_proxy_server.py37878%46, 73–75, 81–83, 86
TOTAL5219881% 

Tests Skipped Failures Errors Time
38 0 💤 0 ❌ 0 🔥 12.012s ⏱️

Copy link

sonarqubecloud bot commented May 16, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
78.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@Bodong-Yang Bodong-Yang merged commit c6c51e0 into main May 16, 2024
11 of 12 checks passed
@Bodong-Yang Bodong-Yang deleted the release/v1.0.1 branch June 11, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant