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

Add support for using artifacts from another Job #185

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fepitre
Copy link
Member

@fepitre fepitre commented Feb 26, 2025

Our usecase is for cross-compiling Windows tools

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 82.66667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 74.76%. Comparing base (0dab1bc) to head (b8e359d).

Files with missing lines Patch % Lines
qubesbuilder/config.py 75.00% 6 Missing ⚠️
qubesbuilder/plugins/__init__.py 85.71% 6 Missing ⚠️
qubesbuilder/plugins/fetch/__init__.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
+ Coverage   74.69%   74.76%   +0.07%     
==========================================
  Files          51       51              
  Lines        5865     5913      +48     
==========================================
+ Hits         4381     4421      +40     
- Misses       1484     1492       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fepitre fepitre force-pushed the needs branch 2 times, most recently from c8b3f84 to bbb0767 Compare February 26, 2025 16:07
README.md Outdated
@@ -859,3 +859,34 @@ For the `fetch` stage, the Qubes executor with disposable template `qubes-builde
For the `build` stage of `vm-fc42`, the Podman executor with container image `fedoraimg` will be used.
For the `sign` stage, the Qubes executor with disposable template `signing-access-dvm` will be used for both `vm-fc42` and `vm-jammy`
For the `prep` stage of `vm-jammy`, the Local executor with base directory `/some/path` will be used.

### Cross-compile Build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, cross-compile is something else, like building ARM binaries on X86. Better use different term, like cross-distribution dependencies

README.md Outdated

```yaml
components:
- installer-qubes-os:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installer-qubes-os-windows-tools? (and below too)

Comment on lines 625 to 628
if (
isinstance(stage, dict)
and next(iter(stage)) == stage_name
and isinstance(stage[stage_name], dict)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least some of this not matching should show a warning or even error. Otherwise it will be hard to find why it doesn't work if you make a typo (like extra - making it a list instead of dict).

Comment on lines +631 to +650
if all(
[
need.get("component", None),
need.get("distribution", None),
need.get("stage", None),
need.get("build", None),
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and same here - if some part is missing, at least log a warning why it's ignored

Comment on lines 334 to 349
copy_in.append(
(artifact, self.executor.get_dependencies_dir())
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should they all be copied together, or maybe better in separate subdirs? what if file names conflict (for example you declare QWT use vm-win10 and vm-win11 if that would exist)?

@marmarek marmarek mentioned this pull request Feb 26, 2025
@fepitre fepitre force-pushed the needs branch 5 times, most recently from 9593265 to 9c76892 Compare March 10, 2025 14:36
@fepitre fepitre force-pushed the needs branch 3 times, most recently from 4552148 to 39e023f Compare March 10, 2025 14:49
@marmarek
Copy link
Member

From CI logs:

yaml.representer.RepresenterError: ('cannot represent an object', PosixPath('/home/gitlab-runner/gitlab/github-i88pso6b/artifacts/components/python-qasync/0.23.0-2/vm-bookworm/prep/python-qasync_0.23.0-2+deb12u1.dsc'))

  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/build_deb/__init__.py", line 384, in run
    self.save_dist_artifacts_info(
  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/__init__.py", line 577, in save_dist_artifacts_info
    return self.save_artifacts_info(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/__init__.py", line 422, in save_artifacts_info
    raise PluginError(msg) from e
qubesbuilder.plugins.PluginError: python-qasync:debian-pkg_debian: Failed to write info for build stage.

Besides the error itself, I'd prefer to not use absolute paths in artifacts info. Specifically, relative to the relevant artifacts dir. So, in this example it would be just python-qasync_0.23.0-2+deb12u1.dsc. In case of rpm, if the rpm subdir is preserved, then for example:

files:
- rpm/qubes-core-dom0-4.3.17-1.126.fc41.noarch.rpm

@fepitre
Copy link
Member Author

fepitre commented Mar 11, 2025

From CI logs:

yaml.representer.RepresenterError: ('cannot represent an object', PosixPath('/home/gitlab-runner/gitlab/github-i88pso6b/artifacts/components/python-qasync/0.23.0-2/vm-bookworm/prep/python-qasync_0.23.0-2+deb12u1.dsc'))

  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/build_deb/__init__.py", line 384, in run
    self.save_dist_artifacts_info(
  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/__init__.py", line 577, in save_dist_artifacts_info
    return self.save_artifacts_info(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gitlab-runner/builds/QubesOS/qubes-builderv2/qubesbuilder/plugins/__init__.py", line 422, in save_artifacts_info
    raise PluginError(msg) from e
qubesbuilder.plugins.PluginError: python-qasync:debian-pkg_debian: Failed to write info for build stage.

Besides the error itself, I'd prefer to not use absolute paths in artifacts info. Specifically, relative to the relevant artifacts dir. So, in this example it would be just python-qasync_0.23.0-2+deb12u1.dsc. In case of rpm, if the rpm subdir is preserved, then for example:

files:
- rpm/qubes-core-dom0-4.3.17-1.126.fc41.noarch.rpm

I don't see where is it supposed to write absolute path, indeed this is not intended.

It allows to know what has been created by jobs.
@fepitre fepitre marked this pull request as ready for review March 11, 2025 17:03
@fepitre
Copy link
Member Author

fepitre commented Mar 11, 2025

Ok it should be good for review.

@fepitre
Copy link
Member Author

fepitre commented Mar 11, 2025

Maybe I should add yml checks of files I forgot that but it's definitively being used by the dependencies_03 test.

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