74 Commits

Author SHA1 Message Date
Dimitri John Ledkov ce7ad6b722 Merge branch 'master' of https://github.com/coreos/rkt 2015-05-20 14:22:19 +01:00
Iago López Galeiras 230dc1bc8c stage1: dlopen libsystemd instead of libsystemd-login
In systemd-209 libsystemd-login was merged into libsystemd and a
compatibility libsystemd-login library was created. Unfortunately,
distributions like Fedora don't ship the compatibility libraries so
runningFromUnitFile will always return false.

Fix it by dlopening libsystemd.so instead of libsystemd-login.so.
2015-05-18 11:23:58 +02:00
Dimitri John Ledkov 2416af1d35 Run lkvm in debug mode, when debugging is requested. 2015-05-14 13:48:32 +01:00
Dimitri John Ledkov fbe51e7d6c Use our ld.so, and our libraries. lsof output will be interesting. 2015-05-14 12:36:41 +01:00
Dimitri John Ledkov a072a99d16 Switch to uncompressed kernel. 2015-05-12 18:25:04 +01:00
Dimitri John Ledkov 34a3cbbbe8 Mount plan9 mounts inside the guest. 2015-05-12 13:40:30 +01:00
Dimitri John Ledkov 138ecb062d Add p9 read-write mounts for volumes. 2015-05-08 17:04:03 +01:00
Dimitri John Ledkov 8b9b4c062a Merge branch 'master' of https://github.com/coreos/rkt
Conflicts:
	stage1/init/init.go
	stage1/init/pod.go
2015-05-08 15:48:40 +01:00
Jonathan Boulle d61a4c52d7 Merge pull request #878 from endocode/iaguis/keep-unit
stage1: use systemd-nspawn's --keep-unit
2015-05-07 17:33:41 -07:00
Iago López Galeiras 3cbfa313f9 stage1: use systemd-nspawn's --keep-unit
If we're running from a unit file, we pass --keep-unit to systemd-nspawn
to avoid being moved to a different cgroup.
2015-05-07 15:24:00 -07:00
Jonathan Boulle 4c64fa6e93 Merge pull request #861 from jonboulle/copyright
*: adjust copyright header + remove NOTICE
2015-05-07 14:38:45 -07:00
Dimitri John Ledkov fad2dbf922 Implement kvm containment in stage1. 2015-05-06 15:41:29 +01:00
Jonathan Boulle 9685f37575 *: adjust copyright header
Inspired by a similar change in the Kubernetes project [1], this changes
the copyright header to the more generic "The rkt Authors" rather than
"CoreOS, Inc.", which is only sometimes correct.

https://github.com/GoogleCloudPlatform/kubernetes/commit/6b3a6e6b983f967c88d14d26542ec6e30c49ebd3
2015-05-03 14:29:15 -07:00
Yifan Gu 6a97d6f65e stage1/init: Use pod manifest to get forwarded ports
Instead of using image manifest to get forwarded ports, we should
use pod manifest.
2015-05-02 17:14:22 -07:00
Alban Crequy e3bd37dafa stage1: systemd: register only if systemd on the host supports it 2015-04-28 17:24:52 +02:00
Alban Crequy d0d2396079 diagexec: non-root apps 2015-04-24 10:47:58 +02:00
Jonathan Boulle 19fee5b4f4 Merge pull request #754 from klizhentas/master
stage1: pass arguments for keeping lock and writing PID
2015-04-17 11:14:24 -07:00
Alexander Klizhentas 2cdcd631d0 stage1: pass lock and PID args for stage1 "src" flavor. refs coreos/rkt#753 2015-04-15 14:40:17 -07:00
Eugene Yakubovich bf33546a2d net: stage1 gc will clean up networking 2015-04-14 17:03:03 -07:00
Eugene Yakubovich d86dc77ce8 Merge pull request #731 from eyakubovich/extra-log-lines
stage1: discard logger output if no --debug is present
2015-04-08 10:18:01 -07:00
Eugene Yakubovich 8a83cf9e87 Merge pull request #703 from eyakubovich/expose-ports
net: add option to expose ports on hosts
2015-04-07 10:50:27 -07:00
Jonathan Boulle 006e2c4b31 stage1: rename container{,_test}.go -> pod{,_test} 2015-04-06 15:21:58 -07:00
Jonathan Boulle ca3910dd21 stage1: set systemd-nspawn machine to pod UUID 2015-04-06 14:34:48 -07:00
Eugene Yakubovich e01d4f2e02 stage1: discard logger output if no --debug is present
Also cleans up log.SetOutput handling in stage0 to only
do it once in main based on --debug.

Fixes #709
2015-04-06 13:09:25 -07:00
Eugene Yakubovich dbc1f0f238 net: add option to expose ports on hosts
Ports that were defined in app manifest can be
exposed via --port=name:host-port option on cmd line.
For example, given app manifest with ports entry:
{
    "name": "http",
    "port": 80,
    "protocol": "tcp"
}

rkt run --private-net --port=http:8888 myapp.aci
will forward traffic from host's tcp port 8888 to
container's port 80.

Fixes #624
2015-04-03 17:24:02 -07:00
Jonathan Boulle 79753c9b19 *: rocket -> rkt 2015-03-31 16:31:21 -07:00
Jonathan Boulle 3fd0303076 *: global containers -> pods rename 2015-03-31 15:55:06 -07:00
Jonathan Boulle 19dae09039 Merge pull request #697 from vcaputo/defaultenv
stage1/init: set minimum appc-required environment defaults
2015-03-30 19:05:18 -07:00
Vito Caputo 95d056b6aa stage1/init: set minimum appc-required environment defaults
These are currently being set to static root values, will revisit once
the spec matures in this area.

Fixes #687
2015-03-30 17:04:39 -07:00
Eugene Yakubovich ebdc1503df mdsvc: no more 169.254.196.255 address
Since the spec requires AC_METADATA_URL env var,
well known IP is no longer needed. This removes
the iptables manipulation. Instead the IP address of the
host is passed in the AC_METADATA_URL. This host IP
is the address of the host end of the default veth.
2015-03-30 16:04:56 -07:00
Eugene Yakubovich 38a1003a4f docs: add metadata service documentation
Also point the user to the docs in case the
metadata service is not running and registration fails.

Fixes #622
2015-03-26 12:03:30 -07:00
Eugene Yakubovich f030f05f02 mdsvc: use Unix socket for registration
Using allows Unix socket allows for limiting who can
register/unregister containers by setting proper
permissions on the socket.

Fixes #437
2015-03-26 11:39:19 -07:00
Eugene Yakubovich d06e5eb6f6 Merge pull request #673 from eyakubovich/appc-vendor
spec: bump to 0.5.0+git; UUID removed from pod
2015-03-25 17:30:12 -07:00
Eugene Yakubovich 554ab1a270 re-vendor appc/spec; fixup pod related changes
* UUID is no longer part of manifest
* Metadata URLs changed
2015-03-25 16:47:55 -07:00
Yifan Gu f0d12d453c stage1: Override image manifest's readOnly field of the volume mounts.
If the readOnly field of the volume mounts in pod manifest
is non-nil, then use it to override the image manifest's readOnly field
of the volume mounts.
2015-03-25 11:24:10 -07:00
Jonathan Boulle 56530ef74e *: update to 0.5.0 spec 2015-03-24 18:49:50 -07:00
Vito Caputo fdcd649471 stage1: add support for building stage1's usr from src
Currently only systemd is being built from source, toggled from the
top-level build script by setting RKT_STAGE1_USR_FROM=src, e.g:
RKT_STAGE1_USR_FROM=src ./build

The default stage1 continues to be coreos-derived, but may be explicitly
specified via:
RKT_STAGE1_USR_FROM=coreos ./build

The stage1 init program has been modified to introspect the "flavor" of
stage1 at runtime, which influences how it invokes systemd-nspawn.

A small series of patches are included to give systemd-nspawn the
functionalities enabled via LD_PRELOAD of the shim in the coreos-derived
stage1.

The systemd source is cloned at build time the first time an
RKT_STAGE1_USR_FROM=src build is performed, at this time the same version
as the coreos image provided is being used, but this can be bumped in the
future.
2015-03-23 19:08:20 -07:00
Eugene Yakubovich 0b935f467f net: set FD_CLOEXEC on RktLock prior to fork/exec
When launching metadata service and net plugins,
set the close-on-exec flag so the child processes
don't end up holding the lock.
2015-03-19 17:14:31 -07:00
Iago López Galeiras 19b1d2414d stage1: support interactive containers
By using systemd's Standard{Input,Output,Error} options we set
/dev/console in stage1 as the tty for the app (see systemd.exec(5)).
This makes interactive executables like bash work with rkt run (or
prepare+run-prepared).

This is only supported if the container has only one app.
2015-03-12 20:22:01 +01:00
Jonathan Boulle 399e5b0308 Godeps: bump appc to latest master
This is to capture the bugfix from https://github.com/appc/spec/pull/234

The real solution here is to fix
https://github.com/appc/spec/pull/235, bump the spec, and then vendor
the new release, but rolling this in now so that isolators are fixed on
master.
2015-03-11 16:06:26 -07:00
Jonathan Boulle 63bb0846c3 rkt: metadatasvc -> metadata-service 2015-03-11 11:37:29 -07:00
Brandon Philips 3d10d1b56b Merge pull request #585 from vcaputo/sysd-exec-double-dollars
stage1/init: escape $'s in exec arguments by doubling them
2015-03-09 18:17:08 -07:00
Vito Caputo 47125158cc stage1/init: escape $'s in exec arguments by doubling them 2015-03-09 17:15:05 -07:00
Vito Caputo 9ce3c4d37a rkt: support passing arguments to apps on the cli
`rkt run` and `rkt prepare` can now receive arguments on the commandline
which get appended to the default exec arguments of the preceding app
image.

Examples:

 Append --foo=bar to the second aci in a two aci invocation:
  `rkt run bar.aci foo.aci -- --foo=bar`

 Append options to both acis:
  `rkt run bar.aci -- --foobar --- foo.aci -- --woot`
  or if preparing:
  `rkt prepare bar.aci -- --foobar --- foo.aci -- --woot`

Also lays groundwork for general support of CRM overrides, though only argument
appending has been plumbed to the rkt commandline.

Fixes #564

Conflicts:
	stage0/run.go
2015-03-08 04:32:17 -04:00
Brandon Philips b6f95744a8 rkt: updates based on appc spec changes
- Use the new object based isolators
- Update to the RuntimeImage schema change
2015-03-08 04:14:02 -04:00
Alban Crequy e54bb884fc stage1: prepare-app: prepare /dev and /proc for apps
prepare-app runs in stage1, so it knows how to handle dynamic
/dev/console.

It does not change diagexec so it does not break rkt enter.

Bind mount individual /dev entries instead of bind mounting the /dev
directory so rkt run --volume /dev/sda6 (performed in stage0) should
still work.

Do not use a bunch of systemd mount units because they don't create
nonexistent target files. See:
http://lists.freedesktop.org/archives/systemd-devel/2015-February/028657.html
We might revisit this option if systemd mount units automatically create
the nonexistent target files.

Avoid systemd option PrivateDevices to avoid shadowing additional bind
mounts passed with --volume.
2015-03-03 14:25:04 +01:00
Jonathan Boulle 72395d1ffa *: vendor appc spec
Take two at getting the spec vendored into Rocket with Godep.
Since actool is used during the construction of the stage1.aci, it
really needs to be vendored too to prevent any unexpected divergence
between whatever version the user happens to have in their PATH. Thus,
we introduce a silly dummy package (stage1/dummy.go) to coerce Godep
into vendoring actool. This also requires a slight rearrangement of the
appc repo, moving some functionality from actool itself into the aci
package.
2015-02-05 14:36:40 +01:00
Eugene Yakubovich 46706d271f Merge pull request #468 from eyakubovich/md-svc-spawn
metadatasvc: process --spawn-metadata-svc in stage0
2015-02-04 18:08:28 -08:00
Eugene Yakubovich 389bd29b72 metadatasvc: process --spawn-metadata-svc in stage0
--spawn-metadata-svc is just a helper to launch another
program. It's not stage1 specific and stage0 feels like
a better place for it.
2015-02-04 17:29:36 -08:00
Vito Caputo 310b3e1d7f stage1: set app environment via diagexec instead of systemd
This change places per-app environment files in stage1/rootfs/rkt/env/$id

The stage1 systemd service files no longer contain Environment directives,
instead they simply supply the env file path to diagexec.

`rkt enter` also uses diagexec and needs to enter the same enviroment of the
app being entered.  This commit also modifies the stage1 /enter to supply the
env file to its diagexec invocation, giving `rkt enter` an environment
consistent with the app's.
2015-02-04 17:08:58 -08:00