Commit Graph
1469 Commits
Author SHA1 Message Date
Dimitri John Ledkov 652a1f0734 Retrigger semaphoreci, systemd master updated. 2015-06-09 10:34:44 +01:00
Dimitri John Ledkov f0fa8cd819 Fix ci usr-from-host test bail out typo. 2015-06-08 19:12:58 +01:00
Dimitri John Ledkov e4e5b87d5b fix test runner for usr-from-host. 2015-06-08 18:01:04 +01:00
Dimitri John Ledkov bfbb59bdee go fmt 2015-06-08 17:13:41 +01:00
Dimitri John Ledkov 75bf4a30a2 Refactor stage1/init to source most of options from manifest, rather than flavor/stampfile-based.
This refactor will make it easier to integrate lkvm support, and also
brings other benefits.

Specifically, with this refactor almost all functionality of stage1
init is flavor independent and can be fully controlled via a manifest
and uses as little hard coded paths as possible.

Thus, e.g. distribution packagers, can create package which will only
have rkt/stage1 provided binaries (gc, waiter, init, etc.) and specify
the rest of things in the manifest (path to nspawn, ld.so, LD LIBRARY
PATH, libfakesdbooted.so, etc). And create fully free-standing
stage1.aci by simply creating basic distribution chroot with
distro-native tools and supplying a matching/correct aci-manifest. By
fully free-standing, I mean similar to current coreos flavor, which is
completely independent of the host OS binaries & load paths and is
truly run everywhere.

Many of these refactors will be useful for future lkvm integration,
e.g. reusing ld.so load paths and similar.
2015-06-08 16:19:02 +01:00
Iago López Galeiras 30062ac541 Merge pull request #974 from iaguis/iaguis/gexpect
functional tests: capture output and print it on error
2015-06-08 12:34:12 +02:00
Iago López Galeiras c3bb4600ba functional tests: capture output and print it on error 2015-06-08 12:03:58 +02:00
Iago López Galeiras 2f4309c146 Godep: bump gexpect dependency
It allows to collect the output of a gexpect test so we can print it on
failures.
2015-06-08 12:03:58 +02:00
Jonathan Boulle 7bf926e4fe Merge pull request #990 from endocode/iaguis/check-cgroups-before-enabling-them
stage1: take into account not-supported isolators
2015-06-05 10:10:04 -07:00
Iago López Galeiras e04ef0a43f stage1: add test for parseCgroups function
This commit modifies parseCgroups() to take an io.Reader as parameter
and adds a test for it.
2015-06-05 17:23:05 +02:00
Iago López Galeiras 3c211a5b38 Merge pull request #1001 from endocode/iaguis/journal-try-host
stage1: use --link-journal=try-host in systemd-nspawn
2015-06-05 16:13:04 +02:00
Iago López Galeiras 27ec47b2cd stage1: use --link-journal=try-host in systemd-nspawn
--link-journal=host fails if the host system doesn't have persistent
journaling enabled. Fix that by using "try-host"; if the system has
persistent journaling enabled it links the journal, otherwise it skips
the linking without exiting with a failure.

In 969a57c6 (stage1: use --link-journal=host instead of try-host) we
switched from "try-host" to "host" to support journal linking in systemd
versions <219 but now we don't support it on them anymore.
2015-06-05 15:43:28 +02:00
Alban Crequy 34ee76d07f Merge pull request #994 from jonboulle/master
build: update default systemd source location
2015-06-05 07:28:02 +02:00
Jonathan Boulle 62ea76fbcb build: update default systemd source location
systemd has now moved to GitHub
http://lists.freedesktop.org/archives/systemd-devel/2015-June/032738.html
https://github.com/systemd/systemd/commit/eb0914fc85812570538c37287dd3cfa377289418#diff-c47c7c7383225ab55ff591cb59c41e6bR11
2015-06-04 17:10:50 -07:00
Alban Crequy a65341b469 Merge pull request #993 from endocode/alban/semaphore-reorder
Functional tests, semaphore: reorder the tests
2015-06-04 18:20:57 +02:00
Alban Crequy 2fb807a14b Functional tests, semaphore: reorder the tests
Load balance the tests on the two VMs to have faster tests.
2015-06-04 18:18:16 +02:00
Iago López Galeiras 906ce611bd stage1: check if isolators are supported and warn if not
Warn the user if an isolator is requested but is not supported.
2015-06-04 18:11:00 +02:00
Iago López Galeiras 3eeb27ffbe stage1: refactor cgroup-related functions
Move them to a new cgroup.go file.
2015-06-04 18:11:00 +02:00
Iago López Galeiras d5a3f50306 stage1: mount cgroup file RW only if it exists
Some controller cgroup knob files can be disabled in kernel. If the
file we want doesn't exist, just ignore it when we bind-mount knobs over
themselves.
2015-06-04 18:11:00 +02:00
Alban Crequy 09a7efbb47 Merge pull request #992 from alban/alban/usr-merge
stage1, flavor usr-from-host: look in /usr/lib first
2015-06-04 18:10:48 +02:00
Alban Crequy 510930bf09 stage1, flavor usr-from-host: look in /usr/lib first
See:
http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
2015-06-04 17:57:12 +02:00
Alban Crequy 17762bf93c Merge pull request #977 from endocode/alban/flavor-host
Introduce new build flavor: usr-from-host
2015-06-04 16:56:59 +02:00
Alban Crequy 2824964937 stage1: add RKT_STAGE1_USR_FROM=usr-from-host 2015-06-04 16:33:45 +02:00
Alban Crequy da95867721 Godeps: add appc/goaci/proj2aci 2015-06-04 09:34:37 +02:00
Iago López Galeiras 1189d59c7d Merge pull request #987 from endocode/iaguis/mount-cgroup-files
stage1: bind-mount cgroup controller files RW
2015-06-03 19:29:17 +02:00
Iago López Galeiras 74075ab1d6 stage1: bind-mount cgroup controller files RW
Instead of bind-mounting the whole controller subcgroup directory RW we
only bind-mount the files we need to set isolators. This reduces the
cgroup attack surface.
2015-06-03 18:42:17 +02:00
Yifan Gu c4b57756a9 Merge pull request #978 from yifan-gu/fix_run_pod_manifest
rkt: Fix run --pod-manifest. Append image IDs to the stage0.RunConfig.
2015-06-03 09:02:21 -07:00
Iago López Galeiras ca8650d6fc Merge pull request #985 from endocode/iaguis/fix-parsecgroups
stage1: fix parseCgroups function
2015-06-03 16:35:12 +02:00
Iago López Galeiras c2c9ea9fc1 stage1: fix parseCgroups function
It wasn't taking into account if the cgroup controller was enabled or
not.
2015-06-03 16:07:46 +02:00
Iago López Galeiras 1d1e5ef397 Merge pull request #920 from endocode/iaguis/create-cgroups
stage1: support per-app memory and cpu isolators
2015-06-03 15:34:43 +02:00
Iago López Galeiras fd37804b9f functional tests: add isolators to the base image
This commit adds memory and cpu isolators to test we don't break
anything. The next step is adding a functional test that actually checks
the isolators are respected.
2015-06-03 14:47:55 +02:00
Iago López Galeiras 52213ca754 stage1: handle CPU isolator 2015-06-03 14:28:14 +02:00
Iago López Galeiras 9fb037d019 stage1: handle memory isolator 2015-06-03 14:28:14 +02:00
Iago López Galeiras 67c6c73a9e stage1: create cgroups before calling systemd-nspawn
To allow systemd inside stage1 to set resource limits for apps we mount
the cgroup controllers hierarchy in rkt. We need this because
systemd-nspawn mounts cgroup controllers as read-only.

We mimic systemd-nspawn cgroup mounts with the difference that we
bind-mount the apps' subdirectories over themselves so they stay
read-write. We leave the mounting of systemd's cgroup hierarchy to
nspawn.
2015-06-03 14:28:14 +02:00
Iago López Galeiras e26d71a880 common: add SliceToPath function
SliceToPath explodes a slice name to its corresponding path in the cgroup
hierarchy. For example, a slice named "foo-bar-baz.slice" corresponds to the
path "foo.slice/foo-bar.slice/foo-bar-baz.slice". See systemd.slice(5)

Since SliceToPath needs to do escapings and sanity checks, several
functions used in systemd for that purpose are also ported.
2015-06-03 14:21:03 +02:00
Iago López Galeiras fbf6a3757b stage0: enter a new mount namespace always
Previously we were only entering a mount namespace in rkt when we used
overlay fs. Since we now mount the cgroup controller hierarchy we enter
a new mount namespace it in every case.
2015-06-03 14:21:03 +02:00
Alban Crequy fee01d4224 Merge pull request #910 from endocode/alban/pid-file-parent
stage1: remove --pid-file patch from systemd-nspawn
2015-06-03 13:59:57 +02:00
Alban Crequy f063ec92c6 functional test: TestPidFile*: update to ppid 2015-06-03 12:58:10 +02:00
Alban Crequy 2c25275523 stage1: remove --pid-file patches from systemd-nspawn
Instead of asking systemd-nspawn to write its "pid" file, rkt can write
the parent pid "ppid". Then, update getPID() to get the pid file from
/proc/$ppid/task/$ppid/children. In this way, we don't need to patch
systemd-nspawn.

getPID() is able to read both the "pid" file and the "ppid" file, in
order to work with alternative stage1s which choose to implement one or
the other method.

coreos/rkt#910
2015-06-03 12:58:09 +02:00
Alban Crequy be40b0eb67 documentation: stage1 ABI for enter 2015-06-03 10:52:06 +02:00
Iago López Galeiras e7c054d8ff Merge pull request #976 from endocode/iaguis/bump-docker2aci
Godeps: bump docker2aci
2015-06-02 23:53:56 +02:00
Yifan Gu 88b77ea994 rkt: Fix run --pod-manifest. Append image IDs to the stage0.RunConfig. 2015-06-02 12:22:36 -07:00
Iago López Galeiras dbe39ba1c2 Godeps: bump docker2aci
It converts docker ports
2015-06-02 20:56:33 +02:00
Alban Crequy e58e40bf34 Merge pull request #973 from endocode/alban/functests_pidfilerace
Functional test: TestPidFileAbortedStart (pid file race)
2015-06-02 12:19:59 +02:00
Alban Crequy cf18a5a1b7 Functional test: TestPidFileAbortedStart (pid file race)
This test should catch more regression in the fix
https://github.com/coreos/rkt/pull/826
2015-06-02 11:58:42 +02:00
Jonathan Boulle 25b862db97 Merge pull request #968 from jonboulle/net
rkt/run: fix help typo
2015-06-01 15:32:59 -07:00
Jonathan Boulle 87eccd84fc Merge pull request #970 from tauren/patch-1
Clarify required version of vagrant
2015-06-01 15:19:34 -07:00
Jonathan Boulle a0af55518d Merge pull request #966 from endocode/alban/functests_v220
functional tests: test v220
2015-06-01 11:58:51 -07:00
Jonathan Boulle 2646b48d8d Merge pull request #975 from yifan-gu/fix_pod_manifest
stage0: Fix nil Podmanifest.Apps.App pointer
2015-06-01 11:48:44 -07:00
Yifan Gu e9f4bc6fa1 stage0: Fix nil Podmanifest.Apps.App pointer 2015-06-01 10:45:00 -07:00