Skip to content

feature: add PulpProject class for Pulp-based package repository support#2163

Draft
vamahaja wants to merge 1 commit intoceph:mainfrom
vamahaja:pulp-project
Draft

feature: add PulpProject class for Pulp-based package repository support#2163
vamahaja wants to merge 1 commit intoceph:mainfrom
vamahaja:pulp-project

Conversation

@vamahaja
Copy link
Copy Markdown
Member

@vamahaja vamahaja commented Mar 26, 2026

This PR adds a PulpProject class that extends GitbuilderProject so teuthology can use Pulp-hosted package repositories. It introduces new config use_artifacts, set it to pulp (globally in site config or per job) to use Pulp; other values keep the current Gitbuilder and Shaman behavior.

Configuration

  • use_artifacts: 'pulp' - selects the Pulp backend (alongside existing 'shaman' and the default Gitbuilder path when unset / other values).
  • pulp_host — Pulp server hostname (documented in siteconfig.rst).

Key changes

  • Implement PulpProject inheriting from GitbuilderProject.
  • Override _get_base_url() to use Pulp’s repository API.
  • Override _get_distro() for Pulp’s distro format.
  • Override _get_package_version() and _get_package_sha1() to read metadata from Pulp responses.
  • Update get_builder_project() so config.use_artifacts == 'pulp' returns PulpProject.
  • Update siteconfig (and related docs) for use_artifacts: 'pulp' and pulp_host.
  • Add mock test TestPulpProject to teuthology/test/test_packaging.py.

@vamahaja vamahaja requested a review from a team as a code owner March 26, 2026 13:33
@vamahaja vamahaja requested review from VallariAg and kamoltat and removed request for a team March 26, 2026 13:33
@vamahaja vamahaja marked this pull request as draft March 26, 2026 13:34
@vamahaja vamahaja linked an issue Mar 26, 2026 that may be closed by this pull request
@deepssin deepssin requested review from amathuria, kshtsk and zmc March 27, 2026 04:15
@kshtsk
Copy link
Copy Markdown
Contributor

kshtsk commented Mar 27, 2026

This looks good, do we have an instance running with pulp to check this PR?

@vamahaja
Copy link
Copy Markdown
Member Author

This looks good, do we have an instance running with pulp to check this PR?

@kshtsk for review, I am working on deploying Pulp server on OCP cluster.

@vamahaja vamahaja force-pushed the pulp-project branch 5 times, most recently from f60b0ef to b2e5898 Compare April 7, 2026 09:19
cat > ~/.teuthology.yaml <<EOF
$archive_upload
use_shaman: false
use_artifacts: 'shaman'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The option use_shaman: false means that no shaman should be used. So if we switch to _use_artifacts, there should be None case to consider.

'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}',
'use_shaman': True,
'shaman_host': 'shaman.ceph.com',
'use_artifacts': 'shaman',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe better to use artifacts_type instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or even to match teuthology module name use: packaging_type?

'use_shaman': True,
'shaman_host': 'shaman.ceph.com',
'use_artifacts': 'shaman',
'artifacts_host': 'shaman.ceph.com',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest to start using endpoint URI instead of just hostname, so we have some kind of flexibility and avoid hardcoded paths, and for fast switch between artifacts type, maybe it is better to have api configuration separate:

shaman:
  endpoint: https://shaman.ceph.com/api
pulp:
  endpoint: http://pulp.example.com/pulp/api/v3

What do you think? And you @zmc?

Copy link
Copy Markdown
Member Author

@vamahaja vamahaja Apr 9, 2026

Choose a reason for hiding this comment

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

@zmc as discussed in weekly teuthology call, we can continue with below config -

artifacts:
  type: shaman | pulp
  endpoint: "https://<shaman|pulp>.ceph.com"
  username: <shaman|pulp>-username
  password: <shaman|pulp>-password

@kshtsk ^^^

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer to stay with separate service tool based config when it comes to authentication, like it is done for fog and maas:

packaging_type:  shaman | pulp | None
shaman:
  endpoint: https://shaman.ceph.com/api
  username: 
  password:
pulp:
  endpoint: http://pulp.example.com/pulp/api/v3
  username:
  password: 

Why it is better?
Easy switch between each other. Probable benefit from selecting artifact type using overrides.

…pport

Add a `PulpProject` subclass of `GitbuilderProject` so teuthology can use
Pulp-hosted package repos when `config.use_artifacts` is `pulp`, alongside
the existing `Gitbuilder` and `Shaman` artifact backends.

Signed-off-by: Vaibhav Mahajan <vamahaja@redhat.com>
Copy link
Copy Markdown
Member

@batrick batrick left a comment

Choose a reason for hiding this comment

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

Looking good!!

super(PulpProject, self).__init__(project, job_config, ctx, remote)

# Set the url for the pulp server.
self.pulp_server_url = f'http://{config.artifacts_host}'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
self.pulp_server_url = f'http://{config.artifacts_host}'
self.pulp_server_url = f'https://{config.artifacts_host}'

?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you need http:// for testing, use a config but default to https://.

# If the job has a 'use_artifacts' key, use that value to override the global
# config's 'use_artifacts' value.
if config.get('use_artifacts') is not None:
teuth_config.use_artifacts = config['use_artifacts']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
teuth_config.use_artifacts = config['use_artifacts']
teuth_config.use_artifacts = config['use_artifacts']
elif config.get('use_shaman') is not None:
# TODO: Add a logging warning about deprecation here
teuth_config.use_artifacts = 'shaman' if config['use_shaman'] else None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alternate package providers

3 participants