siemens / meta-iot2050

SIMATIC IOT2050 Isar/Debian Board Support Package
MIT License
129 stars 76 forks source link

Fix github CI action #408

Closed BaochengSu closed 1 year ago

BaochengSu commented 1 year ago

apt-get purge could potentially induce an apt upgrade, which needs the apt-get update beforehand.

Also, github action uses azure apt repo, which seems not so stable as the official archive.ubuntu.com.

AsuraZeng commented 1 year ago

apt purge would introduce apt upgrade? I doubt that.

BaochengSu commented 1 year ago

apt purge would introduce apt upgrade? I doubt that.

https://github.com/siemens/meta-iot2050/actions/runs/3898437787/jobs/6657200730

Run sudo apt-get purge 'dotnet*' google-chrome-stable 'temurin*' google-cloud-sdk azure-cli 'mongodb*' powershell firefox chromium 'llvm*' 'libllvm*' 'mysql*' libgl1-mesa-dri apache2 'mono*' 'swift*' microsoft-edge-stable
...
The following NEW packages will be installed:
  ca-certificates-java default-jre-headless libpcsclite1
  openjdk-11-jre-headless
The following packages will be upgraded:
  aspnetcore-targeting-pack-6.0
1 upgraded, 4 newly installed, 253 to remove and 1 not upgraded.
Need to get 43.0 MB of archives
After this operation, 7419 MB disk space will be freed.
Err:1 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-6.0 amd64 6.0.111-0ubuntu1~22.04.1
  404  Not Found [IP: 52.252.75.106 80]
Get:2 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 ca-certificates-java all 20190909 [12.1 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libpcsclite1 amd64 1.9.5-3 [19.9 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jre-headless amd64 11.0.17+8-1ubuntu2~22.04 [41.5 MB]
Get:5 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 default-jre-headless amd64 2:1.11-72build2 [3042 B]
Fetched 41.6 MB in 1s (60.1 MB/s)
E: Failed to fetch [http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet6/aspnetcore-targeting-pack-6.0_6.0.111-0ubuntu1%7e22.04.1_amd64.deb](http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet6/aspnetcore-targeting-pack-6.0_6.0.111-0ubuntu1~22.04.1_amd64.deb)  404  Not Found [IP: 52.252.75.106 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
jan-kiszka commented 1 year ago

The issue is valid, the solution is not. We rather need to identify and purge also those packages that pull in alternatives while we want to remove the feature completely.

BaochengSu commented 1 year ago

We rather need to identify and purge also those packages that pull in alternatives while we want to remove the feature completely.

But the inventory of installed packages is under github's control, not us. For this particular case, indeed we can identify the packages in question, however, no one can assure that in the future Github doesn't update its base image to add/remove/update packages, even the upstream ubuntu changes the dependencies for packages now and then... That means we could face the similar issues again and again in the future.

The main target here is to remove some preinstalled packages to get more spaces for the building, not to remove/purge the so-called correct packages itself.

By my way, the main target is still fulfilled and it also save us from the future potential maintenance, so why not?

jan-kiszka commented 1 year ago

As it does not fulfill the original intention: delete unused packages.

BaochengSu commented 1 year ago

Or in other words, it can be combined with the identifying the correct package list. Identifying is good for now, and the apt update is good for future.

BaochengSu commented 1 year ago

As it does not fulfill the original intention: delete unused packages.

See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software

This is the inventory of github action's ubuntu image: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md

The current list in the yaml is far from deleting unused packages.

jan-kiszka commented 1 year ago

It is about deleting larger unused packages.

If you don't see how to fix the issue for real, let me look into it briefly.

BaochengSu commented 1 year ago

As it does not fulfill the original intention: delete unused packages.

This is from the header of .github/workflows/free-disk-space/action.yml

name: 'Free Disk Space'
description: 'Remove content of the provided image to free disk space for the build'

So wrong description here?

jan-kiszka commented 1 year ago

Probably, it was already my mistake to drop default-jre-headless from our list.

BaochengSu commented 1 year ago

If you don't see how to fix the issue for real, let me look into it briefly.

It would not save you from the similar issues caused by future updates of the action image.

jan-kiszka commented 1 year ago

The only thing that will save us from that is github finally providing a minimal image. Anything else, including your workaround, will remain a whac-a-mole game.

BaochengSu commented 1 year ago

The only thing that will save us from that is github finally providing a minimal image. Anything else, including your workaround, will remain a whac-a-mole game.

Yep, or you pay them enough money.

However, before that, at least my workaround helps on reducing the number of moles, then we can save some time for some real values.

jan-kiszka commented 1 year ago

This one can be closed now, the real fix is building.