Skip to content
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

Allow customizing the process for the entrypoint.sh script #1798

Merged
merged 3 commits into from
Aug 4, 2024

Conversation

TrevorBenson
Copy link
Collaborator

Description

Implements an ENTRYPOINT_PROCES.

  • When undefined cnode.sh is the ENTRYPOINT_PROCESS persisting the current behavior of the cardano-node container.
  • When defined the process exec'd at the end is a script inside the "${CNODE_HOME}/scripts/${ENTRYPOINT_PROCESS}" "$@".

Motivation and context

This allows a simple method to change the containers startup script dynamically while persisting the configuration files copied in place by the NETWORK environment variable

Which feature request it closes?

closes #1797

How has this been tested?

loaded and running cardano-node, mithril-signer and cncli.sh containers with a test image on ghcr.io. Using quadlet / podman systemd (man podman-systemd.unit) to run multiple containers and pass in the ENTRYPOINT_PROCESS when needed.

# grep -e ENTRYPOINT_PROCESS -e Exec /etc/containers/systemd/preprod-*.container
/etc/containers/systemd/preprod-cncli-leaderlog.container:Environment="ENTRYPOINT_PROCESS=cncli.sh"
/etc/containers/systemd/preprod-cncli-leaderlog.container:Exec="leaderlog"
/etc/containers/systemd/preprod-cncli-sync.container:Environment="ENTRYPOINT_PROCESS=cncli.sh"
/etc/containers/systemd/preprod-cncli-sync.container:Exec="sync"
/etc/containers/systemd/preprod-cncli-validate.container:Environment="ENTRYPOINT_PROCESS=cncli.sh"
/etc/containers/systemd/preprod-cncli-validate.container:Exec="validate"
/etc/containers/systemd/preprod-mithril-signer.container:Environment="ENTRYPOINT_PROCESS=mithril-signer.sh"
/etc/containers/systemd/preprod-mithril-signer.container:Exec="-D"
# systemctl is-active preprod-{cncli-{sync,leaderlog,validate},mithril-signer}
active
active
active
active
# podman ps | awk '/preprod/ {print $2, $NF}'
ghcr.io/trevorbenson/cardano-node:multi-process preprod-pool-ccio
ghcr.io/trevorbenson/cardano-node:multi-process preprod-cncli-sync
ghcr.io/trevorbenson/cardano-node:multi-process preprod-cncli-leaderlog
ghcr.io/trevorbenson/cardano-node:multi-process preprod-cncli-validate
ghcr.io/trevorbenson/cardano-node:multi-process preprod-mithril-signer

… mithril-signer.sh while persisting configs for correct NETWORK
@TrevorBenson TrevorBenson merged commit abbce77 into alpha Aug 4, 2024
1 check passed
@TrevorBenson TrevorBenson deleted the container-multi-process-entrypoint branch August 4, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Allow defining the containers process without changing the entrypoint
4 participants