485 Commits

Author SHA1 Message Date
0838c2b984 Add ability to start containers in a pod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #361
Approved by: rhatdan
2018-02-22 14:49:36 +00:00
86930c829e Add kill and stop for pods
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #361
Approved by: rhatdan
2018-02-22 14:49:36 +00:00
0b4c8fc2bb Add pod status command
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #361
Approved by: rhatdan
2018-02-22 14:49:36 +00:00
b8d1ce03a1 Add tests and cleanup
- Added run_cgroup_parent_test.go
- Cleaned up calls to logrus

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #370
Approved by: rhatdan
2018-02-22 12:39:08 +00:00
a58e9f7cee Push up createConfig.CgroupParent processing to parent
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #370
Approved by: rhatdan
2018-02-22 12:39:08 +00:00
8a97671145 Corrected comment
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #370
Approved by: rhatdan
2018-02-22 12:39:08 +00:00
3f004df384 Implement podman run option --cgroup-parent
Example:

sudo /usr/local/bin/podman run --cgroup-parent=/zzz fedora cat /proc/self/cgroup

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #370
Approved by: rhatdan
2018-02-22 12:39:08 +00:00
f1f0f37dc1 Correct exit code 126 and 127
The exit codes for 126 and 127 were reversed.  For the record, the exit
codes used are as follows:

* 125 if ‘chroot’ itself fails
* 126 if COMMAND is found but cannot be invoked
* 127 if COMMAND cannot be found

This resolves issue #367

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

Closes: #378
Approved by: baude
2018-02-21 16:49:00 +00:00
6ce70a33c5 Inspect output should be in array form
Inspect should be able to inspect one or more containers depending
on the user input.  Therefore, inspect output should be in array
format so the consumer could potentially iterate it.  This PR allows
users to specify one more or containers|images|or a mix for
inspection.  The output, as stated, is therefore in array form.  This
holds true even for a singular image.

In the case that the user enters an invalid container|image "name", we
handle that gracefully.  Podman will output json for the valid names
until it reaches the invalid one.  For example:

In this case, podman will out the json for alpine and then print an
error about 123 being invalid.  It will not continute onto busybox.
This behavior imatates docker.

This addresses issue #360

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

Closes: #371
Approved by: baude
2018-02-21 14:22:36 +00:00
e929e7de4c Add --time alias to manpages
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #375
Approved by: rhatdan
2018-02-21 13:32:59 +00:00
4803b5a639 Alias --time to --timeout for 'podman stop'
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #375
Approved by: rhatdan
2018-02-21 13:32:59 +00:00
4929e37507 Performance enhancement for podman images
Previous code was using slow routines to collect some of the information
needed to output images.  Specifically size was being calculated instead
of using the cached, already known size already available.  Also, straight-
lined several of the code paths.  Overall assessment is that these
improvements cut the time for images in half.

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

Closes: #365
Approved by: mheon
2018-02-20 21:54:32 +00:00
df7bf04dc6 Resolve contention between copr and fedora repos
In order for the podman in podman tests to work, we need to install a copr
RPM that has the function we need (and is not in a fedora build yet).  Because
the copr rpms are not versioned correctly (relative to the fedora ones), we now
set the version in the copr rpm.

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

Closes: #368
Approved by: mheon
2018-02-20 16:18:11 +00:00
8f8fd1d900 Fix podman save when redirecting output
podman save would write the progress bar to the image tar file
when the output was redirected with >.
Fixed the writer to write to stderr for all commands using writer

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

Closes: #362
Approved by: mheon
2018-02-20 15:16:28 +00:00
8eb5cf7489 Ensure we don't repeatedly poll disk for exit codes
Change logic for refreshing our state using runc to only poll
for conmon exit files when we first transition to the Stopped
state. After that, we should already have the exit code stored in
the database, so we don't need to look it up again.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #363
Approved by: TomSweeneyRedHat
2018-02-20 14:54:13 +00:00
8d8817e61e Update c/image to 701221f0891d76aeac3f25912e6bb9f84e88de1c
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #358
Approved by: TomSweeneyRedHat
2018-02-20 09:11:33 +00:00
635deb6358 Change uptime format in podman info to human-readable
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #355
Approved by: rhatdan
2018-02-19 19:19:07 +00:00
32efbbdf8a Merge pull request #357 from edsantiago/vice-versa
language: correct 'vice versa' in docs
2018-02-19 12:51:25 -05:00
2cfe9cbf38 language: correct 'vice versa' in docs
Signed-off-by: Ed Santiago <santiago@redhat.com>
2018-02-19 09:45:30 -07:00
07f15c2694 Remove unused registry related options from libpod
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #349
Approved by: rhatdan
2018-02-19 14:17:18 +00:00
5317ba792c Bump version to v0.2.2 for ongoing development
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #347
Approved by: mheon
2018-02-16 19:28:35 +00:00
3723cecc33 Merge pull request #346 from baude/0.2.1
0.2.1
v0.2.1
2018-02-16 13:24:46 -06:00
ea2299cf3e 0.2.1
Signed-off-by: baude <bbaude@redhat.com>
2018-02-16 13:24:06 -06:00
586bb86a2a Run podman inside a podman container
We should be able to run nested podman containers in particular
for our testing environment. i.e. eat our own dog food.

Some privileges had to be corrected in order for this to work
correctly.

Added a third papr target that runs podman tests inside podman.  I
marked the test as not required right now as we get more confident
in the results

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

Closes: #340
Approved by: rhatdan
2018-02-16 18:35:54 +00:00
bc1d25bb19 Remove last traces of old version scheme
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #345
Approved by: rhatdan
2018-02-16 18:14:33 +00:00
f2041b51f3 Add FFJSON encoding/decoding for our container structs
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #323
Approved by: mheon
2018-02-16 16:46:09 +00:00
445aaf87fa images --all developer note
podman does not implement --all for images

intermediate images are only generated during the build process.  they are
children to the image once built. until buildah supports caching builds,
it will not generate these intermediate images.

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

Closes: #344
Approved by: rhatdan
2018-02-16 16:08:08 +00:00
57b910a031 Add podman version
Copy the way cri-o does this by adding a libpod/version
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #343
Approved by: mheon
2018-02-15 20:13:08 +00:00
ab88304162 Touch up tutorial location and install reqs
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #337
Approved by: rhatdan
2018-02-15 19:51:46 +00:00
a67fdeaf0d No registries warning
When no /etc/containers/registries.conf is found, log a warning message.

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

Closes: #338
Approved by: mheon
2018-02-15 19:17:37 +00:00
409ed259c6 Return imageid from podman pull
When using podman to pull an image, print the image id after
the image is pulled.

Resolves issue #329

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

Closes: #342
Approved by: rhatdan
2018-02-15 17:18:08 +00:00
ce7a0171d1 Squash logged errors from failed SQL rollbacks
Currently we unconditionally roll back transactions after error,
even if a commit has already been attempted. Commit is guaranteed
to end a transaction, though, whether by successfully committing
or by rolling back if that fails. As such, we attempt a double
rollback if a transaction fails at commit (for example, for a
constraint violation), which doesn't error but does log angry
warning messages. Ensure we don't try rolling back after commit
runs to prevent this.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #327
Approved by: rhatdan
2018-02-15 15:47:59 +00:00
e814936915 No entrpoint, cmd, or command
When an image does not have an ENTRYPOINT nor a CMD and the
user does not provide a command in the CLI, we should fail
gracefully.

This resolves issue #328

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

Closes: #333
Approved by: mheon
2018-02-15 00:48:13 +00:00
be9ed1cfac Privileged containers should inherit host devices
When running a privileged container, it should inherit the same
devices the host has.

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

Closes: #330
Approved by: mheon
2018-02-15 00:20:47 +00:00
d051dc38d8 Bump podman version to match release version
Signed-off-by: baude <bbaude@redhat.com>

Closes: #331
Approved by: baude
2018-02-14 22:03:26 +00:00
d3b432a06c Add copr deps
The COPR spec needs to require:
* atomic-registries
* iptables
* containernetworking-cni

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

Closes: #332
Approved by: baude
2018-02-14 22:02:51 +00:00
4fa341e56a PS performance cleanups
By not getting data that we don't need and adding more locking
functions under the batch, we are able to cut the time for listing
50 containers in half.  More to come.

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

Closes: #325
Approved by: mheon
2018-02-14 15:18:43 +00:00
4a39327bc5 Disable default Seccomp profile with privileged containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #326
Approved by: baude
2018-02-13 19:42:07 +00:00
35e1ad78fb Make libpod build on 32-bit systems
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #324
Approved by: rhatdan
2018-02-13 15:39:07 +00:00
3d0100bb44 Address review comment
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
v0.2
2018-02-12 14:28:07 +00:00
de737c150a Add buckets for all containers and all pods
Now, we don't need to use the global ID registry to iterate - we
can iterate only through containers or only through pods, without
having to iterate through both.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
dc6a99df4c Containers in a pod can only join namespaces in that pod
This solves some dependency problems in the state, and makes
sense from a design standpoint.

Containers not in a pod can still depend on the namespaces of
containers joined to a pod, which we might also want to change in
the future.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
3962d10bd4 Fix gofmt and lint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
a7889f8d6a Check error when checking ctr dependencies
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
4f225b47c9 Refactor Pod to use a Config struct
This allows us to JSON it and stuff it in the DB - previously,
all pod fields were private, so JSON couldn't encode them. This
allows us to keep all pod fields private by having a substruct
with public fields.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
aa85ae212e Add pod functions to BoltDB state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
363a82e668 Add pod buckets
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
b4cdc27b31 Add implementation for BoltDB-backed state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #184
Approved by: baude
2018-02-12 14:28:07 +00:00
2e96acf300 Change json to match docker inspect
Changing these fields caused the output of podman inspect to more
closely match docker inspect.

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

Closes: #306
Approved by: mheon
2018-02-11 11:50:34 +00:00
d26266659d Honor ENTRYPOINT in image
When an image has an ENTRYPOINT defined, we should be honoring it. The
problem is described in issue #321.

Also, added buildah binary to test runtimes for testing entrypoint and
will also allow us to test podman build as well.

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

Closes: #322
Approved by: rhatdan
2018-02-11 10:21:46 +00:00