NERSC / podman-hpc

Other
34 stars 5 forks source link

By default logs don't work #106

Open asnaylor opened 1 month ago

asnaylor commented 1 month ago

There are no logs created when running this container (which uses the default log driver journald):

$ podman-hpc run -dt -p 8080:80/tcp docker.io/library/httpd
$ podman-hpc ps
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS        PORTS                 NAMES
776d474331b7  docker.io/library/httpd:latest  httpd-foreground  4 seconds ago  Up 4 seconds  0.0.0.0:8080->80/tcp  sad_torvalds
$ podman-hpc logs sad_torvalds
$ podman-hpc inspect sad_torvalds | jq '.[0].HostConfig.LogConfig'
{
  "Type": "journald",
  "Config": null,
  "Path": "",
  "Tag": "",
  "Size": "0B"
}

But if you change the log-driver to json-file it works:

$ podman-hpc run -dt -p 8080:80/tcp --log-driver=json-file docker.io/library/httpd
$ podman-hpc ps
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS        PORTS                 NAMES
69429e7b84fa  docker.io/library/httpd:latest  httpd-foreground  4 seconds ago  Up 4 seconds  0.0.0.0:8080->80/tcp  stupefied_jang
$ podman-hpc logs stupefied_jang
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
[Tue Jun 04 23:59:32.460794 2024] [mpm_event:notice] [pid 1:tid 140334221084544] AH00489: Apache/2.4.59 (Unix) configured -- resuming normal operations
[Tue Jun 04 23:59:32.462677 2024] [core:notice] [pid 1:tid 140334221084544] AH00094: Command line: 'httpd -D FOREGROUND'
$ podman-hpc inspect stupefied_jang | jq '.[0].HostConfig.LogConfig'
{
  "Type": "json-file",
  "Config": null,
  "Path": "/images/75235_hpc/storage/overlay-containers/69429e7b84fa79191d35c5e77b03b3cf0e3fce78e9aec5be2ab72cee1120f1e0/userdata/ctr.log",
  "Tag": "",
  "Size": "0B"
}

Is it possible to get it working with the default log-driver journald?

danfulton commented 1 month ago

What happens when you explicitly set --log-driver=journald ?

asnaylor commented 1 month ago

Still no logs

$ podman-hpc run -dt -p 8080:80/tcp --log-driver=journald docker.io/library/httpd
$ podman-hpc ps
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS        PORTS                 NAMES
86c835c19850  docker.io/library/httpd:latest  httpd-foreground  4 seconds ago  Up 4 seconds  0.0.0.0:8080->80/tcp  lucid_shaw
$ podman-hpc logs 86c835c19850
$ podman-hpc inspect 86c835c19850 | jq '.[0].HostConfig.LogConfig'
{
  "Type": "journald",
  "Config": null,
  "Path": "",
  "Tag": "",
  "Size": "0B"
}