Skip to content

config: runtime: base: python: make more generic #2909

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

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

a-wai
Copy link
Contributor

@a-wai a-wai commented Jun 19, 2025

The base python template was designed with post-checkout jobs (kbuild, kunit...) in mind and doesn't work too well with test or post-processing jobs due to the following issues:

  • it assumes we need the kernel source from the parent checkout node
  • it doesn't provide a way to retrieve arbitrary artifacts from a node or its parent
  • the _get_source() function doesn't allow specifying an arbitrary target folder to extract tarballs to

Ensure we only download/extract/cd to the kernel source if the current node is a child to a checkout node, otherwise let the job definition prepare its workspace as needed.

Also add a generic _get_artifact_url() for downloading arbitrary artifacts and make the existing _get_tarball_url() use it to avoid duplicating code.

Finally, add an optional path parameter to _get_source() so the job can specify the destination folder if needed.

Copy link
Contributor

@pawiecz pawiecz left a comment

Choose a reason for hiding this comment

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

LGTM

(I'd merge it but I don't have sufficient permissions in Core)

@a-wai
Copy link
Contributor Author

a-wai commented Jun 25, 2025

v2:

@a-wai a-wai force-pushed the generic-python-basejob-fixes branch 2 times, most recently from fc67eeb to 6b37a2e Compare June 26, 2025 10:38
Copy link
Contributor

@pawiecz pawiecz left a comment

Choose a reason for hiding this comment

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

v2 LGTM, thanks for addressing kunit as well!

The base `python` template was designed with post-checkout jobs
(`kbuild`, `kunit`...) in mind and doesn't work too well with test or
post-processing jobs due to the following issues:
* it assumes we need the kernel source from the parent `checkout` node
* it doesn't provide a way to retrieve arbitrary artifacts from a node
  or its parent
* the `_get_source()` function doesn't allow specifying an arbitrary
  target folder to extract tarballs to

Ensure we only download/extract/cd to the kernel source if the current
node is a `kbuild` one, otherwise let the job definition prepare its
workspace as needed. In order to make things easier to jobs needing to
work on the original kernel source, add a new `_get_kernel_source()` so
such jobs (e.g. kunit) need a single function call.

Also add a generic `_get_artifact_url()` for downloading arbitrary
artifacts and make the existing `_get_tarball_url()` use it to avoid
duplicating code.

Finally, add an optional `path` parameter to `_get_source()` so the job
can specify the destination folder if needed.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
@a-wai a-wai force-pushed the generic-python-basejob-fixes branch from 6b37a2e to 1d44234 Compare July 10, 2025 07:29
@JenySadadia JenySadadia added this pull request to the merge queue Jul 10, 2025
Merged via the queue into kernelci:main with commit dfc942f Jul 10, 2025
4 checks passed
@a-wai a-wai deleted the generic-python-basejob-fixes branch July 10, 2025 10:06
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.

3 participants