Commit graph

1013 commits

Author SHA1 Message Date
Aleksa Sarai
65527da361
test: add logging tests
The main purpose of these tests is to make sure that the log actually
contains output from the container. We don't test the timestamps or the
stream that's stated at the moment.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:58 +10:00
Aleksa Sarai
c31f2cf0ee
test: unset log_* in configurations
This is necessary, as otherwise ocid will use its own current directory
as a log_directory, which is not the best idea in the world. The same
applies for log_path.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:58 +10:00
Mrunal Patel
1dc4c87c93
conmon: add timestamps to logs
CRI requires us to timestamp our logs line-by-line by specifying whether
the line came from std{out,err} and the time at which the log was
recieved. This is a preliminary implementation of said behaviour
(without explicit newline handling at the moment).

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:57 +10:00
Aleksa Sarai
14a37fb407
conmon: use pipes rather than socketpairs for !terminal
While pipes have their downsides, it turns out that socketpair(2) will
break any program that tries to open /dev/std{out,err} for writing
(because they're symlinked to /proc/1/fd/{1,2} which will cause lots of
fun issues with sockets).

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:57 +10:00
Aleksa Sarai
c290c0d9c3
conmon: implement logging to logPath
This adds a very simple implementation of logging within conmon, where
every buffer read from the masterfd of the container is also written to
the log file (with errors during writing to the log file ignored).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:57 +10:00
Aleksa Sarai
266c757cc6
runc: update to 31980a53ae7887b2c8f8715d13c3eb486c27b6cf
This is necessary for --console-socket.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:56 +10:00
Aleksa Sarai
00589b3682
test: fix runtimeversion test
The runtimeversion test was incorrectly written and would fail for no
good reason if setup_ocid happened to run a command that failed (even if
it was handled).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:56 +10:00
Aleksa Sarai
8f280dc5c6
oci: ignore silly lint errors
checking lint
  oci/oci.go:372:⚠️ declaration of err shadows declaration at oci.go:240:  (vetshadow)
  oci/oci.go:265:15⚠️ error return value not checked (os.RemoveAll(logPath)) (errcheck)

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-05 02:45:56 +10:00
Samuel Ortiz
be5084387c server: Serialize container/pod creation with updates
Interleaving asynchronous updates with pod or container creations can
lead to unrecoverable races and corruptions of the pod or container hash
tables. This is fixed by serializing update against pod or container
creation operations, while pod and container creation operations can
run in parallel.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-04-04 18:43:21 +02:00
Samuel Ortiz
c89cc876d2
server: Remove Image Config hack
Now that the image package has fixes to support docker images v2s1,
we can remove our buildOCIProcessARgs() hack for empty image configs
and simplify this routine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-04-04 17:52:40 +02:00
Antonio Murdaca
a0071de607
read image config from docker v2s1 manifests
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-04-04 17:52:37 +02:00
Samuel Ortiz
d1006fdfbc server: Add new sandboxes to the sandbox hash table first
We want new sandboxes to be added to the sandbox hash table before
adding their ID to the pod Index registrar, in order to avoid potential
Update() races.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-04-04 17:22:34 +02:00
Aleksa Sarai
70883dbe6b
lint: bump cyclo
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-04 20:51:29 +10:00
Antonio Murdaca
6b704d1f78 Merge pull request #425 from mrunalp/ctr_status_labels
Add labels/annotations to container status
2017-04-04 11:17:44 +02:00
Mrunal Patel
c5e15cfd5f Add labels/annotations to container status
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-04-03 15:05:57 -07:00
Dan Williams
95846211c9 build: find dependencies for Go executables
To ensure that changing a dependency source file actually triggers
a rebuild of the core binaries when you type 'make', find their
dependencies and add them to the makefile's target dependencies.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2017-03-31 20:45:21 -05:00
Mrunal Patel
bbe2dea0a6 Merge pull request #423 from mrunalp/set_default_cwd
Set default working directory to /
2017-03-31 16:04:49 -07:00
Mrunal Patel
fd435256e7 Set default working directory to /
runc/runtime-spec doesn't allow empty working dir
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-31 14:04:16 -07:00
Antonio Murdaca
1ce8be1ccf Merge pull request #417 from surajssd/update-conmon-default-path
Update the default conmonPath
2017-03-31 18:30:22 +02:00
Mrunal Patel
fa467a30f1 Merge pull request #420 from mrunalp/fix_hostname
Set the container hostname same as pod hostname
2017-03-31 07:35:49 -07:00
Antonio Murdaca
3f59e18a7c Merge pull request #418 from mrunalp/user_lookup
User lookup
2017-03-31 09:47:42 +02:00
Dan Williams
9c44933b58 build: create a local GOPATH if none specified
Instead of requiring the developer to set up their own GOPATH somewhere,
do like Kubernetes and OpenShift Origin do:

git clone xxxxx
cd xxxxx
make

by creating an _output/ directory and linking the local source tree
into it, and setting that to be the GOPATH.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2017-03-30 15:01:22 -05:00
Mrunal Patel
c6897b5f62 Set the uid, gid and groups from container user
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-30 10:58:57 -07:00
Mrunal Patel
4ccc5bbe7c Set the container hostnames same as pod hostname
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-29 16:11:57 -07:00
Mrunal Patel
93b1ff5207 Merge pull request #416 from surajssd/readme-generate-config
Add instructions to generate config
2017-03-29 11:45:58 -07:00
Mrunal Patel
505bc2cbd5 Add function to lookup user in container /etc/{passwd,group}
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-29 11:18:35 -07:00
Mrunal Patel
f422235b3e Add function to safely open a file in container rootfs
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-29 11:16:53 -07:00
Suraj Deshmukh
fb41320527 Add instructions to generate config
`tutorial.md` was missing instructions to
generate config for the first time install.

Signed-off-by: Suraj Deshmukh <surajssd009005@gmail.com>
2017-03-29 21:24:58 +05:30
Suraj Deshmukh
c93c7cd1b8 Update the default conmonPath
After change in `Makefile` at #304 where `PREFIX`
has changed from `/usr` to `/usr/local` these changes
has to be reflected in default `conmonPath`.

Signed-off-by: Suraj Deshmukh <surajssd009005@gmail.com>
2017-03-29 21:23:52 +05:30
Mrunal Patel
f2ce1fff0a Merge pull request #414 from rhatdan/vendor
Vendor in latest code.
2017-03-28 16:21:27 -07:00
Daniel J Walsh
549d734da9 Vendor in latest code.
Add support for vendoring in containers/storage and ran
dep ensure

Need to get default storage for containers to include and default to
overlay2.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-28 17:01:08 -04:00
Antonio Murdaca
7c6443c592 Merge pull request #412 from mrunalp/image_wd_env
Apply working dir and env from image config
2017-03-28 10:49:20 +02:00
Mrunal Patel
8709f1b5bb Apply working dir and env from image config
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-03-27 16:41:43 -07:00
Mrunal Patel
89105eb736 Merge pull request #408 from mrunalp/lint_fixes
Fix lint issues
2017-03-27 14:33:31 -07:00
Mrunal Patel
d69ad9b5a3 Fix lint issues
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-27 10:21:30 -07:00
Antonio Murdaca
37f118d73a Merge pull request #398 from rhatdan/containers_storage
Default all container storage to /var/lib/containers/storage
2017-03-25 08:22:11 +01:00
Antonio Murdaca
fdec993e62 Merge pull request #365 from jawnsy/update-readme
Updates to README.md
2017-03-25 08:16:20 +01:00
Jonathan Yu
e53e70d12a Updates to README.md
* Describe how to get source/configure GOPATH appropriately
* Dependency installation commands that can be easily copied/pasted

Signed-off-by: Jonathan Yu <jawnsy@redhat.com>
2017-03-24 14:49:05 -07:00
Antonio Murdaca
a752a72ee0 Merge pull request #406 from mrunalp/fixup_prereqs
Cleanup prerequisites section in README.md
2017-03-24 22:03:33 +01:00
Mrunal Patel
b7c97540b7 make: Fixup install/invocation of tools
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-24 11:18:37 -07:00
Antonio Murdaca
a7492f4a2f Merge pull request #405 from nalind/pull-tag
Preserve the tag of the pulled image's name
2017-03-24 19:16:23 +01:00
Mrunal Patel
ae9b5849a7 Cleanup prerequisites section in README.md
Make it easier to copy/paste and run.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-24 10:59:24 -07:00
Nalin Dahyabhai
e7748cba6e Preserve the tag of the pulled image's name
When we pull an image, preserve the tag portion of the name that we were
asked to use for pulling it, instead of unconditionally replacing it
with "latest".

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-24 11:54:56 -04:00
Mrunal Patel
4cdc1a31d6 Merge pull request #404 from sameo/topic/resolver
Propagate the sandbox DNS mount point to pod containers
2017-03-24 08:48:13 -07:00
Samuel Ortiz
48a297ed7b container: Propagate the pod sandbox resolv.conf mount point
When a pod sandbox comes with DNS settings, the resulting resolv.conf
file needs to be bind mounted in all pod containers under
/etc/resolv.conf.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-03-24 15:32:16 +01:00
Samuel Ortiz
72129ee3fb sandbox: Track and store the pod resolv.conf path
When we get a pod with DNS settings, we need to build
a resolv.conf file and mount it in all pod containers.
In order to do that, we have to track the built resolv.conf
file and store/load it.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-03-24 15:28:14 +01:00
Daniel J Walsh
89be1e9f35 Switch to using opencontainers/selinux
We have moved selinux support out of opencontainers/runc into its
own package.  This patch moves to using the new selinux go bindings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-24 08:20:11 -04:00
Daniel J Walsh
6f81ec8c67 Default all container storage to /var/lib/containers/storage
containers/storage is defaulting to /var/lib/containers/storage
for image and containers storage.  It is also defaulting to
/var/run/containers/storage for all runtime.  The defaults
for CRI-O should match so that lots of other tools that use
containers/storage can share the same storage.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-24 08:19:08 -04:00
Antonio Murdaca
673b6e4c51 Merge pull request #400 from sameo/topic/oci-process
server: Fix the OCI process arguments build routine
2017-03-24 09:07:00 +01:00
Mrunal Patel
2f761ff0ad Merge pull request #399 from rhatdan/selinux
Switch to using opencontainers/selinux
2017-03-23 14:08:37 -07:00