Skip to content

Commit

Permalink
Merge pull request #53 from thin-edge/fix-stop-container-after-update
Browse files Browse the repository at this point in the history
fix(self-update): remove updater container after collecting logs
  • Loading branch information
reubenmiller authored Dec 4, 2024
2 parents 27a62da + 9680a96 commit cd428a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion files/tedge/self_update.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on_success = "collect-logs"
on_error = "collect-logs"

[collect-logs]
script = "sh -c 'sudo -E tedge-container tools container-logs ${.payload.containerName}-updater && sudo -E tedge-container tools container-remove ${.payload.containerName}-updater'"
script = "sh -c 'sudo -E tedge-container tools container-logs ${.payload.containerName}-updater; sudo -E tedge-container tools container-remove ${.payload.containerName}-updater'"
on_success = "verify"
on_error = "verify"

Expand Down
3 changes: 3 additions & 0 deletions tests/main/self-update.robot
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Self update using software update operation
Device Should Have Installed Software
... {"name": "tedge", "version": "ghcr.io/thin-edge/tedge-container-bundle:99.99.2", "softwareType": "container"}

# updater container should be removed (logs are already collected as part of the workflow)
Cumulocity.Should Have Services service_type=container name=tedge-updater min_count=0 max_count=0

Rollback when trying to install a non-tedge based image
# pre-condition
Device Should Have Installed Software
Expand Down

7 comments on commit cd428a4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
18 0 2 18 100 6m1.839051s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 25.327 s Container
Grace period to allow container to startup 5.045 s Operations
Service is up 0.140 s Operations
Get Logfile Request 2.338 s Operations
Get Configuration File 4.688 s Operations
Execute Shell Command 2.359 s Operations
Install application using docker compose 15.276 s Operations
Get Container Logs 2.345 s Operations
Get Container Logs without explicit container name 2.355 s Operations
Get Container Logs For Non-existent container 2.361 s Operations
Trigger self update via local command 25.150 s Self-Update
Self update should only update if there is a new image 20.083 s Self-Update
Self update using software update operation 102.432 s Self-Update
Rollback when trying to install a non-tedge based image 27.163 s Self-Update
Self update using software update operation using Container type 100.958 s Self-Update
Cloud Connection is Online 0.156 s Telemetry
Service status 0.250 s Telemetry
Sends measurements 2.658 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
18 0 2 18 100 5m58.976231s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 25.022 s Container
Grace period to allow container to startup 5.045 s Operations
Service is up 0.144 s Operations
Get Logfile Request 2.349 s Operations
Get Configuration File 4.679 s Operations
Execute Shell Command 2.370 s Operations
Install application using docker compose 15.363 s Operations
Get Container Logs 2.378 s Operations
Get Container Logs without explicit container name 2.372 s Operations
Get Container Logs For Non-existent container 2.365 s Operations
Trigger self update via local command 24.103 s Self-Update
Self update should only update if there is a new image 19.597 s Self-Update
Self update using software update operation 107.527 s Self-Update
Rollback when trying to install a non-tedge based image 20.097 s Self-Update
Self update using software update operation using Container type 102.565 s Self-Update
Cloud Connection is Online 0.357 s Telemetry
Service status 0.253 s Telemetry
Sends measurements 2.470 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 1 19 100 8m6.325759s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 26.326 s Container
Grace period to allow container to startup 5.036 s Operations
Service is up 0.202 s Operations
Get Logfile Request 2.385 s Operations
Get Configuration File 4.783 s Operations
Execute Shell Command 2.402 s Operations
Install application using docker compose 17.625 s Operations
Get Container Logs 2.406 s Operations
Get Container Logs without explicit container name 2.415 s Operations
Get Container Logs For Non-existent container 2.419 s Operations
Update From Legacy Versions 139.930 s Self-Update-Compat
Trigger self update via local command 25.205 s Self-Update
Self update should only update if there is a new image 20.799 s Self-Update
Self update using software update operation 103.780 s Self-Update
Rollback when trying to install a non-tedge based image 21.352 s Self-Update
Self update using software update operation using Container type 106.185 s Self-Update
Cloud Connection is Online 0.179 s Telemetry
Service status 0.307 s Telemetry
Sends measurements 2.542 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 1 19 100 8m7.621461s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 26.281 s Container
Grace period to allow container to startup 5.042 s Operations
Service is up 0.183 s Operations
Get Logfile Request 2.429 s Operations
Get Configuration File 4.852 s Operations
Execute Shell Command 2.444 s Operations
Install application using docker compose 17.851 s Operations
Get Container Logs 2.494 s Operations
Get Container Logs without explicit container name 2.446 s Operations
Get Container Logs For Non-existent container 2.450 s Operations
Update From Legacy Versions 138.374 s Self-Update-Compat
Trigger self update via local command 25.383 s Self-Update
Self update should only update if there is a new image 20.850 s Self-Update
Self update using software update operation 104.131 s Self-Update
Rollback when trying to install a non-tedge based image 21.345 s Self-Update
Self update using software update operation using Container type 108.023 s Self-Update
Cloud Connection is Online 0.175 s Telemetry
Service status 0.284 s Telemetry
Sends measurements 2.540 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 1 19 100 8m8.338648s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 26.524 s Container
Grace period to allow container to startup 5.046 s Operations
Service is up 0.151 s Operations
Get Logfile Request 2.349 s Operations
Get Configuration File 4.700 s Operations
Execute Shell Command 2.357 s Operations
Install application using docker compose 15.853 s Operations
Get Container Logs 4.471 s Operations
Get Container Logs without explicit container name 2.366 s Operations
Get Container Logs For Non-existent container 2.362 s Operations
Update From Legacy Versions 139.894 s Self-Update-Compat
Trigger self update via local command 25.597 s Self-Update
Self update should only update if there is a new image 21.433 s Self-Update
Self update using software update operation 105.287 s Self-Update
Rollback when trying to install a non-tedge based image 21.614 s Self-Update
Self update using software update operation using Container type 106.682 s Self-Update
Cloud Connection is Online 0.155 s Telemetry
Service status 0.257 s Telemetry
Sends measurements 1.203 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 1 19 100 8m10.23711s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 28.211 s Container
Grace period to allow container to startup 5.050 s Operations
Service is up 0.160 s Operations
Get Logfile Request 2.347 s Operations
Get Configuration File 4.752 s Operations
Execute Shell Command 2.373 s Operations
Install application using docker compose 13.211 s Operations
Get Container Logs 2.356 s Operations
Get Container Logs without explicit container name 2.366 s Operations
Get Container Logs For Non-existent container 2.360 s Operations
Update From Legacy Versions 138.433 s Self-Update-Compat
Trigger self update via local command 25.070 s Self-Update
Self update should only update if there is a new image 22.155 s Self-Update
Self update using software update operation 105.608 s Self-Update
Rollback when trying to install a non-tedge based image 22.906 s Self-Update
Self update using software update operation using Container type 109.959 s Self-Update
Cloud Connection is Online 0.156 s Telemetry
Service status 0.261 s Telemetry
Sends measurements 2.459 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
19 0 1 19 100 8m32.175042s

Passed Tests

Name ⏱️ Duration Suite
Ignore Containers Marked With A Specific Label 27.119 s Container
Grace period to allow container to startup 5.050 s Operations
Service is up 0.442 s Operations
Get Logfile Request 2.560 s Operations
Get Configuration File 5.109 s Operations
Execute Shell Command 2.584 s Operations
Install application using docker compose 20.555 s Operations
Get Container Logs 2.575 s Operations
Get Container Logs without explicit container name 2.567 s Operations
Get Container Logs For Non-existent container 2.570 s Operations
Update From Legacy Versions 141.789 s Self-Update-Compat
Trigger self update via local command 26.375 s Self-Update
Self update should only update if there is a new image 28.592 s Self-Update
Self update using software update operation 106.816 s Self-Update
Rollback when trying to install a non-tedge based image 24.684 s Self-Update
Self update using software update operation using Container type 109.353 s Self-Update
Cloud Connection is Online 0.231 s Telemetry
Service status 0.403 s Telemetry
Sends measurements 2.760 s Telemetry

Please sign in to comment.