feature: add PulpProject class for Pulp-based package repository support#2163
feature: add PulpProject class for Pulp-based package repository support#2163
PulpProject class for Pulp-based package repository support#2163Conversation
|
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. |
f60b0ef to
b2e5898
Compare
| cat > ~/.teuthology.yaml <<EOF | ||
| $archive_upload | ||
| use_shaman: false | ||
| use_artifacts: 'shaman' |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Maybe better to use artifacts_type instead?
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
| 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}' |
There was a problem hiding this comment.
| self.pulp_server_url = f'http://{config.artifacts_host}' | |
| self.pulp_server_url = f'https://{config.artifacts_host}' |
?
There was a problem hiding this comment.
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'] |
There was a problem hiding this comment.
| 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 |
This PR adds a
PulpProjectclass that extendsGitbuilderProjectso teuthology can use Pulp-hosted package repositories. It introduces new configuse_artifacts, set it topulp(globally in site config or per job) to use Pulp; other values keep the currentGitbuilderandShamanbehavior.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
PulpProjectinheriting fromGitbuilderProject._get_base_url()to use Pulp’s repository API._get_distro()for Pulp’s distro format._get_package_version()and_get_package_sha1()to read metadata from Pulp responses.get_builder_project()soconfig.use_artifacts == 'pulp'returnsPulpProject.siteconfig(and related docs) foruse_artifacts: 'pulp'andpulp_host.TestPulpProjecttoteuthology/test/test_packaging.py.