Skip to content

Commit 05b4b69

Browse files
committed
Draft - analysis.
1 parent 5c5e4a7 commit 05b4b69

File tree

3 files changed

+193
-4
lines changed

3 files changed

+193
-4
lines changed

.github/workflows/build.yml

+134-3
Original file line numberDiff line numberDiff line change
@@ -308,19 +308,150 @@ jobs:
308308
./ubiquitous_bash.sh _split_ingredientVM
309309
timeout-minutes: 355
310310

311-
- name: release! hash! ingredient
311+
- name: _create_ingredientVM_report
312+
shell: bash
313+
run: |
314+
./ubiquitous_bash.sh _create_ingredientVM_report
315+
timeout-minutes: 355
316+
317+
- name: release! ingredient! hash, reports
312318
shell: bash
313319
run: |
314320
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/vm-ingredient.img.hash.txt
321+
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/micro-dpkg.txt
322+
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/micro-binReport.txt
315323
env:
316324
GH_TOKEN: ${{ github.token }}
317325

318-
- name: release! package_ingredientVM
326+
- name: release! ingredient! package_ingredientVM
319327
shell: bash
320328
run: |
321329
./ubiquitous_bash.sh _gh_release_upload_parts-multiple_sequence build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/vm-ingredient.img.flx.part*
322330
323331
332+
333+
334+
build-analysis-ingredient:
335+
needs: [build_ingredient, build_release]
336+
runs-on: ubuntu-latest
337+
steps:
338+
- name: report! API Rate Limit
339+
shell: bash
340+
run: |
341+
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ""${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/rate_limit
342+
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
343+
344+
- name: _getCore_ub
345+
shell: bash
346+
run: |
347+
mkdir -p ~/core/infrastructure
348+
cd ~/core/infrastructure
349+
git clone --depth 1 --recursive https://github.com/mirage335-colossus/ubiquitous_bash.git
350+
cd ubiquitous_bash
351+
./_setupUbiquitous.bat
352+
./ubiquitous_bash.sh _custom_splice_opensslConfig
353+
354+
- uses: actions/checkout@v3
355+
with:
356+
fetch-depth: 1
357+
submodules: 'recursive'
358+
- name: mkdir _local
359+
shell: bash
360+
run: |
361+
mkdir -p ./_local
362+
363+
- name: _getMinimal_cloud
364+
shell: bash
365+
run: |
366+
! ./ubiquitous_bash.sh _getMinimal_cloud && exit 1
367+
true
368+
#! sudo -n apt-get -y clean && exit 1
369+
df -h
370+
df -h /
371+
timeout-minutes: 355
372+
373+
- name: _getMost-aria2
374+
shell: bash
375+
run: |
376+
sudo -n apt-get -y clean
377+
sudo -n apt-get update
378+
sudo -n env DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends -y aria2
379+
timeout-minutes: 355
380+
381+
382+
- name: analysis! missing-binaries
383+
shell: bash
384+
run: |
385+
#echo -n
386+
_safeEcho() {
387+
printf '%s' "$1"
388+
shift
389+
390+
[[ "$@" == "" ]] && return 0
391+
392+
local currentArg
393+
for currentArg in "$@"
394+
do
395+
printf '%s' " "
396+
printf '%s' "$currentArg"
397+
done
398+
return 0
399+
}
400+
401+
#echo
402+
_safeEcho_newline() {
403+
_safeEcho "$@"
404+
printf '\n'
405+
}
406+
407+
mkdir -p ./_local/analysis
408+
409+
#cp ./_local/micro-binReport.txt ./_local/analysis/micro-binReport.txt
410+
#cp ./_local/micro-dpkg.txt ./_local/analysis/micro-dpkg.txt
411+
412+
cd ./_local/analysis
413+
414+
# Get the list of releases
415+
RELEASES=$(curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/soaringDistributions/ubDistBuild/releases?per_page=100&page=1)
416+
417+
# Download micro-binReport.txt file for the current release
418+
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-binReport-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/micro-binReport.txt"
419+
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-dpkg-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/micro-dpkg.txt"
420+
421+
# Loop through each release
422+
#for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r '.[].tag_name' | sort --reverse); do
423+
for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r 'sort_by(.published_at) | reverse | .[].tag_name' | tr -dc 'a-zA-Z0-9\-_.:\n'); do
424+
425+
# Compare the list of binaries in this release to the current release
426+
if [ "$RELEASE" != "$currentReleaseTag" ]; then
427+
428+
# Download the binReport file for this release
429+
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-binReport-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/micro-binReport.txt"
430+
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-dpkg-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/micro-dpkg.txt"
431+
432+
echo | tee -a ./missing-micro-binReport.txt
433+
echo "Binaries (filesystem) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-micro-binReport.txt
434+
comm -23 <(sort "micro-binReport-$RELEASE") <(sort "micro-binReport-$currentReleaseTag") | tee -a ./missing-micro-binReport.txt
435+
echo | tee -a ./missing-micro-dpkg.txt
436+
echo "Binaries (dpkg) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-micro-dpkg.txt
437+
comm -23 <(sort "micro-dpkg-$RELEASE") <(sort "micro-dpkg-$currentReleaseTag") | tee -a ./missing-micro-dpkg.txt
438+
fi
439+
done
440+
env:
441+
currentReleaseTag: build-${{ github.run_id }}-${{ github.run_attempt }}
442+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
443+
444+
- name: release! analysis! missing-binaries
445+
shell: bash
446+
run: |
447+
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-micro-binReport.txt
448+
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-micro-dpkg.txt
449+
env:
450+
GH_TOKEN: ${{ github.token }}
451+
452+
453+
454+
324455

325456

326457

@@ -549,7 +680,7 @@ jobs:
549680
- name: _get_ingredientVM
550681
shell: bash
551682
run: |
552-
./_get_ingredientVM
683+
./ubiquitous_bash.sh _get_ingredientVM
553684
554685
- name: _create_ubDistBuild-create
555686
shell: bash

_prog/core-micro.sh

+29
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,35 @@ _create_ingredientVM_online() {
414414
return 0
415415
}
416416

417+
_create_ingredientVM_report() {
418+
type _if_cygwin > /dev/null 2>&1 && _if_cygwin && _messagePlain_warn 'warn: _if_cygwin' && _stop 1
419+
_messageNormal '##### init: _create_ingredientVM_report'
420+
421+
mkdir -p "$scriptLocal"
422+
export ubVirtImageOverride="$scriptLocal"/"vm-ingredient.img"
423+
424+
425+
_messagePlain_nominal '> _openChRoot'
426+
! "$scriptAbsoluteLocation" _openChRoot && _messagePlain_bad 'fail: _openChRoot' && _messageFAIL
427+
428+
429+
_chroot find /bin/ /usr/bin/ /sbin/ /usr/sbin/ | sudo -n tee "$globalVirtFS"/micro-binReport.txt > /dev/null
430+
_chroot find /home/user/.nix-profile/bin | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null 2>&1
431+
_chroot find /home/user/.gcloud/google-cloud-sdk/bin | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null
432+
_chroot find /home/user/.ebcli-virtual-env/executables | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null 2>&1
433+
sudo -n cp -f "$globalVirtFS"/micro-binReport.txt "$scriptLocal"/micro-binReport.txt
434+
sudo -n chown "$USER":"$USER" "$scriptLocal"/micro-binReport.txt
435+
436+
_chroot dpkg --get-selections | cut -f1 | sudo -n tee "$globalVirtFS"/micro-dpkg.txt > /dev/null
437+
sudo -n cp -f "$globalVirtFS"/micro-dpkg.txt "$scriptLocal"/micro-dpkg.txt
438+
sudo -n chown "$USER":"$USER" "$scriptLocal"/micro-dpkg.txt
439+
440+
441+
_messagePlain_nominal '> _closeChRoot'
442+
! "$scriptAbsoluteLocation" _closeChRoot && _messagePlain_bad 'fail: _closeChRoot' && _messageFAIL
443+
444+
return 0
445+
}
417446

418447

419448

ubiquitous_bash.sh

+30-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _ub_cksum_special_derivativeScripts_contents() {
3636
#export ub_setScriptChecksum_disable='true'
3737
( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true'
3838
export ub_setScriptChecksum_header='2591634041'
39-
export ub_setScriptChecksum_contents='579031175'
39+
export ub_setScriptChecksum_contents='3795781702'
4040

4141
# CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary.
4242
# WARNING: Performance may be crucial here.
@@ -55920,6 +55920,35 @@ _create_ingredientVM_online() {
5592055920
return 0
5592155921
}
5592255922

55923+
_create_ingredientVM_report() {
55924+
type _if_cygwin > /dev/null 2>&1 && _if_cygwin && _messagePlain_warn 'warn: _if_cygwin' && _stop 1
55925+
_messageNormal '##### init: _create_ingredientVM_report'
55926+
55927+
mkdir -p "$scriptLocal"
55928+
export ubVirtImageOverride="$scriptLocal"/"vm-ingredient.img"
55929+
55930+
55931+
_messagePlain_nominal '> _openChRoot'
55932+
! "$scriptAbsoluteLocation" _openChRoot && _messagePlain_bad 'fail: _openChRoot' && _messageFAIL
55933+
55934+
55935+
_chroot find /bin/ /usr/bin/ /sbin/ /usr/sbin/ | sudo -n tee "$globalVirtFS"/micro-binReport.txt > /dev/null
55936+
_chroot find /home/user/.nix-profile/bin | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null 2>&1
55937+
_chroot find /home/user/.gcloud/google-cloud-sdk/bin | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null
55938+
_chroot find /home/user/.ebcli-virtual-env/executables | sudo -n tee -a "$globalVirtFS"/micro-binReport.txt > /dev/null 2>&1
55939+
sudo -n cp -f "$globalVirtFS"/micro-binReport.txt "$scriptLocal"/micro-binReport.txt
55940+
sudo -n chown "$USER":"$USER" "$scriptLocal"/micro-binReport.txt
55941+
55942+
_chroot dpkg --get-selections | cut -f1 | sudo -n tee "$globalVirtFS"/micro-dpkg.txt > /dev/null
55943+
sudo -n cp -f "$globalVirtFS"/micro-dpkg.txt "$scriptLocal"/micro-dpkg.txt
55944+
sudo -n chown "$USER":"$USER" "$scriptLocal"/micro-dpkg.txt
55945+
55946+
55947+
_messagePlain_nominal '> _closeChRoot'
55948+
! "$scriptAbsoluteLocation" _closeChRoot && _messagePlain_bad 'fail: _closeChRoot' && _messageFAIL
55949+
55950+
return 0
55951+
}
5592355952

5592455953

5592555954

0 commit comments

Comments
 (0)