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

podman events different than docker events #14993

Closed
joachimBurket opened this issue Jul 20, 2022 · 28 comments
Closed

podman events different than docker events #14993

joachimBurket opened this issue Jul 20, 2022 · 28 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@joachimBurket
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I'm not sure if it is Podman's goal to match Docker's outputs, but while trying to use Podman with a tool designed with Docker CLI, I saw that the output of podman events --format "{{json .}}" doesn't contain the same fields as docker events --format "{{json .}}", which prevents the tool to run.

Steps to reproduce the issue:

  1. podman events --format "{{json .}}"

Describe the results you received:

# pull new image event ->
{"Name":"rust:alpine","Status":"pull","Time":"2022-07-19T21:26:10.143941717+02:00","Type":"image","Attributes":null}

# remove image event ->
{"ID":"3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da","Name":"docker.io/library/rust:alpine","Status":"remove","Time":"2022-07-19T21:25:34.684610229+02:00","Type":"image","Attributes":null}

Describe the results you expected:

Same as docker events --format "{{json .}}":

# pull new image event ->
{"status":"pull","id":"rust:alpine","Type":"image","Action":"pull","Actor":{"ID":"rust:alpine","Attributes":{"name":" rust"}},"scope":"local","time":1658332113,"timeNano":1658332113524919324}

# remove image event ->
{"status":"untag","id":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da","Type":"image","Action":"untag","Actor":{"ID":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da","Attributes":{"name":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da"}},"scope":"local","time":1658332211,"timeNano":1658332211177841258}
{"status":"delete","id":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da","Type":"image","Action":"delete","Actor":{"ID":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da","Attributes":{"name":"sha256:3a83e7ec7491adfa83edde65f415fd133d3a47fd6be9b2b1843b46d3a188c4da"}},"scope":"local","time":1658332211,"timeNano":1658332211345361391}

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Wed Jun 22 18:17:44 2022
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.26.1
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 72.79
    systemPercent: 6.46
    userPercent: 20.75
  cpus: 4
  distribution:
    distribution: fedora
    variant: workstation
    version: "36"
  eventLogger: journald
  hostname: fedora
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.18.7-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 355311616
  memTotal: 16457154560
  networkBackend: cni
  ociRuntime:
    name: crun
    package: crun-1.4.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.5
      commit: c381048530aa750495cf502ddb7181f2ded5b400
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 8503521280
  swapTotal: 8589930496
  uptime: 192h 11m 59.93s (Approximately 8.00 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /home/joachim/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/joachim/.local/share/containers/storage
  graphRootAllocated: 748592037888
  graphRootUsed: 121975619584
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 90
  runRoot: /run/user/1000/containers
  volumePath: /home/joachim/.local/share/containers/storage/volumes
version:
  APIVersion: 4.1.1
  Built: 1655914664
  BuiltTime: Wed Jun 22 18:17:44 2022
  GitCommit: ""
  GoVersion: go1.18.3
  Os: linux
  OsArch: linux/amd64
  Version: 4.1.1

Package info (e.g. output of rpm -q podman or apt list podman):

podman-4.1.1-2.fc36.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical.

Docker --version:

Docker version 20.10.12, build e91ed57
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 20, 2022
@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2022

I believe we should make them consistent if possible.

@mheon
Copy link
Member

mheon commented Jul 20, 2022

The status for removing an image (remove for us, delete for Docker) is concerning. I don't think we can change that. Maybe only for the compat API?

@mheon
Copy link
Member

mheon commented Jul 20, 2022

The id field is also different (we use ID, Docker uses id) but otherwise it's just missing fields, which should be easy to address.

We also need to make an extra Untag event for images when removing but that's easy.

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2022

Couldn't we add the fields ID and delete in addition to the fields we have for better compatibility?

@mheon
Copy link
Member

mheon commented Jul 21, 2022

I don't think we can change remove vs delete - that's a single field (Status) that we are populating differently from Docker.

Adding an ID field to mirror id could definitely work, but it's pretty ugly.

@rhatdan
Copy link
Member

rhatdan commented Jul 23, 2022

The time and timenano should be fixed, We should be returning computer readable time rather then human time.

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Jul 23, 2022
@adhishmeena
Copy link

Hi @rhatdan , I am new to podman , could you please assign this issue to me . I would be happy to work on it.

@vrothberg
Copy link
Member

Thanks, @adhishmeena !

@rhatdan
Copy link
Member

rhatdan commented Jul 24, 2022

Welcome @adhishmeena

@adhishmeena
Copy link

image
when I am running podman events command , It is not showing any output , where am I getting wrong ?

@mheon
Copy link
Member

mheon commented Jul 26, 2022

You need to run Podman commands to generate events that will be displayed. or use the --since and --until arguments to display past events

@adhishmeena
Copy link

Thank you @mheon

@adhishmeena
Copy link

@rhatdan , would you please give some more clarity on computer readable time ?

@rhatdan
Copy link
Member

rhatdan commented Aug 9, 2022

Currently the events should be reported in EPOCH time (Total seconds since 1970) rather then being displayed in human readable format.

@adhishmeena
Copy link

Thank you @rhatdan

@adhishmeena
Copy link

Hi , I have made changes in libpod->events-events.go file and used e.TIme.Unix() in case of Image . PLease share your thoughts
image

@rhatdan
Copy link
Member

rhatdan commented Aug 15, 2022

@mheon PTAL

@mheon
Copy link
Member

mheon commented Aug 15, 2022

It's hard to tell without having a proper diff - I recommend opening a PR, we can review the changes there

@adhishmeena
Copy link

Agree , I have raised PR . Please review.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Sep 17, 2022

@adhishmeena Do you have a link to the PR? Is this still in progress?

@adhishmeena
Copy link

#15353 (comment)

@adhishmeena
Copy link

Can you please share doc for local setup of podman?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@ch33hau
Copy link

ch33hau commented May 8, 2023

Hi @rhatdan ,

I saw that this issue isn't active at the moment, can I work on it?

Thanks

@rhatdan
Copy link
Member

rhatdan commented May 8, 2023

Yes

@ch33hau
Copy link

ch33hau commented May 12, 2023

Hi @rhatdan , I have created a PR for this issue, appreciate if you could review it, thanks!

ch33hau added a commit to ch33hau/podman that referenced this issue May 15, 2023
- Use unix timestamp for event time
- Add a timeNano field for event time in nanoseconds

Fixes: containers#14993

Signed-off-by: Chee Hau Lim <[email protected]>
@mheon
Copy link
Member

mheon commented Mar 4, 2024

Fix has merged

@mheon mheon closed this as completed Mar 4, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jun 3, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
6 participants