tracker issues_75004: Custom container service does not handle args c…#67606
Conversation
…orrectly https://tracker.ceph.com/issues/75004 Issue: cephadm custom service fails to start with args. Root cause: Container arguments were incorrectly placed before the image name in the podman run command within unit.run. Reason: When applying a custom service, for example: service_type: container service_id: keycloak placement: host_pattern: '*' spec: image: quay.io/keycloak/keycloak:latest args: - "start" - "--http-enabled=true" - "--hostname-strict=false" - "--db=dev-mem" envs: - "KC_BOOTSTRAP_ADMIN_USERNAME=admin" - "KC_BOOTSTRAP_ADMIN_PASSWORD=password123" The args field was assigned to the Podman arguments instead of the daemon arguments. Fix: Assign the args field to the daemon arguments instead of the Podman arguments. This reorders the command execution to place the arguments after the image name. Signed-off-by: yaelazulay-redhat <[email protected]>
|
Can one of the admins verify this patch? |
14 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
phlogistonjohn
left a comment
There was a problem hiding this comment.
Your commit messages should comply with the ceph project standards:
https://github.com/ceph/ceph/blob/main/SubmittingPatches.rst#commit-title
Your Signed-off-by should contain your name (legal name typically) not your github username.
If you refer to a tracker link in the commit message, use a Fixes: trailer.
Example:
Fixes: https://tracker.ceph.com/issues/75004
Signed-off-by: Jon Doe <[email protected]>
Per:
Putting the arguments for the entrypoint in the args paramater as in the example below is incorrect:
- Reproduce with following keycloak service definition:
service_type: container
service_id: keycloak
placement:
host_pattern: '*'
spec:
image: quay.io/keycloak/keycloak:latest
args:
- "start"
- "--http-enabled=true"
- "--hostname-strict=false"
- "--db=dev-mem"
envs:
- "KC_BOOTSTRAP_ADMIN_USERNAME=admin"
- "KC_BOOTSTRAP_ADMIN_PASSWORD=password123"
If I remember correctly you should use extra_entrypoint_args to specify arguments for the entrypoint. @adk3798 may want to double check my statement here though.
|
Hi @phlogistonjohn Also, note that I have corrected the keycloak json example I have used: More information: Based on the keycloak json I tested, the incorrect podman run command appeared as follows: /usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --init --name ceph-33dd251a-1093-11f1-9389-52540032be7e-container-keycloak-ceph-node-0 start --http-enabled=true --hostname-strict=false --db=dev-mem -d --log-driver journald --conmon-pidfile /run/ceph-33dd251a-1093-11f1-9389-52540032be7e@container.keycloak.ceph-node-0.service-pid --cidfile /run/ceph-33dd251a-1093-11f1-9389-52540032be7e@container.keycloak.ceph-node-0.service-cid --cgroups=split -e CONTAINER_IMAGE=quay.io/keycloak/keycloak:latest -e NODE_NAME=ceph-node-0 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=password123 -v /etc/hosts:/etc/hosts:ro quay.io/keycloak/keycloak:latest With the fix applied, it looks like this: /usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --init --name ceph-f76ad23e-1615-11f1-9100-525400e2ab1b-container-keycloak-ceph-node-0 -d --log-driver journald --conmon-pidfile /run/ceph-f76ad23e-1615-11f1-9100-525400e2ab1b@container.keycloak.ceph-node-0.service-pid --cidfile /run/ceph-f76ad23e-1615-11f1-9100-525400e2ab1b@container.keycloak.ceph-node-0.service-cid --cgroups=split -e CONTAINER_IMAGE=quay.io/keycloak/keycloak:latest -e NODE_NAME=ceph-node-0 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=password123 -v /etc/hosts:/etc/hosts:ro quay.io/keycloak/keycloak:latest start --http-enabled=true --hostname-strict=false --db=dev-mem |
Fixes: https://tracker.ceph.com/issues/75004
Signed-off-by: Yael Azulay [email protected]
Issue: cephadm custom service fails to start with args.
Root cause: Container arguments were incorrectly placed before the image name in the podman run command within unit.run.
Reason:
When applying a custom service, for example:
service_type: container
service_id: keycloak
placement:
host_pattern: '*'
spec:
image: quay.io/keycloak/keycloak:latest
args:
- "start"
- "--http-enabled=true"
- "--hostname-strict=false"
- "--db=dev-mem"
envs:
- "KC_BOOTSTRAP_ADMIN_USERNAME=admin"
- "KC_BOOTSTRAP_ADMIN_PASSWORD=password123"
The args field was assigned to the Podman arguments instead of the daemon arguments.
Fix: Assign the args field to the daemon arguments instead of the Podman arguments. This reorders the command execution to place the arguments after the image name.
Checklist