Commit graph

2296 commits

Author SHA1 Message Date
80066151ba Makefile: target to for cross platform
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 11:56:35 -05:00
f387b33f84 utils: platform independent calls
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

utils: isolate unix only functions

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 11:56:35 -05:00
e937df1a07 main: some last platform indepent calls 2018-03-08 11:56:34 -05:00
cc39203b09 server: shuffle platform dependent operations 2018-03-08 11:56:34 -05:00
4d88008a65 server: abstract out linux capability per platform
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 11:56:34 -05:00
d6966951d6 oci: abstract out cgroup calls per platform
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

oci: abstract out syscall for platforms

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

oci: abstract out the unix pipe per platform

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

oci: change the unix calls to be platform independent

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 11:56:34 -05:00
fb87c2f68b *: abstract out netns for multiple platforms
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 11:56:32 -05:00
ebdec2ea5b lib/sandbox: clarify variable names
three uses of `ns` :-\

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 10:57:53 -05:00
f6a825d7e0 vendor: DELETEME
https://github.com/opencontainers/runc/pull/1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 10:57:53 -05:00
182e7f44ec vendor: DELETEME
once rebased on https://github.com/containers/image/pull/408

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-08 10:57:53 -05:00
Daniel J Walsh
f7c1adf303
Merge pull request #1336 from agonzalezro/debug-api
Add extra info to verbose requests to PodSandboxStatus
2018-03-08 13:05:06 +00:00
Daniel J Walsh
36edb146f1
Merge pull request #1420 from cevich/fix_install_to_readme
Fix two integration nits
2018-03-08 12:45:07 +00:00
Daniel J Walsh
34c3829282
Merge pull request #1430 from mrunalp/network_stop_master
sandbox_stop: Call CNI stop before stopping pod infra container
2018-03-08 12:34:42 +00:00
Álex González
adf249e283 Add extra info to verbose requests to PodSandboxStatus
If PodSandboxStatusRequest.Verbose is true now we are returning the cri-o
version in a JSON object for debug purposes. In the future extra information
(to be defined) should be added to the response

In order to avoid problems when we execute the tests in parallel the fixtures
for new test sandbox and container are creating their own random IDs and
returning them in case you need to refer to them.

Finally, "make testunit" is being run as root to solve a problem with a `chown`
that couldn't be performed otherwise.

This commit closes #1144

Signed-off-by: Álex González <agonzalezro@gmail.com>
2018-03-08 09:59:23 +01:00
Daniel J Walsh
78dd9735d0
Merge pull request #1423 from mheon/update_cni_versions
Update CNI config versions to 0.3.0
2018-03-08 08:50:26 +00:00
Daniel J Walsh
acfc59e102
Merge pull request #1410 from vbatts/platform-007
lib: libcontainer references are linux only
2018-03-08 08:49:44 +00:00
Mrunal Patel
b487411b65 sandbox_stop: Call CNI stop before stopping pod infra container
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2018-03-07 15:27:11 -08:00
Daniel J Walsh
e8c108d415
Merge pull request #1300 from rhatdan/listen_pid
Setup LISTEN_PID to point to new child process
2018-03-07 22:07:15 +00:00
Daniel J Walsh
2bac4d8a47 Setup LISTEN_PID to point to new child process
In order to get systemd socket passing to work properly
the listen PID needs to match the process ID of the OCI runtime.
This match modifies the LISTEN_PID if it is set to the new runtime.

conmon will check that the LISTEN_PID the pid that conmon is running as and
will ignore it if they are different.  But, if the caller specifies the
--replace-listen-pid flag, then the LISTEN_PID/LISTEN_FDS will always be used.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-03-07 22:06:57 +00:00
Daniel J Walsh
c189b8d147
Merge pull request #1409 from giuseppe/conmon-catch-signals
conmon: catch SIGTERM, SIGINT and SIGQUIT
2018-03-07 21:28:35 +00:00
Daniel J Walsh
986face946
Merge pull request #1368 from wking/conmon-Xf-variadic-macros
conmon: Distinguish pexit(s) from pexitf(fmt, ...) and similar
2018-03-07 21:27:14 +00:00
Chris Evich
9f14e51938
Fix a few CI-test nits
* The README.md doesn't metion an EPEL requirement, however it's needed
for installing python-boto on RHEL.  Add it to the list of requirements.

* Some gramatical errors were fixed.

* The ``system.yml`` install timeout (10 minutes) is cutting things aweful
close, esp. since it's dependent on both networking and external
services.  Double it to head-off possible future headaches.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-03-07 10:42:32 -05:00
ef6aa87c75
lib: libcontainer references are linux only
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-07 10:36:07 -05:00
Daniel J Walsh
cdc468afa8
Merge pull request #1421 from vbatts/vendor_update_runtime-tools
vendor: update runtime-tools to HEAD
2018-03-07 07:20:09 +00:00
Giuseppe Scrivano
7036d1c0c2
conmon: catch SIGTERM, SIGINT and SIQUIT
and forward them to the watched process.  A side effect is that we can
correctly invoke the exit command if conmon receives them.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-03-07 07:27:09 +01:00
Matthew Heon
f31726b610 Update CNI config versions to 0.3.0
We've been seeing conflicts with other CNI consumers where
CRI-O's configuration files are causing the CNI plugins to fail
to start because their versions are too low. Upgrading the plugin
versions should resolve this conflict, and not cause any adverse
effect to a typical CRI-O install.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-03-06 14:13:06 -05:00
a39495dc4b
vendor: update runtime-tools to HEAD
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-03-06 13:19:38 -05:00
Mrunal Patel
0e0c820f0c
Merge pull request #1417 from redbaron/use-getref
small refactor: use imageService.getRef wherever possible
2018-03-05 15:10:23 -08:00
Daniel J Walsh
9f37d3322f
Merge pull request #1416 from kragniz/src-name
Support src directory name other than cri-o
2018-03-05 16:53:57 -05:00
Mrunal Patel
01b118116d
Merge pull request #835 from aweiteka/vagrant
add dev vagrantfile
2018-03-04 10:08:54 -08:00
Daniel J Walsh
5ff4fdbe0e
Merge pull request #1412 from agonzalezro/remove-travis-steps
Remove unneeded/repeated Travis steps
2018-03-04 10:57:24 -05:00
Daniel J Walsh
b212244889
Merge pull request #1383 from vbatts/platform-002
lib: abstract out selinux call
2018-03-04 10:55:07 -05:00
Maxim Ivanov
8621fd907a small refactor: use imageService.getRef wherever possible
Signed-off-by: Maxim Ivanov <ivanov.maxim@gmail.com>
2018-03-04 09:55:55 +00:00
Louis Taylor
8c3e82e91d
Support src directory name other than cri-o
Signed-off-by: Louis Taylor <louis@kragniz.eu>
2018-03-04 02:16:18 +00:00
W. Trevor King
f3c9a6c4ab cmsg: Use do/while for error and errorf
Avoid:

  $ make clean && make CFLAGS='-Wpedantic' cmsg.o 2>&1 | head -n5
  rm -f conmon.o cmsg.o ../bin/conmon
  cc -Wpedantic -std=c99 -Os -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -c -o cmsg.o cmsg.c
  cmsg.c: In function ‘recvfd’:
  cmsg.c:30:2: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
    ({         \
    ^

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-03-03 14:58:35 -08:00
W. Trevor King
9356aa9dd8 conmon/cmsg: Distinguish error(s) from errorf(fmt, ...) and replace %m
The same as the last two commits, except for cmsg.c instead of
conmon.c.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-03-03 14:58:35 -08:00
W. Trevor King
f67d6ed25c conmon: Use strerror(errno) instead of %m
Avoid:

  $ make clean && make CFLAGS=-Wpedantic 2>&1 | head -n5
  rm -f conmon.o cmsg.o ../bin/conmon
  cc -Wpedantic -std=c99 -Os -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -c -o conmon.o conmon.c
  conmon.c: In function ‘write_k8s_log’:
  conmon.c:32:19: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=]
     fprintf(stderr, "[conmon:e]: %s %m\n", s);     \
                     ^

from printf(3) [1]:

  m (Glibc extension; supported by uClibc and musl.)  Print output of
    strerror(errno).  No argument is required.

strerror, on the other hand, is in POSIX [2].

[1]: http://man7.org/linux/man-pages/man3/printf.3.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-03-03 14:58:35 -08:00
W. Trevor King
9583581280 conmon: Distinguish pexit(s) from pexitf(fmt, ...) and similar
Avoid:

  $ make clean && make CFLAGS=-Wpedantic 2>&1 | head -n 5
  rm -f conmon.o cmsg.o ../bin/conmon
  cc -Wpedantic -std=c99 -Os -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -c -o conmon.o conmon.c
  conmon.c: In function ‘write_k8s_log’:
  conmon.c:342:33: warning: ISO C99 requires at least one argument for the "..." in a variadic macro
      ninfo("Creating new log file");
                                   ^

by distinguishing between calls with and without user-supplied
formatting.

Also remove some user-supplied newlines from the following

* nwarn for "Could not find newline in entire buffer"
* ninfo for "Got ctl message..."
* ninfo for "container %d exited with status..."
* nexitf for "Failed to write %s to exit file..."

because the macros add their own trailing newlines.

Also drop some redundant user-specified strerror() arguments from the
following:

* pexit for "Failed to open log file..."
* pexit for "Runtime path %s is not valid..."

because the pexit* macros add strerror on their own.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-03-03 14:58:35 -08:00
Daniel J Walsh
779e3501f3
Merge pull request #1122 from lsm5/debuginfo-puase
pause: do not strip binary
2018-03-03 10:25:03 -05:00
Daniel J Walsh
860fba80eb
Merge pull request #1401 from umohnani8/image
Fix create container failure due to wrong image reference
2018-03-03 10:18:09 -05:00
Daniel J Walsh
b9dc8e0a7c
Merge pull request #1404 from vbatts/vendor_update_runc
vendor: update runc to HEAD
2018-03-03 10:17:30 -05:00
Daniel J Walsh
8e744621ff
Merge pull request #1334 from sboeuf/ensure_ctr_stopped_2
crio: Ensure container state is stopped when calling StopContainer()
2018-03-03 10:16:16 -05:00
Sebastien Boeuf
1391c5c2fd crio: Ensure container state is stopped when calling StopContainer()
CRI-O works well with runc when stopping a container because as soon
as the container process returns, it can consider every container
resources such as its rootfs as being freed, and it can proceed
further by unmounting it.

But in case of virtualized runtime such as Clear Containers or Kata
Containers, the same rootfs is being mounted into the VM, usually as
a device being hotplugged. This means the runtime will need to be
triggered after the container process has returned. Particularly,
such runtimes should expect a call into "state" in order to realize
the container process is not running anymore, and it would trigger
the container to be officially stopped, proceeding to the necessary
unmounts.

The way this can be done from CRI-O, without impacting the case of
runc, is to explicitly wait for the container status to be updated
into "stopped" after the container process has returned. This way
CRI-O will call into "state" as long as it cannot see the container
status being updated properly, generating an error after a timeout.

Both PollUpdateStatusStopped() and WaitContainerStateStopped() make
use of go routines in order to support a timeout definition. They
follow the waitContainerStop() approach with chControl.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-02 14:55:29 -08:00
Daniel J Walsh
a5c3e05f9f
Merge pull request #1377 from mrunalp/sym_context_master
Add context to net ns symlink removal errors
2018-03-02 17:06:18 -05:00
Mrunal Patel
61a49a111d
Merge pull request #1392 from umohnani8/pid-ns
Enable per pod PID namespace setting
2018-03-02 13:33:14 -08:00
Álex González
3f2f3acf37 Remove unneeded/repeated Travis steps
Some steps are now being run with Go tip and not in all the different versions,
there were also moved to their own block so they will fail fast and in the mean
time the unit test for the different versions can start.

Also, "make docs" was removed because it's already being done by "make" without
any argument.

Fixes #1400.

Signed-off-by: Álex González <agonzalezro@gmail.com>
2018-03-02 22:02:32 +01:00
Daniel J Walsh
8e8224c5b6
Merge pull request #1406 from rhatdan/Makefile
Have make file create the oci/hooks.d directory
2018-03-02 13:56:58 -05:00
Daniel J Walsh
1d89b897f7
Merge pull request #1366 from giuseppe/conmon-additional-command-atexit
conmon: add new option to call cleanup program at exit
2018-03-02 13:23:52 -05:00
Mrunal Patel
ca1cd2b708
Merge pull request #1355 from wking/hook-docs-copy-edit
hooks: Copy-edits for the Markdown docs (RFC 2119, etc.)
2018-03-02 10:05:19 -08:00
Mrunal Patel
fe10bc81c6
Merge pull request #1403 from vbatts/vendor_update
vendor: _actually_ update containers/storage?
2018-03-02 10:04:20 -08:00