Commit Graph

87 Commits

Author SHA1 Message Date
Ricardo Pardini
1c5add5e51 don't break downloads if GITHUB_SOURCE is unset
- fixes f200587b86 from https://github.com/armbian/build/pull/5791
2023-10-10 20:25:53 +02:00
iysheng
f200587b86 Use GITHUB_SOURCE to accelerate download files from github 2023-10-08 16:45:00 +02:00
Ricardo Pardini
ef01d98347 patching: show auto-patch'ed in summary table (in blue); remove spurious warnings 2023-10-03 14:10:46 +02:00
Ricardo Pardini
a547d3b101 patching: show the patch number for multi-patch mbox files in summary table 2023-10-03 14:10:46 +02:00
Ricardo Pardini
50895a24ee patching: enhance the DT Makefile Autopatcher to work with armhf's new 6.5 subdir Makefiles as well as arm64
- arm64: one-rule-per-dtb
- arm32: single-rule, multi-dtb
2023-10-03 14:10:46 +02:00
Ricardo Pardini
9324d1ec82 pipeline: output-gha-matrix: add self_hosted (yes/no) and fetch_depth (0/1) (#5750)
```
# For each item in chunk, check if it is going to run in a GH-hosted runner or self-hosted, and set some matrix variables
# accordingly; self_hosted: yes/no, and more specifically, fetch_depth, which is 0 for self-hosted, and 1 for GH-hosted.
# The reasoning for this is that git clones are much faster if not shallow on self-hosted, but much slower on GH-hosted.
```

- `self_hosted` -> `shosted` for brevity in JSON matrix
- `fetch_depth` -> `fdepth` for brevity in JSON matrix
2023-09-29 16:55:09 +02:00
Ricardo Pardini
800d92045d tools: patching: don't rewrite auto-generated patches (eg, drivers) 2023-09-29 08:48:01 +02:00
Ricardo Pardini
d402092682 pipeline: use ncores * 4 for info gathering 2023-08-23 21:35:02 +02:00
Ricardo Pardini
274d394ab2 pipeline: handle exit_with_target_not_supported_error() (retcode 44) as warning and not error
- split errors and warnings into multiple lines, so a bit easier to see in the logs what the real error was
- also turn down a few spurious warnings to debugs
2023-08-23 21:35:02 +02:00
Ricardo Pardini
688e415832 pipeline: add userspace inventory capabilities
- digs into config/distributions and config/desktops for info
- this produces `output/info/all_userspace_inventory.json`
  - this is now passed down to the `targets-compositor` in `cli-jsoninfo`
- `targets-compositor` now accepts `userspace:` as `items-from-inventory`
- extra: add `targets-composed` CLI command, to stop after targets-compositor
2023-08-23 21:35:02 +02:00
Ricardo Pardini
bd5a577e40 pipeline: streamline output-debs-to-repo-json to pass down info and avoid parsing paths completely 2023-08-12 09:58:32 +02:00
Ricardo Pardini
4624b581da pipeline: force compositor to include REVISION= just like it already did for BETA=
- this way the prepare step's REVISION (possibly passed via CLI parameter) is always sovereign
2023-08-12 09:58:32 +02:00
Ricardo Pardini
a876d0f882 pipeline: output-debs-to-repo-json.py: adapt to new reversioned JSON info 2023-08-12 09:58:32 +02:00
Ricardo Pardini
0251d65b7a repo-reprepro.py: set -e & pipefail 2023-08-12 09:58:32 +02:00
Ricardo Pardini
ee3059eb2f pipeline: debs-to-repo-download is now done in parallel; default cores*2 limited to 16 or PARALLEL_DOWNLOADS_WORKERS
- also avoid log archiving during individual download jobs via SKIP_LOG_ARCHIVE=yes
- I've tested with PARALLEL_DOWNLOADS_WORKERS=16 and it saturates my gigabit link, ghcr.io is great at reads
- more than ~16-ish might be too much though
2023-07-27 21:32:19 +02:00
Ricardo Pardini
b92575381a pipeline: inventory all board vars; add not-eos-with-video; introduce TARGETS_FILTER_INCLUDE
> How to use:
>
> `./compile.sh inventory` - does just the board inventory; look for output in `output/info`
>
> `./compile.sh targets-dashboard` - does inventory, targets compositing, and images info; look for output in `output/info`, read the instructions output by the command if you want to load the OpenSearch dashboards.
>
> `./compile.sh targets` - does the full targets compositing and artifacts, look for output in `output/info`
>
> If you don't have a `userpatches/targets.yaml`, _one will be provided for you_ defaulting to Jammy minimal CLI
> and Jammy xfce desktop, for all boards in all branches. You can pass filters via `TARGETS_FILTER_INCLUDE=...` to narrow.
>

- board JSON inventory:
  - more generic regex parsing of variables from board files:
    - all top-level (non-indented) variables are parsed and included in the JSON board inventory
    - this allows us to add new variables to the board files without having to update the parser
    - variables can be bare, `export` or `declare -g`, but **_must_ be quoted** (single or double) and UPPER_CASE
  - some special treatment for certain variables:
    - `KERNEL_TARGET` is parsed as a _comma-separated_ list of valid BRANCH'es
    - `BOARD_MAINTAINER` is parsed as _space-separated_ list of valid maintainer GH usernames as `BOARD_MAINTAINERS: [...]` in the JSON
      - script complains if `BOARD_MAINTAINER` is not set in core boards. Empty is still allowed.
    - `HAS_VIDEO_OUTPUT="no"` causes `BOARD_HAS_VIDEO: false` in the JSON (for desktop-only inventorying, see below)
- introduce `not-eos-with-video` in `items-from-inventory` at the targets compositor
  - the same as `not-eos`, but with added `BOARD_HAS_VIDEO: true` filter, see above
- introduce `TARGETS_FILTER_INCLUDE` for targets compositor
  - this filters the targets _after_ compositing (but before getting image info), based on the board inventory data
  - it's a comma-separated list of `key:value` pairs, which are OR-ed together
  - new virtual info `BOARD_SLASH_BRANCH` post-compositing inventory for filtering of a specific BOARD/BRANCH combo (e.g. `odroidhc4/edge`)
  - some interesting possible filters:
    - `TARGETS_FILTER_INCLUDE="BOARD:odroidhc4"`: _only_ build a single board, all branches. JIRA [AR-1806]
    - `TARGETS_FILTER_INCLUDE="BOARD_SLASH_BRANCH:odroidhc4/current"`: _only_ build a single board/branch combo
    - `TARGETS_FILTER_INCLUDE="BOARD:odroidhc4,BOARD:odroidn2"`: _only_ build _two_ boards, all branches.
    - `TARGETS_FILTER_INCLUDE="BOARD_MAINTAINERS:rpardini"`: build all boards and branches where rpardini is a maintainer
    - `TARGETS_FILTER_INCLUDE="BOARDFAMILY:rockchip64"`: build all boards and branches in the rockchip64 family
  - image-info-only variables like `LINUXFAMILY` is **not** available for filtering at this stage
- rename `config/templates` `targets-all-cli.yaml` to `targets-default.yaml`
    - this is used when no `userpatches/targets.yaml` is found
    - new default includes all boards vs branches for non-EOS boards
        - also desktop for all boards that _don't_ have `HAS_VIDEO_OUTPUT='no``
- introduce simplified `targets-dashboard` CLI:
  - does only inventory, compositing, and image info, but not artifact reducing, etc.
  - ignore desktop builds in the OpenSearch indexer
  - update the OpenSearch Dashboards, including new information now available
- invert the logic used for `CLEAN_INFO` and `CLEAN_MATRIX`
    - defaults to `yes` now, so new users/CI don't get hit by stale caches by default
    - repo pipeline CLI stuff is usually run on saved/restored artifacts for `output/info`, so don't clean by default via the CLI
2023-07-26 15:15:02 +02:00
Igor Pecovnik
d56b56edbb Revert "armbian-desktop/aggregation: introduce DESKTOP_COMMON aggregation variant, where arch/config/appgroups are ignored; see #5439"
This reverts commit f952ae89fb.
2023-07-19 01:02:23 +02:00
Ricardo Pardini
f952ae89fb armbian-desktop/aggregation: introduce DESKTOP_COMMON aggregation variant, where arch/config/appgroups are ignored; see #5439 2023-07-18 14:20:44 +02:00
Ricardo Pardini
fe36951c9f patching: auto patchers: bare dts, bare overlays, DT Makefile 2023-06-13 12:29:52 +02:00
Ricardo Pardini
70a64a0415 patching: Patching Summary and Patching Failures tables using Python's Rich
- even Rich'er patch output by colorizing certain strings green/yellow/red
- BASE_GIT_TAG now very sneakily also accepts a branch name
- IMPORTANT: this includes: BREAKING CHANGE: patches failing to apply now break the build. fixes #4958
  - also break on legacy `process_patch_file()` failure, remove `EXIT_PATCHING_ERROR`
2023-06-13 12:29:52 +02:00
Ricardo Pardini
c44fbbf07c pipeline: download-debs: de-hardcode path to compile.sh for downloader 2023-06-12 10:47:01 +02:00
Ricardo Pardini
e9d114f0d0 pipeline: repo-reprepro: run clearvanished and check before adding to repo 2023-06-02 19:14:07 +02:00
Ricardo Pardini
c825966857 pipeline: targets-compositor: force variable BETA the same for all targets, reading from param/env passed to prepare/gha-matrix step
- this way it's consistent across all artifacts and images
- debs-to-repo-download: fix: use DEB_STORAGE instead of hardcoding output/debs (so BETA=yes works)

also:
- fix `Duplicate oci_target` message in mapper-oci-uptodate
2023-05-25 19:30:40 +02:00
Ricardo Pardini
eff56a7909 pipeline: debs-to-repo (v7, working with reprepro)
- pipeline: artifacts: use better description for artifacts (artifact_name+artifact_version instead of artifact_final_file_basename)
2023-05-16 20:09:47 +02:00
Ricardo Pardini
b7c659c0a9 pipeline: gha: fix IMAGES_ONLY_OUTDATED_ARTIFACTS and SKIP_IMAGES by exporting them so Python can see; tune logging 2023-05-09 10:04:57 +02:00
Ricardo Pardini
de8bbcec11 pipeline: correctly quote params passed over pure strings (eg in the GHA JSON matrixes) so values with spaces are not mangled 2023-05-04 16:08:11 +02:00
Ricardo Pardini
1b36bb63d7 bash_declare_parser: parse space-separated single-quoted array values correctly ('THIS=has space' is a single token, not two) 2023-05-04 16:08:11 +02:00
Ricardo Pardini
875960ddb7 aggregation: armbian_utils.parse_env_for_tokens() now actually does what it said on the box "split by whitespace, line breaks, commas, and semicolons"; add appgroups summary 2023-05-04 16:08:11 +02:00
Ricardo Pardini
23a2b34847 pipeline: add output-gha-workflow-template.py utility, for rendering GHA workflow YAML templates with chunks
- python-tools: add Jinja2. Incredible how we made it this far without it.
- output-gha-workflow-template: a double-templater, first runs jinja with a custom syntax, then "moar magic" to be useful for GHA
2023-05-03 07:49:53 +02:00
Ricardo Pardini
0aac5a4945 pipeline: targets-compositor: whole target can be enabled: no to quickly disable it (as if it wasn't there) 2023-05-03 07:49:53 +02:00
Ricardo Pardini
46cd0a2cfc pipeline: output-gha-matrix: directly GHA-output images-chunk-json-2, images-chunk-not-empty-2, images-chunk-size-2 and artifacts-xxx with no fake entry
- as alternative to the full output, this allows us to skip chunkjobs when they're empty, and hopefully makes GHA-JSON-parsing 10x faster
2023-05-03 07:49:53 +02:00
Ricardo Pardini
d6bdf4221e pipeline: output-gha-matrix: new input.pipeline.gha.runners in the targets.yaml for mapping GHA's runs_on based on name and arch 2023-05-03 07:49:53 +02:00
igorpecovnik
ba1a84a5e8 Adjusting ORAS cache location, runners (#5129)
* Move packages to new location
* Adjust build runners
* Switch to OS

Signed-off-by: Igor <igor@armbian.com>
---------

Signed-off-by: Igor <igor@armbian.com>
Co-authored-by: Ricardo Pardini <ricardo@pardini.net>
2023-05-02 11:08:34 +02:00
Ricardo Pardini
f8ddf7f9e2 🔥 JSON info pipeline: v18
- pipeline: add `pipeline` context object to targets; use it to filter artifacts and images to build; warn about oci-name with multiple oci-tags
- pipeline: better error messages when info's fail; show some (out-of-order) progress messages during parallel info gathering
- pipeline: targets-compositor: add `not-eos` inventory
- TARGETS_FILENAME, log all OCI lookups
- SKIP_IMAGES
- IMAGES_ONLY_OUTDATED_ARTIFACTS
- no dash in chunk id in JSON
- pipeline: very initial chunking, using the same outputs
- pipeline: template targets, `items-from-inventory:` inventory expansion, CHECK_OCI=yes, CLEAN_MATRIX=yes, CLEAN_INFO=yes, many fixes
- cli: `inventory` / `targets` / `matrix` / `workflow`
- pipeline: workflow beginnings
- pipeline: general log cleanup + OCI stats / better miss handling
- pipeline: fixes/reorg
- pipeline: catch & log JSON parsing errors
- pipeline: gha matrix: use IMAGE_FILE_ID as job description
- pipeline (delusion): gha workflow output, based on old matrix code
- pipeline: better parsing and reporting of stderr log lines (under `ANSI_COLOR=none`)
- pipeline: mapper-oci-uptodate: use separate positive/negative cache dirs (GHA will only cache positives); cache negs for 5 minutes locally
- pipeline: output-gha-matrix artifacts + images
  - pipeline: output-gha-matrix artifacts + images: "really" and fake 1-item matrix if empty
- pipeline: move files into subdir; update copyright & cleanup
- pipeline: refactor bash jsoninfo driver a bit
- pipeline: outdated-artifact-image-reducer
- pipeline: introduce `target_id` at the compositor, aggregate it at the reducer, carry it over in the artifact info mapper
- pipeline: mapper-oci-uptodate
- pipeline: info-gatherer-artifact, with PRE_PREPARED_HOST
- pipeline: refactor/rename info-gatherer-image.py
- pipeline: beginnings
2023-05-01 22:46:25 +02:00
Ricardo Pardini
22059c2669 lib: shellfmt & fix gen-library to match 2023-04-18 09:27:38 +02:00
Ricardo Pardini
e631e0fc97 patching: python: useful debug log with value of BASE_GIT_TAG 2023-04-15 22:43:06 +02:00
Ricardo Pardini
f75b9c110f aggregation: fix: don't eat value if empty during bash_string_multiline(); write end-of-file comment; show aggregation bash results if debugging 2023-03-31 09:12:44 +02:00
Ricardo Pardini
7d90b10f79 configdump: better logging; insert (still unsupported) array/dict raw value and 2do markers into produced dump JSON 2023-03-31 09:12:44 +02:00
Ricardo Pardini
42fc56697b configdump/json-info-boards: revamp, all-JSON now; use_board=yes skip_kernel=no for config; refactor & use new Python bash-declare-to-JSON utility
- use new capture'd vars scheme
- so `./compile.sh BOARD=xxx BRANCH=yyyy config-dump-json | jq .` now works and is consistent/newline tolerant
- introduce internal `skip_host_config=yes` for `prep_conf_main_minimal_ni()` to skip calling `check_basic_host()`
2023-03-31 09:12:44 +02:00
Ricardo Pardini
a13383143c lib/tools/shellcheck.sh: add (very low-bar "error") checks to config/sources and config/boards (keeping lib/ code in custom "critical" level) 2023-03-20 17:54:25 -03:00
Ricardo Pardini
6b965c605c completely remove any traces of KERNEL_ONLY and exit with error if set 2023-03-17 08:32:11 +01:00
Igor Pečovnik
d59fa58875 Add (c) also to python scripts (#4926) 2023-03-09 20:52:06 +01:00
Igor Pečovnik
b7b8eb7b72 Add / modify (c) in bash scripts (#4922)
* Add / modify (c) in bash scripts

Signed-off-by: Igor <igor@armbian.com>

* Add (c) to the source config files

---------

Signed-off-by: Igor <igor@armbian.com>
2023-03-09 18:30:40 +01:00
Ricardo Pardini
2f7423d0e4 shellfmt/.editorconfig: enable trim whitespaces, run shellfmt, no actual code changes (#4849)
- shellfmt: bump to 3.6.0 (run with `bash lib/tools/shellfmt.sh`)
- .editorconfig: rationalize, remove duplicated logic
2023-02-23 09:24:41 +01:00
Ricardo Pardini
49947ec373 armbian-next: aggregation: don't include packages.additional if BUILD_MINIMAL=yes 2023-02-18 07:45:58 -03:00
Ricardo Pardini
2767cf8fc2 armbian-next: shellcheck: raise the bar, stop excluding "SC2154 is referenced but not assigned" 2023-02-18 07:45:32 -03:00
Ricardo Pardini
010760fa92 armbian-next: shellcheck: raise the bar, stop excluding "SC2155 Declare and assign separately to avoid masking return values" 2023-02-18 07:45:30 -03:00
Ricardo Pardini
7d540d8a2e armbian-next: shellcheck: update, cleanup script, invent some new severities 2023-02-18 07:45:28 -03:00
Ricardo Pardini
1fc13a57a7 armbian-next: json-info: cleanup info/json/csv/opensearch, add logging, add some very basic instructions; add Kibana dashboards & docker-compose to bring it OS+Kibana up 2023-02-18 07:45:27 -03:00
Ricardo Pardini
e3a0f949e1 armbian-next: call-stack-analyze.py: detect missing function_to_file and stop properly (half-finished traces?) 2023-02-18 07:45:26 -03:00