-
Notifications
You must be signed in to change notification settings - Fork 133
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
New compose stack on dev/compose with signing and reload enabled #2292
Conversation
6ca3c79
to
9fdec59
Compare
Signing: - add GPG config - Run all containers as `root` (the only way to be able to have skopeo signing) - add signing scripts - add signing keys - add signing-service - add repo publickey to staging and published Extra: - Schedule REsource Sync Task
9fdec59
to
6838705
Compare
elif keyring: | ||
certs_dir = settings.get("ANSIBLE_CERTS_DIR", "/etc/pulp/certs") | ||
keyring_path = os.path.join(certs_dir, keyring) | ||
if not os.path.exists(keyring_path): | ||
self.echo(f"Keyring {keyring_path} does not exist", self.style.ERROR) | ||
sys.exit(1) | ||
|
||
if not options["yes"]: | ||
confirm = input( | ||
f"This will set keyring to {keyring_path} for " | ||
f"{repository} repository, " "Proceed? (Y/n)" | ||
).lower() | ||
while True: | ||
if confirm not in ("y", "n", "yes", "no"): | ||
confirm = input('Please enter either "y/yes" or "n/no": ') | ||
continue | ||
if confirm in ("y", "yes"): | ||
break | ||
else: | ||
self.echo("Process canceled.") | ||
return |
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 kept for backwards compatibility only, keyring is no more required, repo now has gpgkey
as a plain text instead of a reference to a keyring.
<<: *common-env | ||
user: root | ||
command: | | ||
bash -c " |
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'd move large multiline bash scripts into standalone files that are mounted to a container.
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.
@cutwater We are trying to avoid Over-Abstraction and multiple layers of indirection.
The initial version of this PR had scripts encoded as base64
inlined in the yaml file, then on those cases we agreed to move to external script.
I think the advantage is that reading the YAML would be enough to understand at least the higher level step-by-step that is being executed to prepare the environment.
A scenario where I see this being helpful is when hacking/debugging, and I want to hook some other calls or experiment a different parameter for example on a management command.
I can just copy/paste the yaml file as aap_hacking.yaml
and do my changes with little changes to sparse bash scripts that are nested in a way we can´t easily tell or explain.
We had this experience before on the old ./compose
environment, on pplugin_template
and again on oci-env
The goal is that reading the aap.yaml
only, anyone can understand the step-by-step and manipulate in the way it is needed to develop and debug.
I think we can encapsulate some atomic actions as scripts, but reading the yaml needs to make it obvious what is happening.
Also, I see advantage on moving some things to a dev Dockerfile, but we will discuss it further if needed, we are doing baby-step improvements to avoid over-engineering.
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 think the rule of thumb here would be to stick to the SOLID S
principle.
An external script will do One Single thing only, never write scripts that performs nested calls to other scripts.
Multiple scripts must be chained explicitly on the compose yaml and with meaningful name that describes what the script is doing.
A refactor that would work but still keep the visibility would be:
bash -c "
/src/galaxy_ng/dev/compose/bin/wait /etc/pulp/certs/database_fields.symmetric.key
/src/galaxy_ng/dev/compose/bin/wait /etc/pulp/certs/signing-public.key
/src/galaxy_ng/dev/compose/bin/run_migrations
"
What we want to avoid is:
command: magic_entrypoint.sh
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 agree ... let's not give someone a target to over-engineer and push us towards re-creating oci-env all over again.
…ible#2292) Compose stack on dev/compose with signing and reload enabled
Galaxy Simplified Compose Stack
Profiles:
aap
- Run galaxy_ng for integration with Ansible Automation Platform and Resource Servercommunity
- Run galaxy_ng for galaxy.ansible.com developmentcloud
- Run galaxy_ng for console.redhat.com developmentRequirements
docker compose
version>=2
Usage
Pick a profile as needed and on the root of
galaxy_ng
repository.Build images
Run the stack
docker compose -f dev/compose/aap.yaml up # optionally pass `-d` to release the terminal
Exec commands on the
manager
serviceBash
Django Admin
Settings
Reload
Changing
.py
and.yaml
files on any of theDEV_SOURCE_PATH
directories will trigger reload ofapi
,worker
, andcontent
services.This PR
dev/compose
folderdev/compose
has its ownREADME.md
explaining the filesSigning:
root
(for editable installs)Extra: