hashicorp / nomad-driver-podman

A nomad task driver plugin for sandboxing workloads in podman containers
https://developer.hashicorp.com/nomad/plugins/drivers/podman
Mozilla Public License 2.0
224 stars 61 forks source link

empty lines in alloc logs when logging.driver is journald #339

Open viniciusartur opened 1 month ago

viniciusartur commented 1 month ago

In RHEL 9, when running a task with logging.driver set to journald, the alloc logs shows empty lines between the real lines. It doesn't happen when logging.driver is set to nomad

Given the following redis.hcl:

job "redis" {
  datacenters = ["dc1"]
  type        = "service"

  group "cache" {
    network {
      port "redis" { to = 6379 }
    }

    task "redis" {
      driver = "podman"

      config {
        image = "docker.io/redis"
        ports = ["redis"]
        logging = {
          driver = "journald"
        }
      }
    }
  }
}
  1. Run ./nomad agent -dev -plugin-dir /root/plugins
  2. In another terminal run nomad job run redis.hcl
  3. The output of nomad alloc logs -task redis -job redis is:
    
    1:C 08 May 2024 04:38:17.279 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

1:C 08 May 2024 04:38:17.281 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

1:C 08 May 2024 04:38:17.281 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started

1:C 08 May 2024 04:38:17.281 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

1:M 08 May 2024 04:38:17.283 * monotonic clock: POSIX clock_gettime

1:M 08 May 2024 04:38:17.284 * Running mode=standalone, port=6379.

1:M 08 May 2024 04:38:17.285 * Server initialized

1:M 08 May 2024 04:38:17.285 * Ready to accept connections tcp