Commit Graph

6355 Commits

Author SHA1 Message Date
OpenShift Merge Robot ef29a30712
Merge pull request #2088 from giuseppe/umask-to-0
podman: set umask to 022
2019-01-07 05:26:34 -08:00
Giuseppe Scrivano 4d31065cc5
podman: set umask to 022
be sure there are no bits in the umask that prevent us for creating
directories with mode 0755.  Set the umask very early in the program
startup.

Closes: https://github.com/containers/libpod/issues/2074

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-07 13:53:15 +01:00
Valentin Rothberg 2c75cd92aa podman-login: adhere to user input
* Do not try to login with existing credentials when the user specifies a
  username or password on the CLI.

* Improve error messages.

* Use specified tls-verify switch and cert-dir for all requests.

Fixes: #2092
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-07 12:07:31 +01:00
OpenShift Merge Robot 1e4db4b0b8
Merge pull request #2089 from rhatdan/locks
Rootless with shmlocks was not working.
2019-01-06 23:16:55 -08:00
OpenShift Merge Robot b83b07cb47
Merge pull request #2082 from rhatdan/runc
Update vendor of runc
2019-01-06 17:27:50 -08:00
OpenShift Merge Robot 49a474c4b7
Merge pull request #2090 from rhatdan/buildah
Vendor in latest containers/buildah code
2019-01-06 17:15:10 -08:00
Daniel J Walsh ba89a05888
Vendor in latest containers/buildah code
This should improve the speed of podman build.
Has fixes from containres/image for parallell pull.

Also vendor containers/storage and containers/image

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-05 16:50:40 -05:00
Daniel J Walsh a76256834a
Rootless with shmlocks was not working.
This patch makes the path unigue to each UID.

Also cleans up some return code to return the path it is trying to lock.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-05 07:37:21 -05:00
OpenShift Merge Robot 4e0c0ecbc3
Merge pull request #2085 from mheon/readd_python
Readd Python testing
2019-01-04 19:48:54 -08:00
Matthew Heon 57d2a56920 Readd Python testing
We accidentally merged a PR with a commit temporarily disabling
the Python tests. Reenable them here.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-04 16:16:52 -05:00
OpenShift Merge Robot a5496e6096
Merge pull request #2084 from cevich/no-slash-lgtm
[skip ci] Docs: Add Bot Interactions section
2019-01-04 12:08:20 -08:00
Daniel J Walsh 43686072d3
Update vendor of runc
Updating the vendor or runc to pull in some fixes that we need.
In order to get this vendor to work, we needed to update the vendor
of docker/docker, which causes all sorts of issues, just to fix
the docker/pkg/sysinfo.  Rather then doing this, I pulled in pkg/sysinfo
into libpod and fixed the code locally.

I then switched the use of docker/pkg/sysinfo to libpod/pkg/sysinfo.

I also switched out the docker/pkg/mount to containers/storage/pkg/mount

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-04 14:54:59 -05:00
Chris Evich 4606ca8fa6
[skip ci] Docs: Add Bot Interactions section
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-01-04 14:51:20 -05:00
baude 10a62d60a9 container runlabel NAME implementation
when using container runlabel, if a --name is not provided, we must
deduce the container name from the base name of the image to maintain
parity with the atomic cli.

fixed small bug where we split the cmd on " " rather than using fields could
lead to extra spaces in command output.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-04 12:57:55 -06:00
OpenShift Merge Robot bf5f779331
Merge pull request #1235 from mheon/shm_locking
SHM locking for Libpod
2019-01-04 10:41:05 -08:00
Matthew Heon 56c5c89408 Bump time for build_each_commit step
The limit of build_each_commit seems to be 17 commits - any more
and it times out. Give it a bit more time to work with.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-04 10:23:36 -05:00
Matthew Heon 97681a5f2b Move lock init after tmp dir is populated properly
Don't initialize the lock manager until almost the end of libpod
init, so we can guarantee our tmp dir is properly set up and
exists. This wasn't an issue on systems that had previously run
Podman, but CI caught it.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-04 09:51:09 -05:00
Matthew Heon 01858c0eba DO NOT MERGE temporarily remove python tests
It's impossible to get good debug out of the python tests, so
nuke them for now so I can figure out what's wrong.

DO NOT MERGE THIS COMMIT

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-04 09:51:09 -05:00
Matthew Heon 16a5cbfac5 When refreshing libpod, if SHM locks exist, remove them
This will hopefully help cases where libpod is initialized
multiple times on the same system (as on our CI tests).

We still run into potential issues where multiple Podmans with
multiple tmp paths try to run on the same system - we could end
up thrashing the locks.

I think we need a file locks driver for situations like that. We
can also see about storing paths in the SHM segment, to make sure
multiple libpod instances aren't using the same one.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-04 09:51:09 -05:00
Matthew Heon 31df5e0e85 Ensure different error messages and creating/opening locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon 625c7e18ef Update unit tests to use in-memory lock manager
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon 35361595f3 Remove runtime lockDir and add in-memory lock manager
Remove runtime's lockDir as it is no longer needed after the lock
rework.

Add a trivial in-memory lock manager for unit testing

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon d4b2f11601 Convert pods to SHM locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon 3de560053f Convert containers to SHM locking
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon a364b656ea Add lock manager to libpod runtime
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon e73484c176 Move to POSIX mutexes for SHM locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:51:09 -05:00
Matthew Heon f38fccb48c Disable lint on SHMLock struct
Golint wants to rename the struct. I think the name is fine. I
can disable golint. Golint will no longer complain about the
name.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon a21f21efa1 Refactor locks package to build on non-Linux
Move SHM specific code into a subpackage. Within the main locks
package, move the manager to be linux-only and add a non-Linux
unsupported build file.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 3ed81051e8 Add an SHM-backed Lock Manager implementation
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 185136cf0e Add interface for libpod multiprocess locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 35cc71a9e8 Improve documentation and unit tests for SHM locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 52d95f5072 Propogate error codes from SHM lock creation and open
Also add a few more unit tests

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon b489feff71 Add mutex invariant to SHM semaphores.
Check value of semaphores when incrementing to ensure we never go
beyond 1, preserving mutex invariants.

Also, add cleanup code to the lock tests, ensuring that we never
leave the locks in a bad state after a test. We aren't destroying
and recreating the SHM every time, so we have to be careful not
to leak state between test runs.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 27cebb780b Initial skeleton of in-memory locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
OpenShift Merge Robot 6868b5aa14
Merge pull request #2045 from vrothberg/init
add init support
2019-01-04 06:41:07 -08: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
Daniel J Walsh b0fcd555db
If local storage file exists, then use it rather then defaults.
Currently we always force overlay if it exists even though a user might want
vfs.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-03 16:25:02 -05:00
OpenShift Merge Robot 9ffd480616
Merge pull request #2071 from baude/vendorcs
vendor in new containers/storage
2019-01-03 12:14:24 -08:00
baude 561e65969f vendor in new containers/storage
vendor in latest containers/storage which contains a fix for when
a filesystem that overlayfs is on is ENOSPC.

adding pgzip/compress as a new dep for c/s

Signed-off-by: baude <bbaude@redhat.com>
2019-01-03 12:49:30 -06:00
OpenShift Merge Robot 1334696814
Merge pull request #2072 from rhatdan/completions
Fix completions
2019-01-03 10:26:10 -08:00
Daniel J Walsh 0c26aec2ae
Fix completions
Currently completions do not work.  podman generate kube and podman play kube
completions broke this.

Also fixed podman import to work properly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-03 11:57:55 -05:00
OpenShift Merge Robot 098c13418a
Merge pull request #2065 from TomSweeneyRedHat/dev/tsweeney/troublefix1
Touch up some troubleshooting nits
2019-01-02 12:02:43 -08:00
TomSweeneyRedHat a25b707fdb Touch up some troubleshooting nits
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-01-02 14:14:50 -05:00
OpenShift Merge Robot a634d5559f
Merge pull request #2068 from mheon/log_container_command
Log container command before starting the container
2019-01-02 10:56:49 -08:00
Matthew Heon a36006c2dc Warn on overriding user-specified storage driver w/ DB
Overriding storage.conf is not intuitive behavior, so pop up an
error message when it happens, so people know that bad things are
happening.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-02 12:54:54 -05:00
Matthew Heon 945d0e8700 Log container command before starting the container
Runc does not produce helpful error messages when the container's
command is not found, so print the command ourselves.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-02 12:11:50 -05:00
OpenShift Merge Robot e796f522f6
Merge pull request #2067 from mheon/fix_garbage_ports
Use sprintf to generate port numbers while committing
2019-01-02 07:55:24 -08:00
Matthew Heon 9c7d512136 Use sprintf to generate port numbers while committing
Casting integers to strings is definitely not correct, so let the
standard library handle matters.

Fixes #2066

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-02 10:26:44 -05:00
OpenShift Merge Robot 7438b7bd3a
Merge pull request #2052 from rhatdan/sparse
Add troubleshooting for sparse files
2018-12-31 08:23:29 -08:00
Daniel J Walsh ad36345fde
Add troubleshooting for sparse files
A common failure with people building container images is the
creation of large sparse files, particularly useradd creating
the lastlog file.

This PR Documents the failures.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-30 08:08:13 -05:00