Commit graph

104 commits

Author SHA1 Message Date
Qi Wang fd7a9c4a96 fix bug remote-podman images --digests
Add `digest` field to Image struct and update API.md
Show image digests when using --digests in podman-remote.

```
$ PODMAN_VARLINK_ADDRESS="tcp:127.0.0.1:1234" sudo bin/podman-remote images --digests
REPOSITORY                  TAG      DIGEST                                                                    IMAGE ID       CREATED       SIZE
docker.io/library/alpine    latest   sha256:d05ecd4520cab5d9e5d877595fb0532aadcd6c90f4bbc837bc11679f704c4c82   5cb3aa00f899   2 weeks ago   5.79 MB
docker.io/library/busybox   latest   sha256:4415a904b1aca178c2450fd54928ab362825e863c0ad5452fd020e92f7a6a47e   d8233ab899d4   5 weeks ago   1.42 MB
```

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-27 23:09:35 -04:00
baude 7f2221d48f size is optional for container inspection
on the remote client, if a user wants to know the rootfs size of a
container, a -s should be passed.  this corrects a behavior where size
was shown by default.

Fixes #2765

Signed-off-by: baude <bbaude@redhat.com>
2019-03-26 10:14:58 -05:00
baude e730fc6093 Add "died" event
We have a new event for container 'Exited' which has been renamed to
'died'.

also removed the stream bool from the varlink endpoint for events
because it can be determined by the varlink more value.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-25 10:28:50 -05:00
baude ca1e76ff63 Add event logging to libpod, even display to podman
In lipod, we now log major events that occurr.  These events
can be displayed using the `podman events` command. Each
event contains:

* Type (container, image, volume, pod...)
* Status (create, rm, stop, kill, ....)
* Timestamp in RFC3339Nano format
* Name (if applicable)
* Image (if applicable)

The format of the event and the varlink endpoint are to not
be considered stable until cockpit has done its enablement.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 15:08:59 -05:00
Jhon Honce 8a6758d5fd Implement podman-remote wait command and container subcommand
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-06 10:32:01 -07:00
Jhon Honce 4d13a80fa4 Support podman-remote stop container(s)
* Clean up adapter code
* Add GetContainersByContext to Varlink API
* Add missing comments
* Restore save command
* Restore error type mapping when using varlink

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-02 08:57:20 -07:00
OpenShift Merge Robot 3825db5aee
Merge pull request #2404 from baude/remoteerrors
make remote-client error messaging more robust
2019-02-23 22:10:03 +01:00
baude 6208d53464 make remote-client error messaging more robust
the remote-client is currently weak for carrying error messages
over the varlink interface and displaying something useful to users
and developers for the purposes of debug.  this is a starting point
to improve that user experience.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 14:12:36 -06:00
baude bc6b4aa39c podman-remote pod inspect|exists
enable the remote client to be able to inspect a pod.  also, bonus of
enabling the podman pod exists command which returns a 0 or 1 depending
on whether the given pod exists.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 11:08:04 -06:00
baude e91ec38a70 enable podman-remote pod rm
add the ability to delete a pod from the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-21 08:40:42 -06:00
baude 711ac93051 podman-remote save [image]
Add the ability to save an image from the remote-host to the
remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-20 12:58:05 -06:00
Valentin Rothberg 6ae4401bd1 iopodman.SearchImages: add ImageSearchFilter to Varlink API
Also add some argument checks to the Varlink function to avoid
referencing nil pointers, and complement the API.md descriptions.

The varlink endpoint can be tested via varlink CLI:

$ varlink call -m unix:/run/podman/io.podman/io.podman.SearchImages \
      '{"query": "ruby", "limit": 0, "tlsVerify": false, "filter": {}}'

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 0d3eaca28a SearchImages: extend API with filter parameter
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
baude 8f40c4e6b4 podman-remote pull
Add status for remote users and podman remote-client pull.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-19 10:13:07 -06:00
Daniel J Walsh b75dcd4458
Add registry name to fields returned by varlink image search
Cockpit team wants to list the registry name where the image was
found.

Also fix up SearchImages code to check if the user specified a registry
in his call to use that rather then all the registries, This matches
podman search command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-15 15:30:09 -05:00
OpenShift Merge Robot d512c4d255
Merge pull request #2305 from rhatdan/tlsverify
Add tlsVerify bool to SearchImage for varlink
2019-02-15 10:50:36 +01:00
OpenShift Merge Robot ae8cc41295
Merge pull request #2332 from baude/remotevolumeprune
volume prune
2019-02-14 22:52:03 +01:00
Daniel J Walsh 5f7d4ee73f
Add tlsVerify bool to SearchImage for varlink
Cockpit wants to be able to search images on systems without
tlsverify turned on.

tlsverify should be an optional parameter, if not set then we default
to the system defaults defined in /etc/containers/registries.conf.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 14:31:20 -05:00
Daniel J Walsh 52df1fa7e0
Fix volume handling in podman
iFix builtin volumes to work with podman volume

Currently builtin volumes are not recored in podman volumes when
they are created automatically. This patch fixes this.

Remove container volumes when requested

Currently the --volume option on podman remove does nothing.
This will implement the changes needed to remove the volumes
if the user requests it.

When removing a volume make sure that no container uses the volume.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 13:21:52 -05:00
baude 5be818e715 enable podman-remote volume prune
allow users to remotely prune volumes.

this is the last volume command for remote enablement.  as such,
the volume commands are being folded back into main because they
are supported for both local and remote clients.

also, enable all volume tests that do not use containers
as containers are not enabled for the remote client yet.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-14 10:55:05 -06:00
baude ef85dd7950 podman-remote build
add the ability to build images using files local to the remote-client
but over a varlink interface to a "remote" server.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 15:36:36 -06:00
baude 4f60f79a27 podman-remote volume inspect|ls
add the ability to list and inspect volumes using the remote
client and varlink

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 12:43:51 -06:00
baude 7dcc21f213 podman-remote push
enable podman-remote push so that users can push images from a
remote client.

change in push API to deal with the need to see output over the
varlink connection.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 08:44:12 -06:00
OpenShift Merge Robot f0d64a9e3e
Merge pull request #2236 from baude/listcontainermountsmap
Alter varlink API for ListContainerMounts to return a map
2019-02-01 03:23:34 +01:00
baude 656033ca96 podman image prune -- implement all flag
we now, by default, only prune dangling images.  if --all is passed, we
prune dangling images AND images that do not have an associated containers.

also went ahead and enabled the podman-remote image prune side of things.

Fixes: #2192

Signed-off-by: baude <bbaude@redhat.com>
2019-01-29 16:51:48 -06:00
baude 9e22fbf679 Alter varlink API for ListContainerMounts to return a map
We want to return a map of containermounts where the key is container
id and it points to the mountpath.

Issue #2215

Signed-off-by: baude <bbaude@redhat.com>
2019-01-29 16:47:27 -06:00
baude 5c8e7ed0de enable podman-remote version
initial enablement of podman-remote version.  includes add a APIVersion const
that will allow us to check compatibility between host/client when connections
are made.

also added client related information to podman info.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-21 15:23:30 -06:00
baude eadaa5fb42 podman-remote inspect
base enablement of the inspect command.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-18 15:43:11 -06:00
baude 7459c48863 Add varlink support for prune
Add the ability to prune unused images using the varlink
API.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-10 15:21:42 -06:00
Valentin Rothberg 75578aad61 add container-init support
Add support for executing an init binary as PID 1 in a container to
forward signals and reap processes.  When the `--init` flag is set for
podman-create or podman-run, the init binary is bind-mounted to
`/dev/init` in the container and "/dev/init --" is prepended to the
container's command.

The default base path of the container-init binary is `/usr/libexec/podman`
while the default binary is catatonit [1].  This default can be changed
permanently via the `init_path` field in the `libpod.conf` configuration
file (which is recommended for packaging) or temporarily via the
`--init-path` flag of podman-create and podman-run.

[1] https://github.com/openSUSE/catatonit

Fixes: #1670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 11:42:03 +01:00
baude 9b03cacc87 Add Play
podman play kube adds the ability for the user to recreate pods and containers
from a Kubernetes YAML file in libpod.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-19 14:20:55 -06:00
baude 06d763d964 Clean up some existing varlink endpoints
Going through and adding options (like tls-verify, signature option, etc)
to some varlink endpoints (like push/pull) many of which had not been
updated since their original authoring.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-12 12:53:09 -06:00
baude 078fd071c1 add more example usage to varlink endpoints
Signed-off-by: baude <bbaude@redhat.com>
2018-12-09 11:16:33 -06:00
baude 5209894100 add timeout to pod stop
like podman stop of containers, we should allow the user to specify
a timeout override when stopping pods; otherwise they have to wait
the full timeout time specified during the pod/container creation.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-07 10:27:41 -06:00
Miloslav Trmač b134951d14 Minimally update for the DockerInsecureSkipTLSVerify type change
Following SystemContext.DockerInsecureSkipTLSVerify, make the
DockerRegistryOne also an OptionalBool, and update callers.

Explicitly document that --tls-verify=true and --tls-verify unset
have different behavior in those commands where the behavior changed
(or where it hasn't changed but the documentation needed updating).

Also make the --tls-verify man page sections a tiny bit more consistent
throughout.

This is a minimal fix, without changing the existing "--tls-verify=true"
paths nor existing manual insecure registry lookups.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
baude 5c02dda869 Adding more varlink endpoints
* runlabel
* checkpoint
* restore
* container|image exists
* mount
* unmount

Signed-off-by: baude <bbaude@redhat.com>
2018-12-03 10:56:07 -06:00
Jhon Honce 9074565f4e Implement pod varlink bindings
* Update varlink document
* Add NoContainersInPod error in go and python
* Add support for varlink pod interface
* New code passes pylint
* Fix bug in test_runner.sh
* Update integration tests for race condition on status check
* Add missing port config file support

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-10-01 07:24:50 -07:00
baude 6db7027e97 Add buildah version and distribution to info
For the sake of debug and problem reporting, we would benefit from knowing
what buildah version was vendored into podman.  Also, knowing the distribution
and distribution version would also be handy.

Signed-off-by: baude <bbaude@redhat.com>
2018-09-28 10:48:16 -05:00
Jhon Honce 785e9ea1fd Updates from reviews
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1519
Approved by: rhatdan
2018-09-21 19:36:01 +00:00
Daniel J Walsh d20f3a5146 switch projectatomic to containers
Need to get some small changes into libpod to pull back into buildah
to complete buildah transition.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1270
Approved by: mheon
2018-08-16 17:12:36 +00:00
baude bd9d3a8fa5 Rename varlink socket and interface
io.projectatomic.podman -> io.podman

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1204
Approved by: mheon
2018-08-06 14:49:11 +00:00
baude 06a29f0bde varlink build fixes
the varlink build was not working as designed and required some touch-ups:

* return a struct that includes logs and the new image ID
* pass namespaceoption so that networking in buildah works

Signed-off-by: baude <bbaude@redhat.com>

Closes: #903
Approved by: rhatdan
2018-06-05 19:31:13 +00:00
Daniel J Walsh 8c68fddd1c
Merge pull request #839 from baude/varlinkcreatefixes
varlink build
2018-06-01 13:00:30 -04:00
baude 62ea88fa19 varlink build
Add the endpoint and methods for build so users can build an image
with varlink.  build can also use the more method for streaming
output back more regularily; however, it looks like a bug in buildah
does not output all build output to the writer provided.

Tidy up some create fixes and add endpoint for GetImage requested by
jhonce.

Signed-off-by: baude <bbaude@redhat.com>
2018-06-01 09:13:31 -05:00
Daniel J Walsh 29c831f9d6 Add OnBuild support for podman build
Only supported for docker formated images. OCI Does not support this flag.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-06-01 10:08:56 -04:00
Matthew Heon a127b4f312 Force update of API.md
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #849
Approved by: rhatdan
2018-05-30 18:41:54 +00:00
umohnani8 c8b72e57a7 save and load should support multi-tag for docker-archive
The docker-archive tar files can have multiple tags for the same
image stored in it. Load pulls all the tags found in the archive
when loading a tar file. Save can oush multiple tags of the same
image to a tar archive.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #819
Approved by: rhatdan
2018-05-25 15:15:47 +00:00
baude 82feafecdd podman create, start, getattachsocket
First pass at implement API endpoints for create and start.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #805
Approved by: baude
2018-05-21 19:26:56 +00:00
baude 3f6a739ede finish changing the path for varlink
cleanup the last references to /run/io.projectatomic... and make sure
/run/podman/projectatomic... is used.

Signed-off-by: baude <bbaude@redhat.com>
2018-05-19 10:00:52 -05:00
baude d870c25c01 implement varlink commit
Signed-off-by: baude <bbaude@redhat.com>

Closes: #762
Approved by: baude
2018-05-15 17:08:10 +00:00
baude 9657cd6c15 Fix varlink remove image force
Fixes a bug where the force bool was being ignored when deleting images
via the varlink interface.

Also, minor fix to the docs to add a line break between methods and types in
the doc index.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #753
Approved by: rhatdan
2018-05-11 16:05:10 +00:00
baude 834f1f641e varlink info
The varlinfo info returns the same information as podman info but always includes
the so-called debug information.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #745
Approved by: baude
2018-05-11 14:00:25 +00:00
baude a74107b506 alphabetize the varlink methods, types, and errors in the docs
We have decided to alphabetize things in the API documentation to help users
find things easier.  It also solves an issue where when being made, the API.md doc
would remake itself in a different order resulting in massive diffs in the pull
requests but no new content.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #739
Approved by: baude
2018-05-10 14:32:34 +00:00
baude 25263558f1 Generate varlink API documentation automatically
Using varlink's idl parser, we generate API documentation for the podman
API relying on the .varlink file as the source.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #734
Approved by: baude
2018-05-08 21:01:28 +00:00