-
Notifications
You must be signed in to change notification settings - Fork 1
2590 lines (2133 loc) · 97.1 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# WARNING: May be untested .
# WARNING: As much as ~100GB temporary storage may be required.
# https://github.community/t/bigger-github-hosted-runners-disk-space/17267
# 2vCPU, 7GiB RAM, 14GiB SSD
# 16vCPU, 56GiB RAM, 112GiB SSD
# Github Actions may have a higher capacity (presumably HDD) or 'C:\' disk, contrasted with the small 'Temp storage' SSD. Apparently does not apply to Linux 'runners'.
# BuildJet may use some larger instances, at much higher price. Apparently BuildJet instances have 61GB .
# Cloud VPS, through cloud-init and other APIs, may be much more cost effective.
# ATTENTION: NOTICE: Consider replacing the current directory with a symlink to a larger filesystem, before checkout of repository.
name: build
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
actions: write
checks: read
contents: write
deployments: read
issues: none
packages: read
pull-requests: read
repository-projects: read
security-events: none
statuses: read
on:
#push:
workflow_dispatch:
inputs:
devfast:
required: true
type: boolean
default: true
skimfast:
required: true
type: boolean
default: false
qemuNoKVM:
required: true
type: boolean
default: true
runnerName:
required: true
default: ubuntu-latest-m
type: choice
options:
- ubuntu-latest
- ubuntu-latest-m
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
schedule:
#- cron: '5 7 * * 6'
#- cron: '5 1 * * 6'
#- cron: '5 1 * * 2,4'
#- cron: '5 1 * * 2'
#- cron: '5 1 * * 4'
#- cron: '5 1 * * 5'
- cron: '5 7 15 * *'
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
#group: ${{ github.workflow }}-${{ github.ref }}
group: build-${{ github.ref }}
cancel-in-progress: true
# Adding 'core' and 'live' images could be separate jobs if necessary.
# Conveniently separable code for 'experiment', and may add additional build time.
# Disadvantage of downloading back from rclone, and duplicating such preparation as deleting files from CI.
# Better to just copy relevant markup to separate CI config files, which would be the desired end result anyway.
# https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
# https://stackoverflow.com/questions/68187987/github-actions-job-timeout
# 'Each job in a workflow can run for up to 6 hours'
#core:
#if: ${{ always() }}
#needs: [build]
#live:
#if: ${{ always() }}
#needs: [build, core]
jobs:
build_release:
runs-on: ubuntu-latest
steps:
- name: report! options
shell: bash
run: |
echo devfast ${{ github.event.inputs.devfast }}
echo skimfast ${{ github.event.inputs.skimfast }}
echo qemuNoKVM ${{ github.event.inputs.qemuNoKVM }}
echo runnerName ${{ github.event.inputs.runnerName }}
- name: report! options
shell: bash
run: |
echo devfast ${{ inputs.devfast }}
echo skimfast ${{ inputs.skimfast }}
echo qemuNoKVM ${{ inputs.qemuNoKVM }}
echo runnerName ${{ inputs.runnerName }}
- name: report! API Rate Limit
shell: bash
run: |
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
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
- name: check! valid! inputs
if : ( ${{ github.event.inputs.runnerName != 'ubuntu-latest-l' }} && ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }} ) && ( ${{ github.event.inputs.qemuNoKVM == false }} )
shell: bash
run: |
echo FAIL: invalid inputs!
- name: check! valid! inputs
if : ( ${{ github.event.inputs.runnerName == 'ubuntu-latest-l' }} || ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }} ) && ( ${{ github.event.inputs.qemuNoKVM == true }} )
shell: bash
run: |
echo FAIL: SLOW inputs!
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: release! create
shell: bash
run: |
gh release create build-${{ github.run_id }}-${{ github.run_attempt }} --title build --notes ""
env:
GH_TOKEN: ${{ github.token }}
- name: report! API Rate Limit
shell: bash
run: |
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
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
build_installer:
needs: [build_release]
#runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-latest' || github.event.inputs.runnerName }}
#runs-on: 'ubuntu-latest'
runs-on: 'ubuntu-22.04'
steps:
- name: RAND_SEED
shell: bash
run: |
echo "$RAND_SEED" | tee /dev/urandom > /dev/null
echo "$RAND_SEED" | tee /dev/random > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null
env:
RAND_SEED: ${{ secrets.RAND_SEED }}
- name: report! API Rate Limit
shell: bash
run: |
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
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _getMinimal_cloud
shell: bash
timeout-minutes: 120
run: |
./ubiquitous_bash.sh _getMinimal_cloud
- name: _test_hash_legacy
shell: bash
run: |
if [[ -e "/etc/ssl/openssl_legacy.cnf" ]]
then
echo -n | env OPENSSL_CONF="/etc/ssl/openssl_legacy.cnf" openssl dgst -whirlpool -binary | xxd -p -c 256
exit ${PIPESTATUS[0]}
else
echo -n | openssl dgst -whirlpool -binary | xxd -p -c 256
exit ${PIPESTATUS[0]}
fi
- name: _getMinimal-build_ubDistBuild
shell: bash
timeout-minutes: 120
run: |
./ubiquitous_bash.sh _getMinimal-build_ubDistBuild
- name: build-fetch
shell: bash
timeout-minutes: 120
run: |
mkdir -p ../ubDistBuild-accessories/integrations/ubcp
curl -L -o ../ubDistBuild-accessories/integrations/ubcp/package_ubcp-core.7z $(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/mirage335-colossus/ubiquitous_bash/releases" | jq -r ".[] | select(.name == \"internal\") | .assets[] | select(.name == \"package_ubcp-core.7z\") | .browser_download_url" | sort -n -r | head -n1)
./ubiquitous_bash.sh _build_ubDistBuild-fetch
- name: build-build
shell: bash
timeout-minutes: 120
run: |
rm -f ../ubDistBuild-accessories/integrations/ubcp/package_ubcp-core.7z
./ubiquitous_bash.sh _build_ubDistBuild-build
- name: _hash_ubDistBuildExe
shell: bash
run: |
./ubiquitous_bash.sh _hash_ubDistBuildExe
- name: release!
shell: bash
run: |
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ../ubDistBuild.exe
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/_hash-ubDistBuildExe.txt
env:
GH_TOKEN: ${{ github.token }}
build_ingredient:
needs: [build_release]
runs-on: ubuntu-latest
steps:
- name: RAND_SEED
shell: bash
run: |
echo "$RAND_SEED" | tee /dev/urandom > /dev/null
echo "$RAND_SEED" | tee /dev/random > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null
env:
RAND_SEED: ${{ secrets.RAND_SEED }}
- name: _getCore_ub
shell: bash
run: |
mkdir -p ~/core/infrastructure
cd ~/core/infrastructure
git clone --depth 1 --recursive https://github.com/mirage335-colossus/ubiquitous_bash.git
cd ubiquitous_bash
./_setupUbiquitous.bat
./ubiquitous_bash.sh _custom_splice_opensslConfig
- uses: actions/checkout@v3
with:
submodules: recursive
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _getMinimal
shell: bash
run: |
if ! sudo -n env DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends -y gpg pigz curl gdisk lz4 mawk jq gawk build-essential autoconf pkg-config bsdutils findutils patch tar gzip bzip2 sed lua-lpeg axel aria2 gh rsync pv expect libfuse2 debootstrap dos2unix xxd debhelper p7zip btrfs-progs btrfs-compsize zstd zlib1g coreutils util-linux kpartx openssl udev gdisk parted bc e2fsprogs xz-utils libreadline8 squashfs-tools mtools dosfstools fdisk cloud-guest-utils
then
exit 1
fi
! sudo -n apt-get -y clean && exit 1
true
df -h
df -h /
timeout-minutes: 355
- name: _create_ingredientVM_image
shell: bash
run: |
# WARNING: Do NOT pass skimfast to this function during normal builds. ONLY export the skimfast variable in CI YAML scripts specifically for very rapid development/testing and NOT production use!
#export skimfast=${{ github.event.inputs.skimfast }}
./ubiquitous_bash.sh _create_ingredientVM_image
timeout-minutes: 355
- name: _create_ingredientVM_ubiquitous_bash-cp
shell: bash
run: |
./ubiquitous_bash.sh _create_ingredientVM_ubiquitous_bash-cp
timeout-minutes: 355
- name: _create_ingredientVM_online
shell: bash
run: |
# WARNING: Do NOT pass skimfast to this function during normal builds. ONLY export the skimfast variable in CI YAML scripts specifically for very rapid development/testing and NOT production use!
#export skimfast=${{ github.event.inputs.skimfast }}
./ubiquitous_bash.sh _create_ingredientVM_online
timeout-minutes: 355
- name: _create_ingredientVM_ubiquitous_bash-rm
shell: bash
run: |
./ubiquitous_bash.sh _create_ingredientVM_ubiquitous_bash-rm
timeout-minutes: 355
- name: _create_ingredientVM_zeroFill
shell: bash
run: |
./ubiquitous_bash.sh _create_ingredientVM_zeroFill
timeout-minutes: 355
- name: _package_ingredientVM
shell: bash
run: |
./ubiquitous_bash.sh _package_ingredientVM
timeout-minutes: 355
- name: _split_ingredientVM
shell: bash
run: |
./ubiquitous_bash.sh _split_ingredientVM
timeout-minutes: 355
- name: _create_ingredientVM_report
shell: bash
run: |
./ubiquitous_bash.sh _create_ingredientVM_report
timeout-minutes: 355
- name: release! ingredient! hash, reports
shell: bash
run: |
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/vm-ingredient.img.hash.txt
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/micro-dpkg.txt
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/micro-binReport.txt
env:
GH_TOKEN: ${{ github.token }}
- name: release! ingredient! package_ingredientVM
shell: bash
run: |
./ubiquitous_bash.sh _gh_release_upload_parts-multiple_sequence build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/vm-ingredient.img.flx.part*
env:
GH_TOKEN: ${{ github.token }}
build-analysis-ingredient:
needs: [build_ingredient, build_release]
runs-on: ubuntu-latest
steps:
- name: report! API Rate Limit
shell: bash
run: |
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
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'
- name: analysis! missing-binaries
shell: bash
run: |
#echo -n
_safeEcho() {
printf '%s' "$1"
shift
[[ "$@" == "" ]] && return 0
local currentArg
for currentArg in "$@"
do
printf '%s' " "
printf '%s' "$currentArg"
done
return 0
}
#echo
_safeEcho_newline() {
_safeEcho "$@"
printf '\n'
}
mkdir -p ./_local/analysis
#cp ./_local/micro-binReport.txt ./_local/analysis/micro-binReport.txt
#cp ./_local/micro-dpkg.txt ./_local/analysis/micro-dpkg.txt
cd ./_local/analysis
# Get the list of releases
RELEASES=$(curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/soaringDistributions/ubDistBuild/releases?per_page=100&page=1)
# Download micro-binReport.txt file for the current release
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-binReport-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/micro-binReport.txt"
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-dpkg-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/micro-dpkg.txt"
# Loop through each release
#for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r '.[].tag_name' | sort --reverse); do
for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r 'sort_by(.published_at) | reverse | .[].tag_name' | tr -dc 'a-zA-Z0-9\-_.:\n'); do
# Compare the list of binaries in this release to the current release
if [ "$RELEASE" != "$currentReleaseTag" ]; then
# Download the binReport file for this release
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-binReport-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/micro-binReport.txt"
curl -s -H "Authorization: token $GH_TOKEN" -L -o "micro-dpkg-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/micro-dpkg.txt"
echo | tee -a ./missing-micro-binReport.txt
echo "Binaries (filesystem) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-micro-binReport.txt
comm -23 <(sort "micro-binReport-$RELEASE") <(sort "micro-binReport-$currentReleaseTag") | tee -a ./missing-micro-binReport.txt
echo | tee -a ./missing-micro-dpkg.txt
echo "Binaries (dpkg) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-micro-dpkg.txt
comm -23 <(sort "micro-dpkg-$RELEASE") <(sort "micro-dpkg-$currentReleaseTag") | tee -a ./missing-micro-dpkg.txt
fi
done
env:
currentReleaseTag: build-${{ github.run_id }}-${{ github.run_attempt }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: release! analysis! missing-binaries
shell: bash
run: |
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-micro-binReport.txt
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-micro-dpkg.txt
env:
GH_TOKEN: ${{ github.token }}
build_beforeBoot:
needs: [build_release, build_ingredient]
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# '7 GB of RAM memory'
# '14 GB of SSD disk space'
# ATTRIBUTION: Github Copilot Chat 2023-08-10 .
#runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-latest' || github.event.inputs.runnerName }}
runs-on: ubuntu-latest
#runs-on: ubuntu-22.04
#runs-on: ubuntu-20.04
#runs-on: ubuntu-18.04
# Apparently both 'buildjet-2vcpu-ubuntu-2004' and 'buildjet-16vcpu-ubuntu-2004' have 61GB .
#runs-on: buildjet-2vcpu-ubuntu-2004
#runs-on: buildjet-16vcpu-ubuntu-2004
# https://github.com/easimon/maximize-build-space
steps:
- name: RAND_SEED
shell: bash
run: |
echo "$RAND_SEED" | tee /dev/urandom > /dev/null
echo "$RAND_SEED" | tee /dev/random > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null
echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null
env:
RAND_SEED: ${{ secrets.RAND_SEED }}
- name: users
shell: bash
run: |
sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true
sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true
sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true
true
# Apparently may increase buildJet 'runner' to 77GB (instead of 61GB).
# Apparently may increase Github Actions 'runner' to 59GB (instead of 31GB) .
- name: Maximize build space
#if: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 4125
#root-reserve-mb: 1625
temp-reserve-mb: 1950
#temp-reserve-mb: 50
swap-size-mb: 2
#remove-dotnet: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-dotnet: 'true'
#remove-android: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-android: 'true'
#remove-haskell: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-haskell: 'true'
#remove-codeql: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-codeql: 'true'
#remove-docker-images: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-docker-images: 'true'
# https://github.com/orgs/community/discussions/8305
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
# https://github.com/actions/runner-images/discussions/7191
- name: Enable KVM group perms
if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }}
shell: bash
run: |
#echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo -n tee /etc/udev/rules.d/99-kvm4all.rules
echo 'KERNEL=="kvm", GROUP="docker", MODE="0664", OPTIONS+="static_node=kvm"' | sudo -n tee /etc/udev/rules.d/99-kvm4all.rules
sudo -n udevadm control --reload-rules
sudo -n udevadm trigger --name-match=kvm
sudo -n apt-get update
sudo -n apt-get install -y libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu-user qemu-utils qemu-system-x86
sudo -n usermod -a -G kvm $USER
sudo -n usermod -a -G libvirt $USER
sudo -n usermod -a -G docker $USER
sudo -n adduser $USER kvm
#sudo -n chown -R $USER:kvm /dev/kvm
sudo -n chown -R $USER:docker /dev/kvm
ls -l /dev/kvm
ls -l /dev/kvm*
echo $USER
groups
sudo -n lsmod | grep kvm
sudo -n modprobe -r kvm_intel
sudo -n modprobe -r kvm_amd
sudo -n modprobe -r kvm
( grep --color vmx /proc/cpuinfo && sudo -n modprobe kvm_intel ) || ( grep --color svm /proc/cpuinfo && sudo -n modprobe kvm_amd )
sudo -n modprobe kvm
sudo -n lsmod | grep kvm
#sudo -n chown -R $USER:kvm /dev/kvm
sudo -n chown -R $USER:docker /dev/kvm
ls -l /dev/kvm
ls -l /dev/kvm*
- name: Check KVM group perms
if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }}
shell: bash
run: |
grep --color svm /proc/cpuinfo || true
grep --color vmx /proc/cpuinfo || true
sudo -n lsmod | grep kvm
ls -l /dev/kvm
ls -l /dev/kvm*
echo $USER
groups
- name: Check Network Services
if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }}
shell: bash
run: |
sudo -n netstat -l -p
- name: _getCore_ub
shell: bash
timeout-minutes: 90
run: |
mkdir -p ~/core/infrastructure
cd ~/core/infrastructure
git clone --depth 1 --recursive https://github.com/mirage335-colossus/ubiquitous_bash.git
cd ubiquitous_bash
./_setupUbiquitous.bat
- name: _getMinimal_cloud
shell: bash
run: |
! ~/core/infrastructure/ubiquitous_bash/ubiquitous_bash.sh _getMinimal_cloud && exit 1
true
#! sudo -n apt-get -y clean && exit 1
df -h
df -h /
timeout-minutes: 90
#- name: changeDisk
#shell: bash
#run: |
#false
- uses: actions/checkout@v3
with:
submodules: recursive
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _getMinimal_cloud
shell: bash
run: |
! ./ubiquitous_bash.sh _getMinimal_cloud && exit 1
true
#! sudo -n apt-get -y clean && exit 1
df -h
df -h /
timeout-minutes: 355
## For VBoxManage for _convert . Otherwise historically not apparently necessary.
#- name: _getMost_ubuntu24-VBoxManage
#shell: bash
#run: |
##! ./ubiquitous_bash.sh _getMost && exit 1
##true
##! sudo -n apt-get -y clean && exit 1
##! ./ubiquitous_bash.sh _getMost_debian11_aptSources && exit 1
##sudo -n apt-get update
##! sudo -n apt-get -d install -y virtualbox-7.0 && exit 1
#! sudo -n ./ubiquitous_bash.sh _getMost_ubuntu24-VBoxManage && exit 1
#df -h
#df -h /
#timeout-minutes: 355
- name: _getMost-xvfb
shell: bash
run: |
#! ./ubiquitous_bash.sh _getMost && exit 1
#true
#! sudo -n apt-get -y clean && exit 1
#! ./ubiquitous_bash.sh _getMost_debian11_aptSources && exit 1
#sudo -n apt-get update
#! sudo -n apt-get -d install -y virtualbox-7.0 && exit 1
#! sudo -n ./ubiquitous_bash.sh _getMost_ubuntu24-VBoxManage && exit 1
sudo -n env DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends -y xvfb
df -h
df -h /
timeout-minutes: 355
- name: _test_hash_legacy
shell: bash
run: |
if [[ -e "/etc/ssl/openssl_legacy.cnf" ]]
then
echo -n | env OPENSSL_CONF="/etc/ssl/openssl_legacy.cnf" openssl dgst -whirlpool -binary | xxd -p -c 256
exit ${PIPESTATUS[0]}
else
echo -n | openssl dgst -whirlpool -binary | xxd -p -c 256
exit ${PIPESTATUS[0]}
fi
#- name: _create_ubDistBuild
#shell: bash
#run: |
#./_create_ubDistBuild | sudo -n tee ./_local/_create_ubDistBuild.log
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _true
if: ${{ github.event.inputs.skimfast != 'true' }}
shell: bash
run: |
./_true | sudo -n tee ./_local/_true.log && exit ${PIPESTATUS[0]}
- name: _false
if: ${{ github.event.inputs.skimfast != 'true' }}
shell: bash
run: |
( ! ./_false ) | sudo -n tee ./_local/_false.log && exit ${PIPESTATUS[0]}
- name: lscpu
#if: ${{ github.event.inputs.skimfast != 'true' }}
shell: bash
run: |
lscpu
- name: cpuinfo
if: ${{ github.event.inputs.skimfast != 'true' }}
shell: bash
run: |
cat /proc/cpuinfo
- name: mem
if: ${{ github.event.inputs.skimfast != 'true' }}
shell: bash
run: |
free -m
- name: _get_ingredientVM
shell: bash
run: |
./ubiquitous_bash.sh _get_ingredientVM latest
env:
GH_TOKEN: ${{ github.token }}
- name: _create_ubDistBuild-create
shell: bash
run: |
export skimfast=${{ github.event.inputs.skimfast }}
echo $skimfast
export devfast=${{ github.event.inputs.devfast }}
echo $devfast
./_create_ubDistBuild-create | sudo -n tee ./_local/_create_ubDistBuild-create.log && exit ${PIPESTATUS[0]}
- name: _create_ubDistBuild-rotten_install
shell: bash
run: |
export skimfast=${{ github.event.inputs.skimfast }}
echo $skimfast
export devfast=${{ github.event.inputs.devfast }}
echo $devfast
./_create_ubDistBuild-rotten_install | sudo -n tee ./_local/_create_ubDistBuild-rotten_install.log && exit ${PIPESTATUS[0]}
- name: _chroot_test
shell: bash
run: |
export devfast=${{ github.event.inputs.devfast }}
echo $devfast
[[ "$devfast" == "" ]] && export devfast=true
./_chroot_test | sudo -n tee ./_local/_chroot_test.log && exit ${PIPESTATUS[0]}
#- name: Force KVM group perms
#if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }}
#shell: bash
#run: |
#sudo -n ls -l /dev/kvm
#sudo -n ls -l /dev/kvm*
#sudo -n chown -R $USER:docker /dev/kvm
#sudo -n chmod 664 /dev/kvm
#echo
##grep --color svm /proc/cpuinfo || true
##grep --color vmx /proc/cpuinfo || true
#sudo -n lsmod | grep kvm
#ls -l /dev/kvm
#ls -l /dev/kvm*
#echo $USER
#groups
#echo
#- name: _create_ubDistBuild-bootOnce
#shell: bash
#run: |
#export skimfast=${{ github.event.inputs.skimfast }}
#echo skimfast $skimfast
#export qemuNoKVM=${{ github.event.inputs.qemuNoKVM }}
#echo qemuNoKVM $qemuNoKVM
#echo
#./_create_ubDistBuild-bootOnce | sudo -n tee ./_local/_create_ubDistBuild-bootOnce.log && exit ${PIPESTATUS[0]}
- name: _fetchCore
shell: bash
run: |
cd _local
git clone https://github.com/soaringDistributions/ubDistFetch.git
cd ubDistFetch
./_ubDistFetch.bat | sudo -n tee ../../_lib/_ubDistFetch.log && exit ${PIPESTATUS[0]}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#- name: _fetchCore package
#shell: bash
#run: |
#cd _local/ubDistFetch
#export current_XZ_OPT_core="-0 -T0"
#./_ubDistFetch_package.bat | sudo -n tee ../_ubDistFetch_package.log && exit ${PIPESTATUS[0]}
- name: _create_ubDistBuild-rotten_install-core
shell: bash
run: |
./_create_ubDistBuild-rotten_install-core | sudo -n tee ./_create_ubDistBuild-rotten_install-core.log && exit ${PIPESTATUS[0]}
#env:
#GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DANGER: GitHub Actions ONLY!
- name: _fetchCore! rm
shell: bash
run: |
cd _local
rm -rf ubDistFetch
- name: _create_ubDistBuild-install-ubDistBuild
shell: bash
run: |
./_create_ubDistBuild-install-ubDistBuild | sudo -n tee ./_create_ubDistBuild-install-ubDistBuild.log && exit ${PIPESTATUS[0]}
- name: _unattended_enable
shell: bash
run: |
#! ./ubiquitous_bash.sh _openChRoot && exit 1
! ./ubiquitous_bash.sh _unattended_enable && exit 1
#! ./ubiquitous_bash.sh _closeChRoot && exit 1
true
- name: _build_fallback_staging-buildYML-build_beforeBoot
shell: bash
run: |
#! ./ubiquitous_bash.sh _openChRoot && exit 1
[[ -e _lib/_build-staging-ops.sh ]] && ! ./ubiquitous_bash.sh _build_fallback_staging-buildYML-build_beforeBoot && exit 1
#! ./ubiquitous_bash.sh _closeChRoot && exit 1
true
- name: scribe! info! github
shell: bash
run: |
! ./ubiquitous_bash.sh _openChRoot && exit 1
! echo ${{ github.repository }} | ./ubiquitous_bash.sh _chroot tee /info-github && exit 1
! echo build-${{ github.run_id }}-${{ github.run_attempt }} | ./ubiquitous_bash.sh _chroot tee -a /info-github && exit 1
! date +"%Y-%m-%d" | ./ubiquitous_bash.sh _chroot tee -a /info-github && exit 1
! ./ubiquitous_bash.sh _closeChRoot && exit 1
true
- name: Force KVM group perms
if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' }}
shell: bash
run: |
sudo -n ls -l /dev/kvm
sudo -n ls -l /dev/kvm*
sudo -n chown -R $USER:docker /dev/kvm
sudo -n chmod 664 /dev/kvm
echo
#grep --color svm /proc/cpuinfo || true
#grep --color vmx /proc/cpuinfo || true
sudo -n lsmod | grep kvm
ls -l /dev/kvm
ls -l /dev/kvm*
echo $USER
groups
echo
#- name: _create_ubDistBuild-bootOnce
#shell: bash
#run: |
#export skimfast=${{ github.event.inputs.skimfast }}
#echo skimfast $skimfast
#[[ "$skimfast" == "" ]] && export skimfast=true
#echo skimfast $skimfast
#export qemuNoKVM=${{ github.event.inputs.qemuNoKVM }}
##[[ "$qemuNoKVM" == "" ]] && export qemuNoKVM=true
#echo qemuNoKVM $qemuNoKVM
#echo
#./_create_ubDistBuild-bootOnce | sudo -n tee ./_local/_create_ubDistBuild-bootOnce.log && exit ${PIPESTATUS[0]}
- name: _hash_img
shell: bash
run: |
export skimfast=${{ github.event.inputs.skimfast }}
echo $skimfast
./ubiquitous_bash.sh _hash_img
- name: release! hash! beforeBoot
shell: bash
run: |
mv -f ./_local/_hash-ubdist.txt ./_local/_hash-ubdist_beforeBoot.txt
gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/_hash-ubdist_beforeBoot.txt
env:
GH_TOKEN: ${{ github.token }}
- name: _package_ubDistBuild_image
shell: bash
run: |
export skimfast=${{ github.event.inputs.skimfast }}
echo $skimfast
./ubiquitous_bash.sh _package_ubDistBuild_image | sudo -n tee ./_local/_package_ubDistBuild_image.log && exit ${PIPESTATUS[0]}
- name: _ubDistBuild_split_beforeBoot
shell: bash
run: |
./ubiquitous_bash.sh _ubDistBuild_split_beforeBoot | sudo -n tee ./_lib/_ubDistBuild_split.log && exit ${PIPESTATUS[0]}
timeout-minutes: 355
- name: df
shell: bash
run: |
df -h
df -h /
- name: release! package_image_beforeBoot
shell: bash
run: |
./ubiquitous_bash.sh _gh_release_upload_parts-multiple_sequence build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/package_image_beforeBoot.tar.flx.part*
##gh release create build-${{ github.run_id }}-${{ github.run_attempt }} --title build --notes ""
#bash -c '
#for currentFile in ./_local/package_image_beforeBoot.tar.flx.part*
#do
#./ubiquitous_bash.sh _stopwatch gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} "$currentFile" &
#while [[ $(jobs | wc -l) -ge 12 ]]
#do
#sleep 2
#done
#done
#wait
#'
env:
GH_TOKEN: ${{ github.token }}
#- name: _croc_ubDistBuild_image_out
#shell: bash
#run: |
#./ubiquitous_bash.sh _croc_ubDistBuild_image_out | sudo -n tee ./_lib/_croc_ubDistBuild_image_out.log
#timeout-minutes: 355
#- name: _package_rm
#shell: bash
#run: |
#./ubiquitous_bash.sh _package_rm
build-analysis-beforeBoot:
needs: [build_beforeBoot, build_release]
runs-on: ubuntu-latest
steps:
- name: report! API Rate Limit
shell: bash
run: |
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
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
- name: Maximize build space
#if: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 4125
#root-reserve-mb: 1625
temp-reserve-mb: 1950
#temp-reserve-mb: 50
swap-size-mb: 2
#remove-dotnet: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-dotnet: 'true'
#remove-android: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-android: 'true'
#remove-haskell: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-haskell: 'true'
#remove-codeql: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-codeql: 'true'
#remove-docker-images: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-docker-images: 'true'
- name: _getCore_ub
shell: bash
run: |
mkdir -p ~/core/infrastructure
cd ~/core/infrastructure
git clone --depth 1 --recursive https://github.com/mirage335-colossus/ubiquitous_bash.git
cd ubiquitous_bash
./_setupUbiquitous.bat
./ubiquitous_bash.sh _custom_splice_opensslConfig
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _getMinimal_cloud
shell: bash
run: |
! ./ubiquitous_bash.sh _getMinimal_cloud && exit 1
true
#! sudo -n apt-get -y clean && exit 1
df -h
df -h /
timeout-minutes: 355
- name: _getMost-aria2
shell: bash
run: |
sudo -n apt-get -y clean
sudo -n apt-get update
sudo -n env DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends -y aria2
timeout-minutes: 355
- name: _get_vmImg_beforeBoot_ubDistBuild
shell: bash
run: |
#export FORCE_AXEL=8
#./ubiquitous_bash.sh _get_vmImg_beforeBoot_ubDistBuild "latest"
# DANGER: Github Actions (strictly internal) ONLY!
#export FORCE_AXEL=8
export MANDATORY_HASH="true"
mkdir -p ./_local
cd ./_local
rm -f hash-download.txt
../ubiquitous_bash.sh _wget_githubRelease_join-stdout "soaringDistributions/ubDistBuild" "" "package_image_beforeBoot.tar.flx" 2> /dev/null | tee >(../ubiquitous_bash.sh _get_extract_ubDistBuild-tar --extract ./vm.img --to-stdout | env OPENSSL_CONF="/etc/ssl/openssl_legacy.cnf" openssl dgst -whirlpool -binary | xxd -p -c 256 > hash-download.txt) | ../ubiquitous_bash.sh _get_extract_ubDistBuild
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: _build_fallback_staging-buildYML-build
shell: bash
run: |
#! ./ubiquitous_bash.sh _openChRoot && exit 1
[[ -e _lib/_build-staging-ops.sh ]] && ! ./ubiquitous_bash.sh _build_fallback_staging-buildYML-build && exit 1
#! ./ubiquitous_bash.sh _closeChRoot && exit 1
true
#- name: fallocate --dig-holes
#shell: bash
#run: |
#fallocate --dig-holes ./_local/vm.img
#- name: _hash_img
#shell: bash
#run: |
#export skimfast=${{ github.event.inputs.skimfast }}
#echo $skimfast
##./ubiquitous_bash.sh _hash_img
#cat _local/hash-download.txt
- name: _zSpecial_report
shell: bash
continue-on-error: true
run: |
./ubiquitous_bash.sh _zSpecial_report
ls -l ./_local/grub.cfg
ls -l ./_local/grubenv
ls -l ./_local/dpkg
#ls -l ./_local/lsmodReport
ls -l ./_local/binReport
ls -l ./_local/coreReport