podman: set --log-driver when running/creating containers

Bug #1814897 reported by Cédric Jeanneret on 2019-02-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Medium
Cédric Jeanneret

Bug Description

Hello,

Docker daemon has a --log-driver=journald set globally. With podman, we can't do that, so we must pass --log-driver journald for each and every container we run/create.

This will allow to debug failed containers, as we will be able to fetch their logs even if they are deleted using "journalctl CONTAINER_NAME=foo" directly.

This will probably impact both paunch and tripleo-heat-templates.

Cheers,

C.

Changed in tripleo:
importance: Undecided → Medium
Cédric Jeanneret (cjeanner) wrote :

Note:
as per https://review.openstack.org/#/c/635105/, journald output isn't supported yet....

Cédric Jeanneret (cjeanner) wrote :

Using json-file is nice. The only issue is:
- podman provides a nice "path" as log-opt, allowing to push the file where WE want
- docker doesn't support that option at all.

more digging is needed...

Reviewed: https://review.openstack.org/635437
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=edfe180634548fc6039b7fb5b8d9799b1c030dc1
Submitter: Zuul
Branch: master

commit edfe180634548fc6039b7fb5b8d9799b1c030dc1
Author: Cédric Jeanneret <email address hidden>
Date: Wed Feb 6 14:40:08 2019 +0100

    Inject log-driver for podman containers

    Currently, docker daemon runtime has a default --log-driver set
    to journald.
    Podman lack of daemon prevent such a global application, meaning
    we have to set that driver for each and every container when we
    either create or run them.

    Notes:
    - podman only supports "json-file", and it's not even a json.
    - docker json-file doesn't support "path" option, making this output
      unusable in the end: logs end in
      /var/lib/docker/containers/ID/ID-json.log

    Related-Bug: #1814897
    Change-Id: Ia613fc3812aa34376c3fe64c21abfed51cfc9cab

Reviewed: https://review.openstack.org/635438
Committed: https://git.openstack.org/cgit/openstack/paunch/commit/?id=fba5e04fdd1fa9ed85f02f1dab0794e1f4828739
Submitter: Zuul
Branch: master

commit fba5e04fdd1fa9ed85f02f1dab0794e1f4828739
Author: Cédric Jeanneret <email address hidden>
Date: Wed Feb 6 14:05:11 2019 +0100

    Inject log-driver for podman containers

    Currently, docker daemon runtime has a default --log-driver set
    to journald.

    Podman lack of daemon prevent such a global application, meaning
    we have to set that driver for each and every container when we
    either create or run them.

    Notes:
    - podman only supports "json-file", and it's not even a json.
    - docker json-file doesn't support "path" option, making this output
      unusable in the end: logs end in
      /var/lib/docker/containers/ID/ID-json.log

    Related-Bug: #1814897
    Change-Id: I7ac10a9b42ecae73a77b624f5350c424d4c3030a

Reviewed: https://review.openstack.org/635785
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=3d07ad43264a8c3ba899a5d341ffd9ef897d217c
Submitter: Zuul
Branch: master

commit 3d07ad43264a8c3ba899a5d341ffd9ef897d217c
Author: Cédric Jeanneret <email address hidden>
Date: Fri Feb 8 09:55:07 2019 +0100

    New parameter: ContainerLogStdoutPath

    This is used in order to point where podman must push its logs.
    Two scripts are using it:
    - docker-puppet.py
    - paunch (near future - see https://review.openstack.org/#/c/635438/)

    This will allow to get the stdout for all containers, even when they
    are removed before we can actually run "podman logs container_name".

    Related-Bug: #1814897
    Change-Id: Idc220047d56ce0eb41ac43903877177c4f7b75c2

Changed in tripleo:
status: Triaged → Fix Committed
Changed in tripleo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers