Commit Graph

25 Commits

Author SHA1 Message Date
Ricardo Pardini
484aac7df2 lib/tools/info: mapper-oci-uptodate: adapt to oras-py 0.2 api change 2025-04-12 20:06:13 +02:00
Ricardo Pardini
bf7f20776c cli: introduce inventory-boards cli command, for hopefully painless & useful one-board-per-line CSV output
- `inventory-boards-csv.py`: moar Python atrocities done to data; idea here is to output one line per board, with <<varies>> for fields that, well, vary (mainly across BRANCH'es)
- `inventory-boards` sets `TARGETS_FILE` to something that doesn't exist, so the `default-targets.yaml` is used (so same list for everyone, save for userpatched-boards)
2024-03-06 00:58:26 +01:00
Ricardo Pardini
35b4859b9c pipeline: parallel (threaded) mapper-oci-uptodate.py 2023-10-14 21:49:52 +02:00
Ricardo Pardini
ed39cb04fb pipeline: add hard 17*30 limit to number of total matrix jobs
- show size of each GHA output in logs
2023-10-13 20:13:10 +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
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
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
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