2609 Commits

Author SHA1 Message Date
b70f8b3884 Fix build on non-Linux
Unrelated to the rest of the PR.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
6a0afce7c8 Remove some unused data structures and code
... instead of unnecessarily adapting it for the DockerInsecureSkipTLSVerify type change.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
d3be6b8578 Vendor buildah after merging https://github.com/containers/buildah/pull/1214
This updates buildah for the sysregistriesv2 changes.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
33fcb355ca Update containers/image to 63a1cbdc5e6537056695cf0d627c0a33b334df53
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
c465cdbe20 Update release notes for 0.12.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-12-06 15:52:13 -05:00
d37647ddf8 Merge pull request #1951 from baude/podcontainernet
bind mount /etc/resolv.conf|hosts in pods
2018-12-06 12:50:18 -08:00
cb900798ce Cirrus: Document and codify base-image production
A number of images required for future testing are not present in GCE.
Importing them is a long proscribed process prone to errors and
complications.

Improve this situation by documenting, and encoding the majority of the
steps required.  Due to the required complexity, these are clearly
identified as 'semi-automated'.  This means a discerning eye is
sometimes needed to address unforeseen problems (networking issues,
format or packaging changes, etc).

Nevertheless, having these steps in writing, will reduce current and
future  maintenance burden while supporting future testing needs of
RHEL, Fedora and Fedora Atomic Host.

Also:

* Add necessary configuration, scripts, and Makefile updates needed to
  prepare RHEL, Fedora, & FAH cloud images for use in GCE.  This
  is a complex, multi-step process where the cloud image is booted
  un a local user-mod qemu-kvm instance, where it can be modified.
  From there, it's converted into a specific format, and imported into
  GCE.  Lastly, the imported raw disk data is made available as a GCE
  VM image.

  Note: As of this commit, the RHEL base-image builds (CentOS has native
  image), however neither RHEL or CentOS cache-images build correctly.

* Left testing on FAH disabled, the GCE/Cirrus integration needs needs more
  work.  Specifically, the python3-based google startup script service
  throws a permission-denied (as root) when trying to create a temp.
  directory.  Did not investigate further, though manually running the
  startup script does allow the libpod tests to start running.

* Enabled Fedora 29 image to execute tests and general use.

* Utilize the standardized F28-based container image  for gating
  of more the intensive unit and integration testing.  Update
  documentation to reflect this as the standard platform for
  these checks.  Rename tasks with shorter names and to better
  reflect their purpose.

* Cirrus: Trim unnecessary env vars before testing since the vast
  majority are only required for orchestration purposes.  Since most
  are defined within `.cirrus.yml`, it's a good place to store the
  list of undesirables.  Since each of the cirrus-scripts runs in
  it's own shell, unsetting these near the end will have no
  consequence.  Also trim down the number of calls to show_env_vars()

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-06 15:39:18 -05:00
8d7fdc7d79 Cirrus: Use Makefile for image-building
The packer tool takes JSON as input for the details of producing VM
images to be used for PR CI-testing.  JSON is not a very human-friendly
format, without support for comments and frequently containing lots of
duplicate data.

Fix this by using a Makefile + simple python one-liner to convert
from a human-friendly YAML format into packer-native JSON.  This allows
use of anchors/aliases to reduce duplication, and allows inline comments
for easier maintainability.  This also allows separating the 'test'
action from the 'build' action, for earlier and better syntax problem
detection.

Lastly, there are some minor ``lib.sh`` and ``integration_test.sh``
updates to support future work, and slightly improve the build and
test environments.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-06 15:39:18 -05:00
fb3ceeb385 Merge pull request #1905 from umohnani8/login
Pick registry to login from full image name as well
2018-12-06 12:08:49 -08:00
39a036e24d bind mount /etc/resolv.conf|hosts in pods
containers inside pods need to make sure they get /etc/resolv.conf
and /etc/hosts bind mounted when network is expected

Signed-off-by: baude <bbaude@redhat.com>
2018-12-06 13:56:57 -06:00
5c6e02b55b Merge pull request #1904 from umohnani8/volume
Add "podman volume" command
2018-12-06 08:59:13 -08:00
3e60de629d Merge pull request #1912 from baude/prune
Add ability to prune containers and images
2018-12-06 08:31:20 -08:00
99bbbeb746 Merge pull request #1887 from mheon/rm_sync
Add --sync option to podman rm
2018-12-06 08:11:51 -08:00
5a07644646 Merge pull request #1944 from giuseppe/update-tutorial
tutorial: add ostree dependency
2018-12-06 07:20:40 -08:00
e04871b13c Merge pull request #1946 from rhatdan/vendor
Vendor in latest containers/storage
2018-12-06 07:01:42 -08:00
e5335fd74c Remove --sync flag from podman rm
Per discussion with Dan, it would be better to automatically
handle potential runtime errors by automatically syncing if they
occur. Retaining the flag for `ps` makes sense, as we won't even
be calling the OCI runtime and as such won't see errors if the
state desyncs, but rm can be handled automatically.

The automatic desync handling code will take some additional work
so we'll land this as-is (sync on ps is enough to solve most
desync issues).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
b945d9128a Add locking to Sync() on containers
Previously not needed as it only worked inside of Batch(), but
now that it can be called anywhere we need to add mutual
exclusion on its config changes.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
28bead8be8 Add --sync flag to podman ps
The previous commit added support for --sync to podman rm to
ensure state inconsistencies would not prevent containers from
being removed.

Add the flag to podman ps as well, so that all containers can be
forcibly synced and all state inconsistencies resolved.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
a0c9be2061 Add --sync option to podman rm
With the changes made recently to ensure Podman does not hit the
OCI runtime as often to sync state, we can find ourselves in a
situation where the runtime's state does not match ours.

Add a --sync flag to podman rm to ensure we can still remove
containers when this happens.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
375831e976 Tests for podman volume commands
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2018-12-06 10:17:23 +00:00
4c70b8a94b Add "podman volume" command
Add support for podman volume and its subcommands.
The commands supported are:
	podman volume create
	podman volume inspect
	podman volume ls
	podman volume rm
	podman volume prune

This is a tool to manage volumes used by podman. For now it only handle
named volumes, but eventually it will handle all volumes used by podman.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-12-06 10:17:16 +00:00
0a838fc239 tutorial: add ostree dependency
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-06 11:13:56 +01:00
a75b397ac1 Pick registry to login from full image name as well
podman login reg.io/username/image works as well now. It picks
the registry and checks for authentication, if none exist it
will prompt for username and password.
If the credentials exist but are not valid, it will prompt the
user for new valid credentials.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2018-12-06 09:33:16 +00:00
fe7f3e4094 Merge branch 'vendor' of github.com:rhatdan/libpod into vendor 2018-12-06 03:20:31 -05:00
40678b119c Merge branch 'master' of github.com:containers/libpod into vendor 2018-12-06 03:20:16 -05:00
e037427035 Add ability to prune containers and images
Allow user to prune unused/unnamed images, the layer images from building,
via podman rmi --prune.

Allow user to prune stopped/exiuted containers via podman rm --prune.

This should resolve #1910

Signed-off-by: baude <bbaude@redhat.com>
2018-12-05 19:57:54 -06:00
75b19ca8ab Merge pull request #1945 from jwhonce/bug/1929
Invert tlsverify default in API
2018-12-05 17:20:17 -08:00
6bb56a1c97 Merge pull request #1924 from baude/mroevarlinkendpoints
Adding more varlink endpoints
2018-12-05 14:55:27 -08:00
c60489da47 Refactor BooleanAction to mimic golang interface
* Change all store_true or store_false to use store_bool.
  New behavior documented in BooleanAction docstring.
* Remove any extraneous code identified by pylint in files from above.

Fixes #1869

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-12-05 15:43:08 -07:00
7c7231ce01 Invert tlsverify default in API
Fixes #1929

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-12-05 15:42:33 -07:00
bbcbf03f73 Merge pull request #1947 from baude/f28runc
set .54 version for f28 due to memory error
2018-12-05 14:36:38 -08:00
ab4a3ece40 set .54 version for f28 due to memory error
Signed-off-by: baude <bbaude@redhat.com>
2018-12-05 15:18:29 -06:00
5f480f5f75 Vendor in latest containers/storage
This should improve performance on vfs images on top of xfs/reflink drives.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-05 15:56:04 -05:00
be74acee1c Merge pull request #1940 from wking/numeric-gid
libpod/container_internal_linux: Allow gids that aren't in the group file
2018-12-05 08:09:58 -08:00
50e754cd57 Merge pull request #1918 from mheon/use_db_paths
Use paths written in DB instead if they differ from our defaults
2018-12-05 00:55:48 -08:00
39df2093e8 pkg/lookup: Return ID-only pointers on ErrNo*Entries
Callers that only care about the IDs should try to convert the
identifier to an integer before calling the Get* functions, so they
can save the cost of hitting the filesystem and maybe or maybe not
finding the other fields (User.Name, etc.).  But callers that *want*
the other fields but only actually need the ID can, with this commit,
just call the Get* function and ignore ErrNo*Entries responses:

  user, err := lookup.GetUser(mount, userIDorName)
  if err != nil && err != ErrNoPasswdEntries {
    return err
  }

Previously, they'd have to perform their own integer-conversion
attempt in Get* error handling, with logic like:

  user, err := lookup.GetUser(mount, userIDorName)
  if err == ErrNoPasswdEntries {
    uuid, err := strconv.ParseUint(userIDorName, 10, 32)
    if err == nil {
      user.Uid = int(uuid)
    }
  } else if err != nil {
    return err
  }

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-04 14:46:43 -08:00
320085a04d Merge pull request #1942 from baude/rmi_test
test for rmi with children
2018-12-04 13:13:57 -08:00
aba52cf588 Merge pull request #1939 from mheon/no_firewall_if_rootless
Don't initialize CNI when running as rootless
2018-12-04 12:55:40 -08:00
0cd83466db test for rmi with children
Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 14:22:11 -06:00
b81f640bb5 Merge pull request #1920 from wking/explicit-hooks-dirs
libpod/container_internal: Deprecate implicit hook directories
2018-12-04 12:19:48 -08:00
a01a590ae8 Merge pull request #1933 from giuseppe/update-runc-again
test: update runc again
2018-12-04 12:08:20 -08:00
f1770ea0ef Merge pull request #1932 from giuseppe/vendor-storage
vendor: update containers/storage
2018-12-04 12:08:11 -08:00
650f95cb06 libpod/container_internal_linux: Allow gids that aren't in the group file
When an image config sets config.User [1] to a numeric group (like
1000:1000), but those values do not exist in the container's
/etc/group, libpod is currently breaking:

  $ podman run --rm registry.svc.ci.openshift.org/ci-op-zvml7cd6/pipeline:installer --help
  error creating temporary passwd file for container 228f6e9943d6f18b93c19644e9b619ec4d459a3e0eb31680e064eeedf6473678: unable to get gid 1000 from group file: no matching entries in group file

However, the OCI spec requires converters to copy numeric uid and gid
to the runtime config verbatim [2].

With this commit, I'm frontloading the "is groupspec an integer?"
check and only bothering with lookup.GetGroup when it was not.

I've also removed a few .Mounted checks, which are originally from
00d38cb3 (podman create/run need to load information from the image,
2017-12-18, #110).  We don't need a mounted container filesystem to
translate integers.  And when the lookup code needs to fall back to
the mounted root to translate names, it can handle erroring out
internally (and looking it over, it seems to do that already).

[1]: https://github.com/opencontainers/image-spec/blame/v1.0.1/config.md#L118-L123
[2]: https://github.com/opencontainers/image-spec/blame/v1.0.1/conversion.md#L70

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-04 12:00:42 -08:00
32aa45e344 Don't initialize CNI when running as rootless
We don't use CNI to configure networks for rootless containers,
so no need to set it up. It may also cause issues with inotify,
so disabling it resolves some potential problems.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-04 14:57:06 -05:00
f31c1c8c09 Merge pull request #1938 from baude/rmichildren
correct algorithm for deleting all images
2018-12-04 11:50:15 -08:00
41a7bd9c9e correct algorithm for deleting all images
when deleting all images, we need to iterate all the images deleting on those who dont
have children first. And then reiterate until they are all gone.

This resolves #1926

Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 13:13:54 -06:00
e3882cfa2d Use runtime lockDir in BoltDB state
Instead of storing the runtime's file lock dir in the BoltDB
state, refer to the runtime inside the Bolt state instead, and
use the path stored in the runtime.

This is necessary since we moved DB initialization very far up in
runtime init, before the locks dir is properly initialized (and
it must happen before the locks dir can be created, as we use the
DB to retrieve the proper path for the locks dir now).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-04 13:58:51 -05:00
480a179f01 Merge pull request #1894 from jwhonce/bug/1876
Only include container SizeRootFs when requested
2018-12-04 08:16:15 -08:00
6c060b1ca4 Merge pull request #1907 from baude/createpodautomatically
create pod on the fly
2018-12-04 07:49:06 -08:00
a90f2218dc test: update runc again
the regression we noticed in runc was fixed upstream:

https://github.com/opencontainers/runc/pull/1943

so we can use again runc from master.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-04 16:29:11 +01:00