Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 pulp services #34
add pulp services #34
Changes from 11 commits
8577568
266dfc6
1d08e23
9f99f69
06378a7
e9541cc
94328d4
a36e0ac
c0a052c
ced9c95
992a6f8
675a2ee
846263c
84a5a67
f87525f
78ca43a
3a92635
3d1f220
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also unused, but I think this could still be needed to tune the worker count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be an own command (like now), an own service (like https://github.com/pulp/pulp-oci-images/blob/latest/images/compose/compose.yml does it) or whether we should use
pulpcore-manager migrate --noinput && pulp-api
as the command for the "normal" API container startup (like we do for Foreman)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess while combining the migration and API startup commands seems convenient, but it will create challenges in error handling and clearly not flexible.
And I think having a dedicated migration service would be a better approach for us. It allows for more flexible scaling of the migration process independently from the API and other services, making everything easier to manage in the long run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some benefits in having tighter control, but you must migrate the DB before starting any of the Pulp services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for now but I think we should understand and decide how we handle this in a universal way given we have multiple applications having to do the same workflow: wait on database, apply outstanding migrations. Candlepin does this via the application startup procedure and so this will happen within the container itself.
Pulp's images have a wait for database and wait for migrations script that they currenly rely upon before startup: https://github.com/pulp/pulp-oci-images/blob/d74b7bbb9550152c0de1e45f16eec73f674e8f15/images/assets/pulp-api#L3-L4
The Foreman container being used takes a similar approach:
foreman-quadlet/container-images/foreman/Containerfile
Line 18 in 98f6a41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this should be wherever Apache (httpd) presents the content, so end user clients talk to. They shouldn't talk to the internal endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, would you mind expanding a little more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting https://pulpproject.org/pulpcore/docs/admin/reference/settings/#content_origin
In our deployment we have httpd in front of Pulp which presents it at on
https://{{ ansible_hostname }}
. In other words, this was always wrong, but I'm noticing it now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl so we basically have to set it up without port? if we want user to point at the right place? to this
CONTENT_ORIGIN="https://{{ ansible_hostname }}"
(sorry pinging on this again, i'm not good at this part yet)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what we do in puppet-pulpcore, yeah:
https://github.com/theforeman/puppet-pulpcore/blob/master/templates/settings.py.erb#L20
You could also argue, that this sort-of blurs the lines between the roles (the plain, port 443, HTTPS is not available w/o the
httpd
role), and thepulp
role should have a default for the content origin beinghttp://{{ ansible_fqdn }}:port
, and then we override this indeploy.yaml
withhttps://{{ ansible_fqdn }}
as that's the value the overall deployment usesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it should be a variable on the role that the playbook sets (because that knows both httpd and pulp)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/variable/default/, but yeah, that's how I'd do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-PORT says an empty string (default) means the default port. IMHO there's no value in hardcoding the default port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit unsure why my suggestion wasn't followed. IMHO the config should be as short as possible and not copy all the defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, i did updated it 3d1f220
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was to remove the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, i understand now! sorry, updating it in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl, #54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This empty line is common in Python. It separates the built in modules (
json
) from third party ones (pytest
). isort will place it back.