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

ypkg-install-deps: add --dry-run and --json #57

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GZGavinZhao
Copy link
Member

@GZGavinZhao GZGavinZhao commented Jan 15, 2024

The JSON dump has the following format:

[
{
    "name": "<package-name>",
    "version": "<version>",
    "release": "<relno>",
    "packageHash": "<hash-of-eopkg>",
}
]

This not only dumps every single (including transitive) dependencies, but also dumps the currently installed packages on the system. If we run this inside the solbuild chroot and run sudo eopkg up prior to running ypkg-install-deps --dry-run --json package.yml, we should get a (mostly) reproducible JSON of packages that the root is comprised of. If we cache this root identified by the hash of this JSON dump, we should be able to re-use this cached root in solbuild, eliminating most if not all the time needed for dependencies to install given that no dependency is changed.

@ReillyBrogan
Copy link
Contributor

Another approach, though I don't know how viable this is with ypkg and solbuild, is to install each package into a separate overlayfs layer. Then the individual package installations can be cached so you get even more savings.

@GZGavinZhao
Copy link
Member Author

The only problem I could think of with this approach is how do we deal with triggers. By caching the entire root, we also cache the result of all trigger runs.

The JSON dump has the following format:
```json
[
{
    "name": "<package-name>",
    "version": "<version>",
    "release": "<relno>",
    "packageHash": "<hash-of-eopkg>",
}
]
```

This not only dumps every single (including transitive) dependencies, but also
dumps the **currently installed** packages on the system. If we run this
inside the `solbuild` chroot and run `sudo eopkg up` prior to running `ypkg-
install-deps --dry-run --json package.yml`, we should get a (mostly)
reproducible JSON of packages that the root is comprised of. If we cache this
root identified by the hash of this JSON dump, we should be able to re-use
this cached root in `solbuild`, eliminating most if not all the time needed
for dependencies to install given that no dependency is changed.

Signed-off-by: Gavin Zhao <git@gzgz.dev>
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

Successfully merging this pull request may close these issues.

2 participants