From c29d002110f736d7e2785236785c66ffd85efccc Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 1 Jul 2021 12:58:57 +0200 Subject: [PATCH 1/5] Add container-diff scripts and update others Add container-diff scripts and update others Signed-off-by: Bensuperpc --- imagefiles/install-crosstool-ng-toolchain.sh | 3 +++ imagefiles/install-python-packages.sh | 2 ++ tools/container-diff.sh | 26 ++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100755 tools/container-diff.sh diff --git a/imagefiles/install-crosstool-ng-toolchain.sh b/imagefiles/install-crosstool-ng-toolchain.sh index f343882..098fe42 100755 --- a/imagefiles/install-crosstool-ng-toolchain.sh +++ b/imagefiles/install-crosstool-ng-toolchain.sh @@ -79,6 +79,9 @@ if [ ${REV} = "crosstool-ng-1.23.0" ]; then patch scripts/build/companion_libs/210-expat.sh -i /dockcross/crosstool-ng-expat.patch # Patch to fix error with bash 5 and up: https://github.com/pfalcon/esp-open-sdk/issues/365 patch configure.ac -i /dockcross/Fix-error-with-bash-5-and-up.patch + # Clean patch + rm /dockcross/Fix-error-with-bash-5-and-up.patch + rm /dockcross/crosstool-ng-expat.patch fi # Bootstrap and install the tool. diff --git a/imagefiles/install-python-packages.sh b/imagefiles/install-python-packages.sh index 088a4e7..2c7b3e0 100755 --- a/imagefiles/install-python-packages.sh +++ b/imagefiles/install-python-packages.sh @@ -29,3 +29,5 @@ rm get-pip.py ${PYTHON} -m pip install --upgrade --ignore-installed setuptools ${PYTHON} -m pip install --ignore-installed conan +# Purge cache to save space: https://stackoverflow.com/questions/37513597/is-it-safe-to-delete-cache-pip-directory +${PYTHON} -m pip cache purge diff --git a/tools/container-diff.sh b/tools/container-diff.sh new file mode 100755 index 0000000..d4c860d --- /dev/null +++ b/tools/container-diff.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -euo pipefail + +# More info: https://github.com/GoogleContainerTools/container-diff + +if (( $# < 1 || $# > 2 )); then + echo "Need 1 or 2 arguments: " + exit 1 +fi + +if (( $# == 1 )); then + container-diff analyze $1 --type=history 2>&1 | tee -a analyze-history.txt + container-diff analyze $1 --type=file 2>&1 | tee -a analyze-file.txt + container-diff analyze $1 --type=size 2>&1 | tee -a analyze-size.txt + container-diff analyze $1 --type=apt 2>&1 | tee -a analyze-apt.txt + container-diff analyze $1 --type=pip 2>&1 | tee -a analyze-pip.txt + +fi + +if (( $# == 2 )); then + container-diff diff $1 $2 --type=history 2>&1 | tee -a diff-history.txt + container-diff diff $1 $2 --type=file 2>&1 | tee -a diff-file.txt + container-diff diff $1 $2 --type=size 2>&1 | tee -a diff-size.txt + container-diff diff $1 $2 --type=apt 2>&1 | tee -a diff-apt.txt + container-diff diff $1 $2 --type=pip 2>&1 | tee -a diff-pip.txt +fi From c25ebfcee884f938d84315e49a32575926f53a0d Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 1 Jul 2021 17:54:04 +0200 Subject: [PATCH 2/5] Add compression for base image Add .tar.xz with maximum compression -e9 Signed-off-by: Bensuperpc --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 234e365..1201765 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: archive base run: | mkdir -p cache - docker save -o ./cache/base.tar dockcross/base:latest + docker save dockcross/base:latest | xz -e9 -T0 > base.tar.xz - name: save base uses: actions/upload-artifact@v2 with: @@ -54,7 +54,7 @@ jobs: name: cache path: ./cache - name: load base - run: docker load -i ./cache/base.tar + run: xz -d -k < base.tar.xz | docker load - name: build run: make ${{ matrix.arch_name }} - name: test From fd0291d79424311e1f1db55844690743576b6666 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 1 Jul 2021 17:59:13 +0200 Subject: [PATCH 3/5] Reduce stale to run every 8h Reduce stale to run every 8h Signed-off-by: Bensuperpc --- .github/workflows/expired.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/expired.yml b/.github/workflows/expired.yml index ec6e5b3..49ac970 100644 --- a/.github/workflows/expired.yml +++ b/.github/workflows/expired.yml @@ -1,7 +1,7 @@ name: 'Close stale issues and PRs' on: schedule: - - cron: '* * */1 * *' + - cron: '0 */8 * * *' jobs: stale: runs-on: ubuntu-latest From 4463776a2e6089d14a97a63272bff328aad4aca1 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 1 Jul 2021 18:25:04 +0200 Subject: [PATCH 4/5] Fix wrong path in cache Change base.tar.xz to ./cache/base.tar.xz Signed-off-by: Bensuperpc --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1201765..81883c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: archive base run: | mkdir -p cache - docker save dockcross/base:latest | xz -e9 -T0 > base.tar.xz + docker save dockcross/base:latest | xz -e9 -T0 > ./cache/base.tar.xz - name: save base uses: actions/upload-artifact@v2 with: @@ -54,7 +54,7 @@ jobs: name: cache path: ./cache - name: load base - run: xz -d -k < base.tar.xz | docker load + run: xz -d -k < ./cache/base.tar.xz | docker load - name: build run: make ${{ matrix.arch_name }} - name: test From 2d42afb5c1d99455235806c74dc72ead0218f221 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Fri, 2 Jul 2021 08:45:02 +0200 Subject: [PATCH 5/5] Fix wrong days count in commentary (120 and 30), update runner to ubuntu-latest Fix wrong days count in commentary (120 and 30), update runner to ubuntu-latest Signed-off-by: Bensuperpc --- .github/workflows/expired.yml | 8 ++++---- .github/workflows/main.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/expired.yml b/.github/workflows/expired.yml index 49ac970..358b906 100644 --- a/.github/workflows/expired.yml +++ b/.github/workflows/expired.yml @@ -12,10 +12,10 @@ jobs: exempt-issue-milestones: 'future,alpha,beta,release' exempt-pr-milestones: 'bugfix,improvement' exempt-all-pr-assignees: true - stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.' - stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.' - close-issue-message: 'This issue was closed because it has been stalled for 15 days with no activity.' - close-pr-message: 'This PR was closed because it has been stalled for 15 days with no activity.' + stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 15 days.' + stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 15 days.' + close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.' days-before-issue-stale: 120 days-before-pr-stale: 120 days-before-issue-close: 30 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81883c5..912efb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ on: jobs: base: name: base - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: build