Commit Graph

38 Commits

Author SHA1 Message Date
Michael Crosby 044e298507 Improve error handling in runc
The error handling on the runc cli is currenly pretty messy because
messages to the user are split between regular stderr format and logrus
message format.  This changes all the error reporting to the cli to only
output on stderr and exit(1) for consumers of the api.

By default logrus logs to /dev/null so that it is not seen by the user.
If the user wants extra and/or structured loggging/errors from runc they
can use the `--log` flag to provide a path to the file where they want
this information.  This allows a consistent behavior on the cli but
extra power and information when debugging with logs.

This also includes a change to enable the same logging information
inside the container's init by adding an init cli command that can share
the existing flags for all other runc commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-09 11:08:30 -08:00
Mike Brown 171e8f4818 adds the spec required state command
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-03-01 14:11:46 -06:00
Mike Brown f4e37ab63e updating usage for runc and runc commands
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-02-17 09:00:39 -06:00
Michael Crosby 8eb1dcb916 Bump to version 0.0.8
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-09 11:35:55 -08:00
Michael Crosby a7278cad98 Require containerd id as arg 1
Closes #532

This requires the container id to always be passed to all runc commands
as arg one on the cli.  This was the result of the last OCI meeting and
how operations work with the spec.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-09 11:20:55 -08:00
Mike Brown c2c0458598 merges latest spec with runc
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-02-05 12:47:09 -08:00
Michael Crosby 8dfa57234c Remove double exec from command list
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-01-28 14:16:19 -08:00
Michael Crosby bb6a747825 Add detach to runc
By adding detach to runc the container process is the only thing running
on the system is the containers process.
This allows better usage of memeory and no runc process being long
lived.  With this addition you also need a delete command because the
detached container will not be able to remove state and the left over
cgroups directories.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-01-28 13:35:13 -08:00
Michael Crosby 480e5f4416 Merge pull request #507 from mikebrow/runc-ls-command
adds list command
2016-01-28 13:20:07 -08:00
Mike Brown 4c871267db adds list command, and a timestamp in the container state
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-01-28 14:21:06 -06:00
Alexander Morozov fb2718f8d0 Bump runc version to 0.0.7
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-01-25 13:47:54 -08:00
Michael Crosby 59f3066c39 Merge pull request #405 from marcosnils/spec_version
Add spec version to runC version cli
2016-01-22 13:55:28 -08:00
xlgao-zju 3ff8e80662 update version for release 0.0.6
Signed-off-by: xlgao-zju <xlgao@zju.edu.cn>
2015-12-16 23:25:19 +08:00
Tianon Gravi e001f947d7 Bump version constant to 0.0.5 in preparation for a new release
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-11-20 13:42:42 -08:00
Marcos Lilljedahl c38fee100d Add spec version to runC version cli
Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2015-11-17 19:14:02 -03:00
Mike Brown 8b19581694 adding support for --bundle -b to start, restore, and spec; fixes issue #310
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2015-11-13 09:13:57 -06:00
Eric Myhre 2add2bc41a Add ability to use json structured logging format.
Signed-off-by: Eric Myhre <hash@exultant.us>
2015-10-13 22:57:07 -05:00
Lai Jiangshan ac56948250 update the command usage of `runc`
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2015-09-16 09:49:06 +08:00
Alexander Morozov ea5032bc5e Adjust runc to new opencontainers/specs version
I deleted possibility to specify config file from commands for now.
Until we decide how it'll be done. Also I changed runc spec interface to
write config files instead of output them.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-15 08:35:25 -07:00
Qiang Huang 8f35c181b2 Minor comments fix
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-09-07 10:39:22 +08:00
Michael Crosby 5a3ebbdb1f Add --debug-log flag
Add a `--debug-log` flag for specifying a path to write the debug logs
to for runc.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-08-28 10:48:52 -07:00
Mrunal Patel 7291a52148 Merge pull request #210 from duglin/AddExecCmd
Add a 'start' command
2015-08-25 08:21:23 -07:00
Doug Davis 714ae2acc9 Add a 'start' command
When any non-global-flag parameter appears on the command line make sure
there's a "command" even in the 'start' (run) case to ensure its not
ambiguous as to what the arg is. For example, w/o this fix its not
clear if
   runc foo
means 'foo' is the name of a config file or an unknown command.  Or worse,
you can't name a config file the same a ANY command, even future (yet to
be created) commands.

We should fix this now before we ship 1.0 and are forced to support this
ambiguous case for a long time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-08-21 15:26:34 -07:00
Tonis Tiigi 47f294d0ed Add exec command
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-19 12:01:38 -07:00
Tonis Tiigi bc38c9d1b0 Add pause/resume commands
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-18 13:37:36 -07:00
Doug Davis 88de2aee5a Minor update to usage/help text
Seemed a little out of date

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-08-10 12:56:53 -07:00
rajasec 067890ce20 container kill support
Signed-off-by: rajasec <rajasec79@gmail.com>
2015-08-03 16:12:20 +05:30
Alexander Morozov 11ef5bfcd9 Change default state directory to /run/oci
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 17:02:56 -07:00
Michael Crosby 845fc65e54 Create linux spec for runc spec command
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-02 13:45:56 -07:00
Marianna 5aa82c950d Enable build on unsupported platforms
Should compile now without errors but changes needed to be added for each system so it actually works.
main_unsupported.go is a new file with all the unsupported commands
Fixes #9

Signed-off-by: Marianna <mtesselh@gmail.com>
2015-06-29 17:03:44 -07:00
Michael Crosby 4c829ea2ad Add version check for spec
We need this version check during our initial work so that runc does not
fail silently while make changes to runc to match the spec work going
on.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-29 13:30:35 -07:00
John Howard cd28283c79 Windows: Remove nsenter dependency
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-28 17:04:16 -07:00
Alexander Morozov 4d6c19af8b Fix absolute path getting for runc binary
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-26 14:56:53 -07:00
Alexander Morozov cc16e6b032 Merge pull request #30 from estesp/missing-rootfs-check
Make startup errors a bit friendlier
2015-06-26 09:03:49 -07:00
Phil Estes 936ca1b78d Update usage content and fix typos
1. Remove mention of nsinit (removed from the repo)
2. Make basic usage text a bit more informative; fix typo
3. Fix typo in panic() message (that should never be seen) :)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-25 16:26:31 -07:00
Phil Estes 9c56596f24 Make startup errors a bit friendlier
A couple minor changes to error handling in startup:
1. Don't dump full help/usage text when the only problem is `runc` wasn't started under
root privileges
2. Check for rootfs and make error clear to user when it doesn't exist
3. Change fatal to logrus.Fatal to get nicer output with simple error
message

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-25 00:19:44 -07:00
Phil Estes 1e24fe814d Allow runc to be executed as a relative path
This allows "./runc .." instead of adding it to $PATH location

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-24 11:14:46 -07:00
Michael Crosby 9fac183294 Initial commit of runc binary
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:34:13 -07:00