Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: auxdep annotations in autobuild.yaml #16

Open
ermo opened this issue Apr 26, 2024 · 3 comments
Open

RFE: auxdep annotations in autobuild.yaml #16

ermo opened this issue Apr 26, 2024 · 3 comments

Comments

@ermo
Copy link
Contributor

ermo commented Apr 26, 2024

To make it as easy as possible to port auxdeps to the actual moss-format recipes when that becomes an option, maybe it would be a good idea to use the same format for the solver/ignore format for autobuild, as that would then act as prototyping work for how to do it in moss-format?

Proposed format addition to autobuild.yaml:

solver:
  ignore:
  - git: { auxdep: "Used for including git ref in version info" }
  - doxygen: { auxdep: "docdep" }
  - python-nose: { auxdep: "checkdep" }

Then we can experiment with when to actually display the extra encoded information?

@ermo
Copy link
Contributor Author

ermo commented Apr 30, 2024

As a follow-up, the point about the format above is that it is similar enough to the existing format that it will be possible to be forward compatible by doing it like this for now:

solver:
  ignore:
  - git #: { auxdep: "Used for including git ref in version info" }
  - doxygen #: { auxdep: "docdep" }
  - python-nose #: { auxdep: "checkdep" }

ermo added a commit to getsolus/packages that referenced this issue May 1, 2024
**Summary**
This is the initial attempt at showing how to use the power of autobuild
for getting the Solus monorepo under control re. dependency cycles.

The purely additive nature of the autobuild.yml configuration files added
with this commit, should make it trivial to modify and extend the ignored
set of dependencies for a package as our cycle-discovery journey
advances.

To gain an appreciation of just how useful this tool might become for us,
consider the following:

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild -q query src:packages/ samba ldb tdb talloc tevent
talloc tdb cifs-utils notmuch tevent ldb samba acccheck ffmpeg \
python-pysmbc gvfs kio-extras kodi mpd rhythmbox vlc \
gnome-control-center nautilus-share nemo-extensions budgie-control-center
```

The above ^ shows how autobuild might resolve a build + rebuild order for
when someone is doing a samba stack upgrade and pushing it to a single
builder; like, say, the local packager's machine or the current Solus
build infrastructure, which is limited to one builder.

Note that autobuild also already supports committing+pushing to the Solus
builder, which implies that it can replace the current `build_pr.sh`
script in short order, if the the appetite to do so is present within
Solus as an organisation.

But that's not all!

In fact, `autobuild` also supports generating a "tiered" builder order
(notice the `-t` argument), which those of you packaging KDE might
already be familiar with:

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild query -t src:packages/ samba ldb tdb talloc tevent
 (.. some output omitted ..)
 🗸  Successfully parsed state!
 🗸  Found all requested packages in state!
 🗸  Successfully built dependency graph!
 🗸  Build order:
 🗸  Tier 1: talloc tdb
 🗸  Tier 2: cifs-utils notmuch tevent
 🗸  Tier 3: ldb
 🗸  Tier 4: samba
 🗸  Tier 5: acccheck ffmpeg python-pysmbc
 🗸  Tier 6: gvfs kio-extras kodi mpd rhythmbox vlc
 🗸  Tier 7: gnome-control-center nautilus-share nemo-extensions
 🗸  Tier 8: budgie-control-center
```

Tiers (called "Precedence Constraint Groups" in graph theory literature)
effectively show which packages can be built in parallel since they do
not interdepend on each other.

With the -q argument like above, this build order could potentially drive
a set of builders (like summit does in the Serpent infra currently):

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild -qt query src:packages/ samba ldb tdb talloc tevent
talloc tdb
cifs-utils notmuch tevent
ldb
samba
acccheck ffmpeg python-pysmbc
gvfs kio-extras kodi mpd rhythmbox vlc
budgie-control-center gnome-control-center nautilus-share nemo-extensions
```

I hope this serves to show how useful autobuild can potentially become
to Serpent and Solus in terms of automating the discovery of build and
rebuild orders.

This commit is mostly intended as a way to showcase what an autobuild-
driven packaging process might look like for Solus and Serpent, and as a
starting point for the discussion of how to tag "Auxiliary Dependencies"
in a way that's compatible with both the Solus and Serpent monorepos and
tooling.

See also: #2175 and #2176

autobuild.yaml format design notes here:

GZGavinZhao/autobuild#16

Massive props to @GZGavinZhao for his interest in studying the necessary
graph theory at my suggestion, and also for his being ready, able, and
willing to design and build this tool, and for his willingness to take on
board constructive feedback re. the documentation and UX necessary to
productise this solution for a wider audience of Solus staff and
community packagers.

Signed-off-by: Rune Morling <[email protected]>
ermo added a commit to getsolus/packages that referenced this issue May 1, 2024
**Summary**
This is the initial attempt at showing how to use the power of autobuild
for getting the Solus monorepo under control re. dependency cycles. It
is based on [this
gist](https://gist.github.com/GZGavinZhao/4981fb5ba874ac82364b18b039e3f495).

The purely additive nature of the autobuild.yml configuration files
added with this commit, should make it trivial to modify and extend the
ignored set of dependencies for a package as our cycle-discovery journey
advances.

To gain an appreciation of just how useful this tool might become for
us, consider the following:

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild -q query src:packages/ samba ldb tdb talloc tevent
talloc tdb cifs-utils notmuch tevent ldb samba acccheck ffmpeg python-pysmbc gvfs kio-extras kodi mpd rhythmbox vlc gnome-control-center nautilus-share nemo-extensions budgie-control-center
```

The above ^ shows how autobuild might resolve a build + rebuild order
for when someone is doing a samba stack upgrade and pushing it to a
single builder; like, say, the local packager's machine or the current
Solus build infrastructure, which is limited to one builder.

Note that autobuild also already supports committing+pushing to the
Solus builder, which implies that it can replace the current
`build_pr.sh` script in short order, if the the appetite to do so is
present within Solus as an organisation.

But that's not all!

In fact, `autobuild` also supports generating a "tiered" builder order
(notice the `-t` argument), which those of you packaging KDE might
already be familiar with:

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild query -t src:packages/ samba ldb tdb talloc tevent
 (.. some output omitted ..)
 🗸  Successfully parsed state!
 🗸  Found all requested packages in state!
 🗸  Successfully built dependency graph!
 🗸  Build order:
 🗸  Tier 1: talloc tdb
 🗸  Tier 2: cifs-utils notmuch tevent
 🗸  Tier 3: ldb
 🗸  Tier 4: samba
 🗸  Tier 5: acccheck ffmpeg python-pysmbc
 🗸  Tier 6: gvfs kio-extras kodi mpd rhythmbox vlc
 🗸  Tier 7: gnome-control-center nautilus-share nemo-extensions
 🗸  Tier 8: budgie-control-center
```

Tiers (called "Precedence Constraint Groups" in graph theory literature)
effectively show which packages can be built in parallel since they do
not interdepend on each other.

With the -q argument like above, this build order could potentially
drive a set of builders (like summit does in the Serpent infra
currently):

```
ermo@solbox:~/repos/getsolus/soluspkgs
$ autobuild -qt query src:packages/ samba ldb tdb talloc tevent
talloc tdb
cifs-utils notmuch tevent
ldb
samba
acccheck ffmpeg python-pysmbc
gvfs kio-extras kodi mpd rhythmbox vlc
budgie-control-center gnome-control-center nautilus-share nemo-extensions
```

I hope this serves to show how useful autobuild can potentially become
to Serpent and Solus in terms of automating the discovery of build and
rebuild orders.

This commit is mostly intended as a way to showcase what an
autobuild-driven packaging process might look like for Solus and
Serpent, and as a starting point for the discussion of how to tag
"Auxiliary Dependencies" in a way that's compatible with both the Solus
and Serpent monorepos and tooling.

See also: #2175 and #2176

autobuild.yaml format design notes here: GZGavinZhao/autobuild#16

Massive props to @GZGavinZhao for his interest in studying the necessary
graph theory at my suggestion, and also for his being ready, able, and
willing to design and build this tool, and for his willingness to take
on board constructive feedback re. the documentation and UX necessary to
productise this solution for a wider audience of Solus staff and
community packagers.
@silkeh
Copy link

silkeh commented Oct 25, 2024

I'm not sure what your proposal is trying to achieve: is it adding the fact that is't an auxdep , or trying to expose the reason behind the auxdep?

For the former I'd prefer a boolean, and for the latter an actual comment, as those are more flexible.
For example:

solver:
  ignore:
  # Used for including git ref in version info
  - git:
      auxdep: true
  # Docdep
  - doxygen:
      auxdep: true
  # checkdep
  - python-nose:
      auxdep: true

With comments:

solver:
  ignore:
  # Used for including git ref in version info
  - git #: {auxdep: true}
  # Docdep
  - doxygen #: {auxdep: true}
  # checkdep
  - python-nose #: {auxdep: true}

Note that comments are available in most YAML parsers if desired.

@ermo
Copy link
Contributor Author

ermo commented Oct 25, 2024

@silkeh: I'm not sure what your proposal is trying to achieve: is it adding the fact that it's an auxdep , or trying to expose the reason behind the auxdep?

Both.

From what I remember when writing this, the idea is to use autobuild to develop an annotation syntax that can, at some point, be used directly in stone.yaml recipes, so we don't need to drop-in autobuild.yaml files everywhere. However, we figured that it would be better to first experiment with what "useful annotation syntax" looks like in an external file.

When used directly in the recipe, having the ability to "tag" deps with a reason for the tag could be useful for both packagers/maintainers and for showing the tags when wanting to introspect resolver decisions with higher-than-default verbosity.

If you have standardised tag keys (in this case auxdep), then you can search for these keys with a YAML parser and then look for specific predefined values for either functional or statistical purposes (e.g. "checkdep" or "docdep").

It is not out of the realm of possibility that you would want to be able to specify multiple tags if you discover that this is useful, hence the { key: "what/why" } format:

Example:

- somedep
  auxdep: "checkdep"
  option: "slow_tests"
  comment: "This increases build times tenfold. Do not enable the mentioned options unless you want the parent build to take slightly longer than forever."

This should be understood in the context of serpent's "up front" / "dry-run" informational paradigm, where you are told/shown in advance what a build will require and why, rather than having to endure a full build to understand the consequences of selection options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants