Giter Club home page Giter Club logo

pulpcore's Introduction

Acquire, Organize, and Distribute Software

Pulp is a platform for managing repositories of content, such as software packages, and pushing that content out to large numbers of consumers.

Using Pulp you can:

  • Locally mirror all or part of a repository
  • Host your own content in a new repository
  • Manage content from multiple sources in one place
  • Promote content through different repos in an organized way

Pulp is completely free and open-source!

For more information, check out the project website: https://pulpproject.org

Get Help

Check out our help page for ways to get help:

https://pulpproject.org/help/

pulpcore's People

Contributors

asmacdo avatar barnabycourt avatar beav avatar bmbouter avatar daviddavis avatar dependabot-preview[bot] avatar dependabot[bot] avatar dkliban avatar dralley avatar fao89 avatar fdobrovolny avatar gerrod3 avatar ggainey avatar goosemania avatar ipanova avatar jeremycline avatar jlconnor avatar jortel avatar jwmatthews avatar lubosmj avatar mdellweg avatar mhrivnak avatar mikedep333 avatar pavelpicka avatar pcreech avatar pkilambi avatar pulpbot avatar seandst avatar slagle avatar werwty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulpcore's Issues

Add documentation for Exporter plugins

Author: [email protected] ([email protected])

Redmine Issue: 3346, https://pulp.plan.io/issues/3346


Exporters should be documented separately from the other objects because in many cases, they will exist in their own isolated plugin.

For example a filesystem exporter would need to be its own plugin because writing publications to a filesystem is a general need and can be done for any content type.

This documentation should explain how to implement the Exporter Model, Viewset, and Serializer. It should also explain how to use the plugin template to create an Exporter plugin. (The template will include unnecessary objects, like an Importer.)

Verify PublishedArtifact content serve from PublicationDistribution

Author: @bmbouter (bmbouter)

Redmine Issue: 4861, https://pulp.plan.io/issues/4861


The only plugin I know that uses PublishedArtifact is pulp_deb as highligted by @mdellweg here: https://www.redhat.com/archives/pulp-dev/2019-May/msg00029.html

That plugin could be used to verify that the Pulp Content app is able to serve PublishedArtifact objects that are reachable by their relative paths. To test this:

1. Install the pulp_deb plugin
2. Create a repo, a remote, and sync some content to create a repository version that has some Debian content in it
3. Create a publication of that RepositoryVersion (this will create the PublishedArtifact)
4. Create a Distribution that exposes that the publication created in step 3
5. Fetch a PublishedArtifact by its relative_url and verify that the binary data is correctly delivered.

Document maximum web request size (limiting add/remove for single repository version)

Author: @jlsherrill ([email protected])

Redmine Issue: 4991, https://pulp.plan.io/issues/4991


When creating a new repository version (i tested with file repos), if i specify upwards of 70,000 units to add, the request will fail. This is likely due to webserver limitations for the request size. a json array of 70,000 hrefs was about 4MB

We've worked around the problem by simply creating multiple versions each adding about 10K units

Test support to handle pagination for tags/list endpoint during sync

Author: kersom (kersom)

Redmine Issue: 4755, https://pulp.plan.io/issues/4755


During sync we query list of tags present in the repo.

Pagination support is available for Tags API, we need update our sync code to cope with this change.
We'd need to check the `Link` header if it is present in the response headers.
For more docs check [0]
For Pulp2 implementation check [1]


1st request:
$ curl -i https://quay.io/v2/coreos/etcd/tags/list
HTTP/2 200 
server: nginx/1.14.0
date: Fri, 31 Aug 2018 13:13:56 GMT
content-type: application/json
content-length: 602
link: </v2/coreos/etcd/tags/list?next_page=gAAAAABbiT8UvBiyJvd3H5d7FS3azkmxqQuknl_2kKlKkbLpj_vGL_xv26HMBevZIVKY67vwpbKUo_Zact9vC6mjFd9KHGFGpkUHGc2jqGtd5aWpGbaIfqA%3D&n=50>; rel="next"
x-frame-options: DENY
strict-transport-security: max-age=63072000; preload

{"name":"coreos/etcd","tags":["v0.4.6","v0.5.0_alpha.0","v0.5.0_alpha.1","v0.5.0_alpha.2","v0.5.0_alpha.3","test","v0.5.0_alpha.4","v0.5.0_alpha.5","v2.0.0_rc.1","v2.0.0","v2.0.3","v2.0.4","v2.0.5","v0.4.8","v2.0.6","v2.0.7","v2.0.8","v2.0.9","v2.0.10","v2.1.0-alpha.0","v2.0.11","v2.0.12","v2.1.0-alpha.1","v2.0.13","v2.1.0-rc.0","v2.1.1","v2.2.0-alpha.0","v2.2.0-alpha.1","v2.1.2","v2.2.0-rc.0","v2.1.3","v2.2.0","v2.2.1","v2.3.0-alpha.0","v2.2.2","v2.2.3","v2.2.4","v2.2.5","v2.3.0-alpha.1","v2.3.0","v2.3.1","v2.3.2","v2.3.3","v3.0.0-beta.0","v2.3.4","v2.3.5","v2.3.6","v2.3.7","v3.0.0","v3.0.1"]}

2. check if Link is present. Then follow it until the Link disappears from the headers

$ curl -i 'https://quay.io/v2/coreos/etcd/tags/list?next_page=gAAAAABbiT8UvBiyJvd3H5d7FS3azkmxqQuknl_2kKlKkbLpj_vGL_xv26HMBevZIVKY67vwpbKUo_Zact9vC6mjFd9KHGFGpkUHGc2jqGtd5aWpGbaIfqA%3D&n=50'
HTTP/2 200 
server: nginx/1.14.0
date: Fri, 31 Aug 2018 13:15:36 GMT
content-type: application/json
content-length: 623
link: </v2/coreos/etcd/tags/list?next_page=gAAAAABbiT94xBPZc4VUD9_hx1bmHtfl1Xduxm811b1m06WiwW2mOHErnpkbtZ7Ag7ehYVPVAf3LfS2s-FVSrkCXhUqNLoduaGJaBorCUzp7NPlybCickC8%3D&n=50>; rel="next"
x-frame-options: DENY
strict-transport-security: max-age=63072000; preload

{"name":"coreos/etcd","tags":["v3.0.2","v3.0.3","v3.0.4","v3.0.5","v3.0.6","v3.0.7","v3.0.8","v3.0.9","v3.1.0-alpha.0","v3.0.10","v3.1.0-alpha.1","v3.0.11","v3.0.12","v3.1.0-rc.0","v3.0.13","v3.0.14","v3.0.15","v3.1.0-rc.1","v3.0.16","v3.0.17","v3.1.0","v2.3.8","v3.1.1","v3.1.2","v3.1.3","v3.1.4","v3.1.5","v3.1.6","v3.1.7","v3.2.0-rc.0","v3.2.0-rc.0-arm64","v3.2.0-rc.0-ppc64le","v3.1.8","v3.2.0-rc.1","v3.2.0-rc.1-arm64","v3.2.0-rc.1-ppc64le","v3.1.9","v3.2.0","v3.2.0-ppc64le","v3.2.1","v3.2.1-arm64","v3.2.1-ppc64le","v3.2.2","v3.2.2-arm64","v3.2.2-ppc64le","v3.0","v3.1.10","v3.2.3","v3.2.3-arm64","v3.2.3-ppc64le"]}

NOTE if registry does not support pagination, the Link header will be absent.
[0] https://docs.docker.com/registry/spec/api/#listing-image-tags
[1] pulp/pulp_docker#262

Notes from triage:
Sync from quay should do it.

Unable to sync using SSL certs from distribution with cert-guards

Author: kersom (kersom)

Redmine Issue: 5352, https://pulp.plan.io/issues/5352


This issue was identified when attempting to write a test for 5036.

Step 5 from previous issue - Create distribution that is associated with the publication and the content
guard.

{'_created': '2019-08-26T18:47:15.979945Z',
 '_href': '/pulp/api/v3/distributions/file/file/e0af98c8-4021-4cac-8ad5-f5f22b0e3a2f/',
 'base_path': '5a5c0aa7-5fad-4ccd-98d0-1ccd3018fde3',
 'base_url': '192.168.122.20:24816/pulp/content/5a5c0aa7-5fad-4ccd-98d0-1ccd3018fde3',
 'content_guard': '/pulp/api/v3/contentguards/certguard/x509/2f0bebd8-7bdc-4246-908e-df1c81c86446/',
 'name': '7f68db57-dbf9-4206-9d2a-0a576a88f7ef',
 'publication': '/pulp/api/v3/publications/file/file/61088b19-d532-4654-952e-3aae03791904/'}

Step 7 - Create a remote that has a URL pointing at the Distribution from step 5 and uses the client certificate for the content guard

{'_created': '2019-08-26T18:47:18.151877Z',
 '_href': '/pulp/api/v3/remotes/file/file/cd59f8e8-bcfc-4ccc-bf7f-c1283dbb5980/',
 '_last_updated': '2019-08-26T18:47:18.151893Z',
 '_type': 'file.file',
 'download_concurrency': 20,
 'name': 'e1701534-cd9c-490f-8bd9-09ba09d6aa87',
 'policy': 'immediate',
 'proxy_url': None,
 'ssl_ca_certificate': None,
 'ssl_client_certificate': '01778bb586f4ab226ea42d2b4ae61f14bb907907c970f9ee4abce87598d0070e',
 'ssl_client_key': '1e6a65695ff54b2fc6713dea7aa779e77819a39bba525af234ed965b2ff553b7',
 'ssl_validation': True,
 'url': 'http://192.168.122.20:24816/pulp/content/5a5c0aa7-5fad-4ccd-98d0-1ccd3018fde3/PULP_MANIFEST'}

First case scenario - ssl_client_certificate, and ssl_client_key line characters not escaped.

Create another repository, and attempt to sync using the previous remote.

Traceback:

('Task report /pulp/api/v3/tasks/84688488-9894-4267-8c15-f633e473c6fa/ '
 "contains a error: {'code': None, 'description': '[SSL] PEM lib "
 "(_ssl.c:3824)', 'traceback': '  File "
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 822, '
 'in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 611, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 45, in synchronize\\n    dv.create()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
 'line 169, in create\\n    loop.run_until_complete(pipeline)\\n  File '
 '"/usr/lib64/python3.7/asyncio/base_events.py", line 584, in '
 'run_until_complete\\n    return future.result()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 209, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 43, in __call__\\n    await self.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 72, in run\\n    downloader = '
 'self.remote.get_downloader(url=self.remote.url)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
 'line 88, in get_downloader\\n    return self.download_factory.build(url, '
 '**kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
 'line 46, in download_factory\\n    self._download_factory = '
 'DownloaderFactory(self)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
 'line 67, in __init__\\n    self._session = '
 'self._make_aiohttp_session_from_remote()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
 "line 96, in _make_aiohttp_session_from_remote\\n    key_file.name\\n'}\n"
 "Full task report: {'_href': "
 "'/pulp/api/v3/tasks/84688488-9894-4267-8c15-f633e473c6fa/', '_created': "
 "'2019-08-26T18:48:55.120887Z', 'state': 'failed', 'name': "
 "'pulp_file.app.tasks.synchronizing.synchronize', 'started_at': "
 "'2019-08-26T18:48:55.222028Z', 'finished_at': '2019-08-26T18:48:55.344024Z', "
 "'non_fatal_errors': [], 'error': {'code': None, 'description': '[SSL] PEM "
 "lib (_ssl.c:3824)', 'traceback': '  File "
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 822, '
 'in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 611, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 45, in synchronize\\n    dv.create()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
 'line 169, in create\\n    loop.run_until_complete(pipeline)\\n  File '
 '"/usr/lib64/python3.7/asyncio/base_events.py", line 584, in '
 'run_until_complete\\n    return future.result()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 209, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 43, in __call__\\n    await self.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 72, in run\\n    downloader = '
 'self.remote.get_downloader(url=self.remote.url)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
 'line 88, in get_downloader\\n    return self.download_factory.build(url, '
 '**kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
 'line 46, in download_factory\\n    self._download_factory = '
 'DownloaderFactory(self)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
 'line 67, in __init__\\n    self._session = '
 'self._make_aiohttp_session_from_remote()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
 "line 96, in _make_aiohttp_session_from_remote\\n    key_file.name\\n'}, "
 "'worker': '/pulp/api/v3/workers/96dd332f-92d4-4ef7-b29e-d6c868da254e/', "
 "'parent': None, 'spawned_tasks': [], 'progress_reports': [{'message': "
 "'Downloading Metadata', 'state': 'failed', 'total': None, 'done': 0, "
 "'suffix': None}, {'message': 'Downloading Artifacts', 'state': 'canceled', "
 "'total': None, 'done': 0, 'suffix': None}, {'message': 'Associating "
 "Content', 'state': 'canceled', 'total': None, 'done': 0, 'suffix': None}], "
 "'created_resources': [], 'reserved_resources_record': "
 "['/pulp/api/v3/remotes/file/file/cd59f8e8-bcfc-4ccc-bf7f-c1283dbb5980/', "
 "'/pulp/api/v3/repositories/c1fa9bae-7a17-41bc-b142-156c6ed2a69a/']}",
 {'_created': '2019-08-26T18:48:55.120887Z',
  '_href': '/pulp/api/v3/tasks/84688488-9894-4267-8c15-f633e473c6fa/',
  'created_resources': [],
  'error': {'code': None,
            'description': '[SSL] PEM lib (_ssl.c:3824)',
            'traceback': '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", '
                         'line 822, in perform_job\n'
                         '    rv = job.perform()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 605, in perform\n'
                         '    self._result = self._execute()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 611, in _execute\n'
                         '    return self.func(*self.args, **self.kwargs)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
                         'line 45, in synchronize\n'
                         '    dv.create()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
                         'line 169, in create\n'
                         '    loop.run_until_complete(pipeline)\n'
                         '  File '
                         '"/usr/lib64/python3.7/asyncio/base_events.py", line '
                         '584, in run_until_complete\n'
                         '    return future.result()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
                         'line 209, in create_pipeline\n'
                         '    await asyncio.gather(*futures)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
                         'line 43, in __call__\n'
                         '    await self.run()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
                         'line 72, in run\n'
                         '    downloader = '
                         'self.remote.get_downloader(url=self.remote.url)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
                         'line 88, in get_downloader\n'
                         '    return self.download_factory.build(url, '
                         '**kwargs)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/models/remote.py", '
                         'line 46, in download_factory\n'
                         '    self._download_factory = '
                         'DownloaderFactory(self)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
                         'line 67, in __init__\n'
                         '    self._session = '
                         'self._make_aiohttp_session_from_remote()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/factory.py", '
                         'line 96, in _make_aiohttp_session_from_remote\n'
                         '    key_file.name\n'},
  'finished_at': '2019-08-26T18:48:55.344024Z',
  'name': 'pulp_file.app.tasks.synchronizing.synchronize',
  'non_fatal_errors': [],
  'parent': None,
  'progress_reports': [{'done': 0,
                        'message': 'Downloading Metadata',
                        'state': 'failed',
                        'suffix': None,
                        'total': None},
                       {'done': 0,
                        'message': 'Downloading Artifacts',
                        'state': 'canceled',
                        'suffix': None,
                        'total': None},
                       {'done': 0,
                        'message': 'Associating Content',
                        'state': 'canceled',
                        'suffix': None,
                        'total': None}],
  'reserved_resources_record': ['/pulp/api/v3/remotes/file/file/cd59f8e8-bcfc-4ccc-bf7f-c1283dbb5980/',
                                '/pulp/api/v3/repositories/c1fa9bae-7a17-41bc-b142-156c6ed2a69a/'],
  'spawned_tasks': [],
  'started_at': '2019-08-26T18:48:55.222028Z',
  'state': 'failed',
  'worker': '/pulp/api/v3/workers/96dd332f-92d4-4ef7-b29e-d6c868da254e/'})

Second case scenario - ssl_client_certificate, and ssl_client_key line characters escaped.

Traceback:

('Task report /pulp/api/v3/tasks/a5cda2f6-7717-402a-9440-120f8c6926a8/ '
 "contains a error: {'code': None, 'description': '403, message=\\'\\'HTTP "
 'header "SSL-CLIENT-CERTIFICATE" not found.\\\'\\\'\', \'traceback\': \'  '
 'File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line '
 '822, in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 611, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 45, in synchronize\\n    dv.create()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
 'line 169, in create\\n    loop.run_until_complete(pipeline)\\n  File '
 '"/usr/lib64/python3.7/asyncio/base_events.py", line 584, in '
 'run_until_complete\\n    return future.result()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 209, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 43, in __call__\\n    await self.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 73, in run\\n    result = await downloader.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/base.py", '
 'line 212, in run\\n    return await self._run(extra_data=extra_data)\\n  '
 'File "/usr/local/lib/pulp/lib64/python3.7/site-packages/backoff/_async.py", '
 'line 131, in retry\\n    ret = await target(*args, **kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/http.py", '
 'line 183, in _run\\n    response.raise_for_status()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/aiohttp/client_reqrep.py", '
 "line 942, in raise_for_status\\n    headers=self.headers)\\n'}\n"
 "Full task report: {'_href': "
 "'/pulp/api/v3/tasks/a5cda2f6-7717-402a-9440-120f8c6926a8/', '_created': "
 "'2019-08-26T18:53:33.784600Z', 'state': 'failed', 'name': "
 "'pulp_file.app.tasks.synchronizing.synchronize', 'started_at': "
 "'2019-08-26T18:53:33.890968Z', 'finished_at': '2019-08-26T18:53:34.022794Z', "
 "'non_fatal_errors': [], 'error': {'code': None, 'description': '403, "
 'message=\\\'\\\'HTTP header "SSL-CLIENT-CERTIFICATE" not found.\\\'\\\'\', '
 "'traceback': '  File "
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 822, '
 'in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 611, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 45, in synchronize\\n    dv.create()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
 'line 169, in create\\n    loop.run_until_complete(pipeline)\\n  File '
 '"/usr/lib64/python3.7/asyncio/base_events.py", line 584, in '
 'run_until_complete\\n    return future.result()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 209, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
 'line 43, in __call__\\n    await self.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
 'line 73, in run\\n    result = await downloader.run()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/base.py", '
 'line 212, in run\\n    return await self._run(extra_data=extra_data)\\n  '
 'File "/usr/local/lib/pulp/lib64/python3.7/site-packages/backoff/_async.py", '
 'line 131, in retry\\n    ret = await target(*args, **kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/http.py", '
 'line 183, in _run\\n    response.raise_for_status()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/aiohttp/client_reqrep.py", '
 "line 942, in raise_for_status\\n    headers=self.headers)\\n'}, 'worker': "
 "'/pulp/api/v3/workers/9b793a30-2911-46f8-95e6-e35f19650c03/', 'parent': "
 "None, 'spawned_tasks': [], 'progress_reports': [{'message': 'Downloading "
 "Metadata', 'state': 'failed', 'total': None, 'done': 0, 'suffix': None}, "
 "{'message': 'Downloading Artifacts', 'state': 'canceled', 'total': None, "
 "'done': 0, 'suffix': None}, {'message': 'Associating Content', 'state': "
 "'canceled', 'total': None, 'done': 0, 'suffix': None}], 'created_resources': "
 "[], 'reserved_resources_record': "
 "['/pulp/api/v3/repositories/53654e44-790d-482d-b07a-ef5192a921e1/', "
 "'/pulp/api/v3/remotes/file/file/022b9887-e8c9-4e71-9750-68769e847372/']}",
 {'_created': '2019-08-26T18:53:33.784600Z',
  '_href': '/pulp/api/v3/tasks/a5cda2f6-7717-402a-9440-120f8c6926a8/',
  'created_resources': [],
  'error': {'code': None,
            'description': "403, message=''HTTP header "
                           '"SSL-CLIENT-CERTIFICATE" not found.\'\'',
            'traceback': '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", '
                         'line 822, in perform_job\n'
                         '    rv = job.perform()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 605, in perform\n'
                         '    self._result = self._execute()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 611, in _execute\n'
                         '    return self.func(*self.args, **self.kwargs)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
                         'line 45, in synchronize\n'
                         '    dv.create()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/declarative_version.py", '
                         'line 169, in create\n'
                         '    loop.run_until_complete(pipeline)\n'
                         '  File '
                         '"/usr/lib64/python3.7/asyncio/base_events.py", line '
                         '584, in run_until_complete\n'
                         '    return future.result()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
                         'line 209, in create_pipeline\n'
                         '    await asyncio.gather(*futures)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/stages/api.py", '
                         'line 43, in __call__\n'
                         '    await self.run()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/tasks/synchronizing.py", '
                         'line 73, in run\n'
                         '    result = await downloader.run()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/base.py", '
                         'line 212, in run\n'
                         '    return await self._run(extra_data=extra_data)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/backoff/_async.py", '
                         'line 131, in retry\n'
                         '    ret = await target(*args, **kwargs)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/plugin/download/http.py", '
                         'line 183, in _run\n'
                         '    response.raise_for_status()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/aiohttp/client_reqrep.py", '
                         'line 942, in raise_for_status\n'
                         '    headers=self.headers)\n'},
  'finished_at': '2019-08-26T18:53:34.022794Z',
  'name': 'pulp_file.app.tasks.synchronizing.synchronize',
  'non_fatal_errors': [],
  'parent': None,
  'progress_reports': [{'done': 0,
                        'message': 'Downloading Metadata',
                        'state': 'failed',
                        'suffix': None,
                        'total': None},
                       {'done': 0,
                        'message': 'Downloading Artifacts',
                        'state': 'canceled',
                        'suffix': None,
                        'total': None},
                       {'done': 0,
                        'message': 'Associating Content',
                        'state': 'canceled',
                        'suffix': None,
                        'total': None}],
  'reserved_resources_record': ['/pulp/api/v3/repositories/53654e44-790d-482d-b07a-ef5192a921e1/',
                                '/pulp/api/v3/remotes/file/file/022b9887-e8c9-4e71-9750-68769e847372/'],
  'spawned_tasks': [],
  'started_at': '2019-08-26T18:53:33.890968Z',
  'state': 'failed',
  'worker': '/pulp/api/v3/workers/9b793a30-2911-46f8-95e6-e35f19650c03/'})

Pulp installation from source August/26.

(pulp) [root@localhost ~]# pip list | grep pulp
pulp-ansible                    0.2.0b3.dev0 
pulp-certguard                  0.1.0rc1     
pulp-docker                     4.0.0b6.dev0 
pulp-file                       0.1.0b2.dev0 
pulp-rpm                        3.0.0b5.dev0 
pulpcore                        3.0.0rc5.dev0
pulpcore-plugin                 0.1.0rc5.dev0

Code used to create those resources: https://git.io/fjAQC

Sync creates publication but no new repository version

Author: mgoddard (mgoddard)

Redmine Issue: 9651, https://pulp.plan.io/issues/9651


I have a nightly job that uses Ansible Squeezer modules to synchronise, publish and distribute some repositories. Every few days I hit an error like this:

Found multiple matches for publication ({'repository_version': '/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/4/

I have verified that this is the case. There is one publication created after the last successful sync, and another created today for the same version.

 pulp rpm publication list --repository-version /pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/4/
[
  {
    "pulp_href": "/pulp/api/v3/publications/rpm/rpm/21680308-1fc4-4bea-a5fc-1e3c609533f1/",
    "pulp_created": "2021-12-21T02:31:44.243390Z",
    "repository_version": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/4/",
    "repository": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/",
    "metadata_checksum_type": "unknown",
    "package_checksum_type": "unknown",
    "gpgcheck": 0,
    "repo_gpgcheck": 1,
    "sqlite_metadata": true
  },
  {
    "pulp_href": "/pulp/api/v3/publications/rpm/rpm/4a0c6a75-bb86-4b96-bb6c-6d0f08763847/",
    "pulp_created": "2021-12-15T02:31:07.260722Z",
    "repository_version": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/4/",
    "repository": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/",
    "metadata_checksum_type": "unknown",
    "package_checksum_type": "unknown",
    "gpgcheck": 0,
    "repo_gpgcheck": 1,
    "sqlite_metadata": true
  }
]

I checked the sync task from today, and it completed successfully. However, it lists the new publication as a created resource, but no new repo version.

  {
    "pulp_href": "/pulp/api/v3/tasks/5e132510-89cb-4224-9966-d1f22d49a4e1/",
    "pulp_created": "2021-12-21T02:30:53.723988Z",
    "state": "completed",
    "name": "pulp_rpm.app.tasks.synchronizing.synchronize",
    "logging_cid": "0a4dc729907842aaa5ba9605e418cdd4",
    "started_at": "2021-12-21T02:30:53.801940Z",
    "finished_at": "2021-12-21T02:31:44.897653Z",
    "error": null,
    "worker": "/pulp/api/v3/workers/605f92b7-9b71-4039-a3de-0af017d86651/",
    "parent_task": null,
    "child_tasks": [],
    "task_group": null,
    "progress_reports": [
      {
        "message": "Downloading Metadata Files",
        "code": "sync.downloading.metadata",
        "state": "completed",
        "total": null,
        "done": 8,
        "suffix": null
      },
      {
        "message": "Downloading Artifacts",
        "code": "sync.downloading.artifacts",
        "state": "completed",
        "total": null,
        "done": 297,
        "suffix": null
      },
      {
        "message": "Associating Content",
        "code": "associating.content",
        "state": "completed",
        "total": null,
        "done": 0,
        "suffix": null
      },
      {
        "message": "Parsed Packages",
        "code": "sync.parsing.packages",
        "state": "completed",
        "total": null,
        "done": 299,
        "suffix": null
      },
      {
        "message": "Un-Associating Content",
        "code": "unassociating.content",
        "state": "completed",
        "total": null,
        "done": 0,
        "suffix": null
      }
    ],
    "created_resources": [
      "/pulp/api/v3/publications/rpm/rpm/21680308-1fc4-4bea-a5fc-1e3c609533f1/"
    ],
    "reserved_resources_record": [
      "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/",
      "shared:/pulp/api/v3/remotes/rpm/rpm/7b6bc03e-787e-4266-ba33-425c4f9e540b/"
    ]
  },

Comparing with another sync task, I see a repository version listed in the created_resources instead.

Here is one of the affected repos:

{
  "pulp_href": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/",
  "pulp_created": "2021-11-19T13:21:20.971989Z",
  "versions_href": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/",
  "pulp_labels": {},
  "latest_version_href": "/pulp/api/v3/repositories/rpm/rpm/b9eb112b-28c3-46bc-a40e-594531b54925/versions/4/",
  "name": "CentOS Stream 8 - NFV OpenvSwitch",
  "description": null,
  "retain_repo_versions": null,
  "remote": null,
  "autopublish": false,
  "metadata_signing_service": null,
  "retain_package_versions": 0,
  "metadata_checksum_type": null,
  "package_checksum_type": null,
  "gpgcheck": 0,
  "repo_gpgcheck": 0,
  "sqlite_metadata": false
}

And the corresponding remote:

  {
    "pulp_href": "/pulp/api/v3/remotes/rpm/rpm/7b6bc03e-787e-4266-ba33-425c4f9e540b/",
    "pulp_created": "2021-11-19T13:21:41.147452Z",
    "name": "CentOS Stream 8 - NFV OpenvSwitch-remote",
    "url": "http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=nfv-openvswitch-2",
    "ca_cert": null,
    "client_cert": null,
    "tls_validation": true,
    "proxy_url": null,
    "pulp_labels": {},
    "pulp_last_updated": "2021-11-19T13:21:41.147492Z",
    "download_concurrency": null,
    "max_retries": null,
    "policy": "immediate",
    "total_timeout": null,
    "connect_timeout": null,
    "sock_connect_timeout": null,
    "sock_read_timeout": null,
    "headers": null,
    "rate_limit": null,
    "sles_auth_token": null
  },

I'm using policy: immediate and sync_policy: mirror_complete when syncing.

Versions:

    {
      "component": "core",
      "version": "3.16.0"
    },
    {
      "component": "rpm",
      "version": "3.16.1"
    },
    {
      "component": "file",
      "version": "1.10.1"
    },
    {
      "component": "deb",
      "version": "2.16.0"
    },
    {
      "component": "container",
      "version": "2.9.0"
    },
    {
      "component": "certguard",
      "version": "1.5.1"
    }

As a user, I can remove orphaned content and related artifacts by content type

Author: @goosemania (ttereshc)

Redmine Issue: 2396, https://pulp.plan.io/issues/2396


Motivation

With upcoming content migration from Pulp 2 (which can be done by content type), it becomes important to have control which orphans to delete and avoid removing content which was recently migrated but hasn't been added to any repository yet.

Suggestion

Add type parameter to the orphan cleanup endpoint to filter what to delete:
$ http DELETE /pulp/api/v3/orphans/ type=file

Only artifacts related to the specified content type should be removed.

Verify Autodistribution works using the repository field

Author: @bmbouter (bmbouter)

Redmine Issue: 4849, https://pulp.plan.io/issues/4849


Assume you have a AnsibleDistribution whose repository_version is a RespotoryVersion with content in it. This would be created like this: https://github.com/pulp/pulp_ansible#create-a-distribution-for-a-repositoryversion

1. Request a content unit from the repo and assert the contents are correct.
2. Create a new RepositoryVersion that removes the unit and do not modify the AnsibleDistribution
3. refetch the same content unit and verify it 404s

Memory usage when destroy repository; The memory leaks?

Author: wilful (wilful)

Redmine Issue: 8992, https://pulp.plan.io/issues/8992


When i try to destroy one of repositories, pulp (RQ basically) are using more 3G RAM and crashed by OOM-Killer

Jun 30 06:59:16 *** kernel: Out of memory: Kill process 81458 (rq) score 493 or sacrifice child
Jun 30 06:59:16 *** kernel: Killed process 81458 (rq), UID 1002, total-vm:4434448kB, anon-rss:3936104kB, file-rss:0kB, shmem-rss:0kB

State before on my node:

1. free -h
              total        used        free      shared  buff/cache   available
Mem:           7.6G        1.5G        3.6G        2.2G        2.6G        3.7G
Swap:            0B          0B          0B
  "versions": [
    {
      "component": "core",
      "version": "3.13.0"
    },
    {
      "component": "rpm",
      "version": "3.13.0"
    },
    {
      "component": "python",
      "version": "3.4.0"
    },
    {
      "component": "file",
      "version": "1.8.0"
    },
    {
      "component": "deb",
      "version": "2.13.0"
    },
    {
      "component": "container",
      "version": "2.6.0"
    }
  ],

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2246247

Fill out test_bindings.py

Author: @bmbouter (bmbouter)

Redmine Issue: 4888, https://pulp.plan.io/issues/4888


Currently the Travis pipeline runs "bindings tests" which live in this file, but there aren't any! https://github.com/pulp/pulp_ansible/blob/master/.travis/test_bindings.py

Here is what a filled out test_bindings.py for pulpcore looks like: https://github.com/pulp/pulp-openapi-generator/blob/master/test_bindings.py

We should have the test_bindings.py ( https://github.com/pulp/pulp_ansible/blob/master/.travis/test_bindings.py ) meaningfully test the bindings produced by pulp_ansible.

Plugin Writer guide mentions of publish task (publisher vs publication) are out of date

Author: [email protected] ([email protected])

Redmine Issue: 4782, https://pulp.plan.io/issues/4782


The publish task is no longer dispatched by the publisher, it is dispatched by publication create.

A quick skim shows that the docs should be updated in multiple places:
https://docs.pulpproject.org/en/pulpcore-plugin/nightly/reference/object-relationships.html
https://docs.pulpproject.org/en/pulpcore-plugin/nightly/plugin-writer/plugin-walkthrough.html#define-your-plugin-publisher

Test - As a user, I can upload chunks in parallel

Author: kersom (kersom)

Redmine Issue: 5263, https://pulp.plan.io/issues/5263


We're currently using drf-chunked-uploads[0] but it seems like the library has become unmaintained[1] since we adopted. It has some other quirks and missing features too. So I think we should move off of it and roll our code as part of this story.

Solution

Add a design which supports sha256 and parallel uploads of chunks.

Models

Upload

id = UUID
file = File
size = BigIntegerField
user = FK
created_at = DateTimeField
completed_at = DateTimeField

UploadChunk

id = UUID
upload = FK
offset = BigIntegerField
size = BigIntegerField

Workflow

1. create the upload session
http POST :24817/pulp/api/v3/uploads/ size=10485759 # returns a UUID (e.g. 345b7d58-f1f8-45d9-d354-82a31eb879bf)
export UPLOAD='/pulp/api/v3/uploads345b7d58-f1f8-45d9-d354-82a31eb879bf/'

1. note the order doesn't matter here
http --form PUT :24817$UPLOAD file@./chunkab 'Content-Range:bytes 6291456-10485759/32095676'
http --form PUT :24817$UPLOAD file@./chunkaa 'Content-Range:bytes 0-6291455/32095676'

1. view the upload and its chunks
http :24817${UPLOAD}

1. complete the upload
http PUT :24817${UPLOAD}commit sha256=037a47d93670e64f2b1038e6f90e4cfd

1. create the artifact from the upload
http POST :24817/pulp/api/v3/artifacts/ upload=$UPLOAD

Additional references

https://github.com/douglasmiranda/django-fine-uploader
https://medium.com/box-developer-blog/introducing-the-chunked-upload-api-f82c820ccfcb

[0] https://github.com/jkeifer/drf-chunked-upload
[1] jkeifer/drf-chunked-upload#8

As an django-storages user with S3 I can extend content protection to be backed by S3

Author: @bmbouter (bmbouter)

Redmine Issue: 4431, https://pulp.plan.io/issues/4431


The content protection mechanism of the Distribution is great for ensuring a client is entitled when Pulp is storing and serving the Artifact. When django-storages is configured as the backend ( https://docs.pulpproject.org/en/3.0/nightly/installation/storage.html#amazon-s3 ) it would be great to integrate w/ a S3-provided content protection mechanism.

Test - Few fields returned by task reported by orphans endpoint set as None

Author: kersom (kersom)

Redmine Issue: 5255, https://pulp.plan.io/issues/5255


Task returned by the orphans endpoint as completed, but a few fields ( finished_at, started_at, worker) are set as None.

{'_created': '2018-12-21T00:26:37.278392Z',
 '_href': '/pulp/api/v3/tasks/b963e89c-db1a-4db4-b8c9-5fbca5629113/',
 'created_resources': [],
 'error': None,
 'finished_at': None,
 'name': 'pulpcore.app.tasks.orphan.orphan_cleanup',
 'non_fatal_errors': [],
 'parent': None,
 'progress_reports': [{'done': 3,
                       'message': 'Clean up orphan Content',
                       'state': 'completed',
                       'suffix': '',
                       'task': '/pulp/api/v3/tasks/b963e89c-db1a-4db4-b8c9-5fbca5629113/',
                       'total': 3},
                      {'done': 3,
                       'message': 'Clean up orphan Artifacts',
                       'state': 'completed',
                       'suffix': '',
                       'task': '/pulp/api/v3/tasks/b963e89c-db1a-4db4-b8c9-5fbca5629113/',
                       'total': 3}],
 'spawned_tasks': [],
 'started_at': None,
 'state': 'completed',
 'worker': None}

Pulp 3 installation from source. April/09.

requesting lots of packages with a subset of fields still causes changelogs, filelists, requires, etc.. to be loaded, resulting in slow requests

Author: @jlsherrill ([email protected])

Redmine Issue: 9655, https://pulp.plan.io/issues/9655


When we make a request like this:

/pulp/api/v3/content/rpm/packages/?fields=pulp_href%2Cname%2Cversion%2Crelease%2Carch%2Cepoch%2Csummary%2Cis_modular%2Crpm_sourcerpm%2Clocation_href%2CpkgId&limit=1&offset=1000&repository_version=%2Fpulp%2Fapi%2Fv3%2Frepositories%2Frpm%2Frpm%2Fc6b93206-22bb-4c58-ba07-828c32326330%2Fversions%2F1%2F

where some subset of fields is requested, we're still seeing all of the fields being loaded from the database. The result is that the query takes much much longer than it should

Testing on the rhel7 repo, it took about ~100 seconds on my machine to fetch all 32K packages specifying the fields above. If I comment out the filelists, changelogs, provides/requires from the model and serializers, that drops down to ~33 seconds. This is a huge improvement.

Reading this: https://stackoverflow.com/questions/53319787/how-can-i-select-specific-fields-in-django-rest-framework

it looks like its may be possible to exclude certain fields from the query itself fairly easily.

As a user, a Remote should provide an option that allows download errors, e.g. 404 errors to still allow creation of a RepositoryVersion

Author: @jlsherrill ([email protected])

Redmine Issue: 5286, https://pulp.plan.io/issues/5286


Problem

If you sync a file repository where one of the files is missing, it seems that the repository syncs as much as it can (as expected), but its reported as a fatal error, with a state of 'failed'.

This is especially problematic for remote repos that you cannot contact the maintainer, have the content you want, but don't have all content available (because it's an incomplete or corrupted repo).

Steps to reproduce:

1) create a file repository where one of the files is missing
2) create a file remote and repository and sync them

Actual task status (apologies its been yaml-fied):

- _href: "/pulp/api/v3/tasks/b6f9b619-c174-4e43-b546-0bbefdfb11e7/"
  _created: '2019-08-15T15:21:37.058+00:00'
  state: failed
  name: pulp_file.app.tasks.synchronizing.synchronize
  started_at: '2019-08-15T15:21:37.177+00:00'
  finished_at: '2019-08-15T15:21:37.382+00:00'
  non_fatal_errors: "[]"
  error:
    code: ''
    description: 404, message='Not Found'
    traceback: |2
        File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 822, in perform_job
          rv = job.perform()
        File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 605, in perform
          self._result = self._execute()
        File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 611, in _execute
          return self.func(*self.args, **self.kwargs)
        File "/usr/local/lib/pulp/src/pulp-file/pulp_file/app/tasks/synchronizing.py", line 45, in synchronize
          dv.create()
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/declarative_version.py", line 169, in create
          loop.run_until_complete(pipeline)
        File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
          return future.result()
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/api.py", line 209, in create_pipeline
          await asyncio.gather(*futures)
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/api.py", line 43, in __call__
          await self.run()
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/artifact_stages.py", line 132, in run
          pb.done += task.result()  # download_count
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/artifact_stages.py", line 155, in _handle_content_unit
          await asyncio.gather(*downloaders_for_content)
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/models.py", line 78, in download
          download_result = await downloader.run(extra_data=self.extra_data)
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/download/base.py", line 212, in run
          return await self._run(extra_data=extra_data)
        File "/usr/local/lib/pulp/lib64/python3.6/site-packages/backoff/_async.py", line 131, in retry
          ret = await target(*args, **kwargs)
        File "/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/download/http.py", line 183, in _run
          response.raise_for_status()
        File "/usr/local/lib/pulp/lib64/python3.6/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
          headers=self.headers)
  worker: "/pulp/api/v3/workers/df7e0085-b0dd-4073-b74d-9ab78ad27a03/"
  spawned_tasks: []
  progress_reports:
  - message: Downloading Metadata
    state: completed
    total: 1
    done: 1
  - message: Parsing Metadata Lines
    state: completed
    total: 2
    done: 2
  - message: Downloading Artifacts
    state: failed
    done: 0
  - message: Associating Content
    state: canceled
    done: 0
  created_resources: []
  reserved_resources_record: []
create_version: true
poll_attempts:
  total: 1
  failed: 1

Solution

It would be useful to have an option that causes sync to not fail on download errors, but instead continue and record the errors as non-fatal exceptions somehow.

Occasional UQ error core_repositoryversion_repository_id_number_3c54ce50_uniq on DistTree PulpImport

Rare failure, in this occasion invoked during a pulp-import testcase:

pulp_rpm/tests/functional/api/test_pulpimport.py::DistributionTreePulpImportTestCase::test_import FAILED [ 81%]

pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.tasking.pulpcore_worker:INFO: Starting task c455492e-bc13-4517-b86a-6069bca53ed7
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.tasking.pulpcore_worker:INFO: Starting task 023517b6-401d-4f7e-be44-1d5814d0fe0c
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.PackageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.PackageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.ModulemdResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.ModulemdDefaultsResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdDefaultsResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.PackageGroupResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageGroupResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.PackageCategoryResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageCategoryResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.PackageEnvironmentResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageEnvironmentResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.PackageLangpacksResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageLangpacksResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.UpdateRecordResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateRecordResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.RepoMetadataFileResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource RepoMetadataFileResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.DistributionTreeResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource DistributionTreeResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.DistributionTreeRepositoryResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource DistributionTreeRepositoryResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.ChecksumResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ChecksumResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.ImageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ImageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.AddonResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource AddonResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.ModulemdResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.ModulemdDefaultsResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdDefaultsResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.PackageGroupResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageGroupResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.VariantResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource VariantResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.PackageCategoryResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageCategoryResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.UpdateReferenceResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateReferenceResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.UpdateCollectionResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateCollectionResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulp_rpm.app.modelresource.UpdateCollectionPackageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateCollectionPackageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpopm4e5hz/repository-7206edf0-b89d-4da5-93d0-dcae838399c5_1/pulpcore.app.modelresource.ContentArtifactResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ContentArtifactResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.PackageEnvironmentResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageEnvironmentResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.PackageLangpacksResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageLangpacksResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.UpdateRecordResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateRecordResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.RepoMetadataFileResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource RepoMetadataFileResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.DistributionTreeResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource DistributionTreeResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.DistributionTreeRepositoryResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource DistributionTreeRepositoryResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.ChecksumResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ChecksumResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.ImageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ImageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.AddonResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource AddonResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.VariantResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource VariantResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.UpdateReferenceResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateReferenceResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.UpdateCollectionResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateCollectionResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulp_rpm.app.modelresource.UpdateCollectionPackageResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource UpdateCollectionPackageResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpg9flo4a_/repository-868191e5-b1bb-49f7-86b8-efe70ecb0329_1/pulpcore.app.modelresource.ContentArtifactResource.json.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.app.tasks.importer:INFO: ...Importing resource ContentArtifactResource.
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.tasking.pulpcore_worker:INFO: Task c455492e-bc13-4517-b86a-6069bca53ed7 failed (duplicate key value violates unique constraint "core_repositoryversion_repository_id_number_3c54ce50_uniq"
DETAIL:  Key (repository_id, number)=(e84ff294-5d1b-4bfe-b5fb-e98d0c328537, 2) already exists.
)
pulp [2edbce945b1e462193b75d622f48aa44]: pulpcore.tasking.pulpcore_worker:INFO:   File "/usr/local/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py", line 362, in _perform_task
    result = func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pulpcore/app/tasks/importer.py", line 206, in import_repository_version
    with repo.new_version() as new_version:
  File "/usr/local/lib/python3.8/site-packages/pulpcore/app/models/repository.py", line 126, in new_version
    version.save()
  File "/usr/lib64/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/django_lifecycle/mixins.py", line 134, in save
    save(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 776, in save_base
    updated = self._save_table(
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 881, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 919, in _do_insert
    return manager._insert(
  File "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 1270, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

S3 doesn't work if you follow the guide in our docs

Author: daviddavis (daviddavis)

Redmine Issue: 4455, https://pulp.plan.io/issues/4455


You get a permission denied error if you set up pulp + S3 according to our docs. This warning somewhat explains the problem:

The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL.

More info jschneier/django-storages#381

The temporary fix is to set AWS_DEFAULT_ACL to 'None' in our settings. Not sure if we should update our docs since this is a temporary problem that should be resolved in django-storages 2.0.

As a plugin API user subclassing pulpcore.plugin.content.Handler, I know which parts I can customize and which parts I can't

Author: @bmbouter (bmbouter)

Redmine Issue: 4845, https://pulp.plan.io/issues/4845


Problem.

It's not clear which methods of the pulpcore.plugin.content.Handler object should be customized versus use as is. Here are some questions I'm interested in:

Are they all safe to customize?
Do some methods depend on other methods in ways that customization may cause breakages?
Are these methods the right way to position this Handler?

Custom settings not propogating

I'm trying to configure the S3 storage backend, however, am running into an issue with settings not propogating correctly.

I have set DJANGO_SETTINGS_MODULE to pulpcore.app.settings as an environment variable, and additionally have set PULP_SETTINGS to /var/lib/pulp/settings.yaml which is where I have set the variables. The templated contents of which are below:

default:
  # Django
  SECRET_KEY: '${PULP_SECRET}'
  DEBUG: True

  CONTENT_HOST: '${CONTENT_HOST}'

  # Redis
  REDIS_HOST: '${REDIS_HOST}'
  REDIS_PORT: ${REDIS_PORT}
  REDIS_PASSWORD: '${REDIS_PASSWORD}'

  # Storage
  AWS_ACCESS_KEY_ID: '${S3_ACCESS_KEY_ID}'
  AWS_SECRET_ACCESS_KEY: '${S3_SECRET_ACCESS_KEY}'
  AWS_STORAGE_BUCKET_NAME: '${S3_STORAGE_BUCKET_NAME}'
  AWS_DEFAULT_ACL:
  AWS_AUTO_CREATE_BUCKET: False

  DEFAULT_FILE_STORAGE: storages.backends.s3boto3.S3Boto3Storage
  MEDIA_ROOT:  ''

  # Postgres
  DATABASES:
    default:
      CONN_MAX_AGE: 0
      ENGINE: django.db.backends.postgresql_psycopg2
      NAME: '${PGSQL_DB}'
      USER: '${PGSQL_USER}'
      PASSWORD: '${PGSQL_PASSWORD}'
      HOST: '${PGSQL_HOST}'
      PORT: ${PGSQL_PORT}

The problem appears to be that pulpcore.app.settings is following the explicit approach as described here but is missing the crucial settings.populate_obj(sys.modules[__name__]). This means that only the settings explicitly mentioned in the file are propogated.

Caveat: I am new to django and dynaconf so might be missing something incredibly obvious

Modulemd profiles not getting removed from the consumer

Author: bherring (bherring)

Redmine Issue: 4823, https://pulp.plan.io/issues/4823


I have consumer "integration_test_consumer_support" registered to pulp. It has 1 module enabled. When I try to delete all modulemd profiles belonging to this consumer, it simple gets ignored.

1. before profile delete
$ curl -k -u admin:admin https://localhost/pulp/api/v2/consumers/integration_test_consumer_support/profiles/
[{"profile": [{"context": "deadbeef", "version": "20180730223407", "arch": "noarch", "name": "kangaroo", "stream": "0"}], "_href": "/pulp/api/v2/consumers/integration_test_consumer_support/profiles/modulemd/", "_ns": "consumer_unit_profiles", "profile_hash": "f69375f21b302f40025ff8a2128004e81436407554972029cbfbe445d0a2b563", "consumer_id": "integration_test_consumer_support", "content_type": "modulemd", "_id": {"$oid": "5cab7b49db284e2341a2c0ac"}, "id": "5cab7b49db284e2341a2c0ac"}]

1. Delete profile
curl -X "DELETE" -k -u admin:admin https://localhost/pulp/api/v2/consumers/integration_test_consumer_support/profiles/modulemd/ 

1. after profile delete
curl -k -u admin:admin https://localhost/pulp/api/v2/consumers/integration_test_consumer_support/profiles/
[{"profile": [{"context": "deadbeef", "version": "20180730223407", "arch": "noarch", "name": "kangaroo", "stream": "0"}], "_href": "/pulp/api/v2/consumers/integration_test_consumer_support/profiles/modulemd/", "_ns": "consumer_unit_profiles", "profile_hash": "f69375f21b302f40025ff8a2128004e81436407554972029cbfbe445d0a2b563", "consumer_id": "integration_test_consumer_support", "content_type": "modulemd", "_id": {"$oid": "5cab7b49db284e2341a2c0ac"}, "id": "5cab7b49db284e2341a2c0ac"}]

[Epic] plugin-template should let plugins publish their container images, based on a pulpcore image

Author: @mikedep333 ([email protected])

Redmine Issue: 5393, https://pulp.plan.io/issues/5393


Currently, plugin-template builds an entire container image (from fedora:30 up) through the content plugin during CI.

It is not published.

it is also inefficient and less reproducible than being based on a "pulpcore" image.

This work was previously part of #5004 and #5062. However, most of the value for those tasks was delivered, and this work can be done afterwards. Also, it should have been separate subtasks anyway. So it is being moved into this Epic.

As a user, I can rsync content to remote servers

Author: @bmbouter (bmbouter)

Redmine Issue: 5091, https://pulp.plan.io/issues/5091


Problem

To allow remote storage and serving of Pulp content it would be great if an exporter would rsync content to a remote location.

Design

In Pulp3 an 'exporter' can send content out of a Pulp system. An exporter named RsyncExporter should be created that takes the most important option that rsync accepts. Additionally the RsyncExporter takes either a 'repository' or 'repository_version' but not both. If 'repository' it will publish the latest repository_version.

TBD: which fields specifically?

Implementation

Internally it will write the entire repository to a temporary area on-disk and then shell out to rsync. Other ports of rsync-like functionality to Python I don't believe contain the optimization and stability of rsync itself.

On Demand Content

This feature does not work for on-demand content because the content must be present locally for rsync to ship it to the remote system.

As a user, I can restrict a Distribution to serve a particular scheme

Author: @bmbouter (bmbouter)

Redmine Issue: 4954, https://pulp.plan.io/issues/4954


Problem

A user wants to configure specific repositories to serve via http, others via https, and yet others via both. The use case for https is that people want security. The use case for http is that some clients may not support https.

Solution

Add a field named allowed_scheme to BaseDistribution so it's available to all subclassed Distribution types. This is a choice field that accepts one of 3 values:

http - Only serve the request if the scheme is 'http'
https - Only serve the request if the scheme is 'https'
any - Serve all requests regardless of the scheme     <----- this is the default

Use the X-Forwarded-Proto header so Pulp can know the scheme being served in cases where TLS occurs before the reverse proxy call to Pulp. If the header is not present, the current request scheme is the one assumed.

As a user, I can see what parameters were used for any task dispatched

Author: @dralley (dalley)

Redmine Issue: 4343, https://pulp.plan.io/issues/4343


Presently, the task record stores two primary types of metadata about the operation it performed:

  • The name of a task (which tells you what type of task it was, sync/publish/update/etc., and where it was defined (plugin or core),
  • CreatedResources

This leaves a lot of gaps that make it impossible to properly audit the history of the state of Pulp

  • You don't know what resource was updated, or what those updates were - if it was an update task
  • You don't know what remote was used, or whether mirror=True or False - if it was a sync task
  • You can kind of figure out what the plugin type was, or what repository it was performed on, via. the name or CreatedResources, but it is implicit, not explicit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.