43 Commits

Author SHA1 Message Date
Alban Crequy 70120a4b55 build: fix on OpenSUSE
$OSTYPE is "linux" on OpenSUSE 13.2. uname should be more reliable.

$OSTYPE was introduced for OS X in commit cb78269. Also, disable
functional tests on non-Linux.

Fixes: https://github.com/coreos/rkt/issues/1005
2015-06-08 15:31: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 2824964937 stage1: add RKT_STAGE1_USR_FROM=usr-from-host 2015-06-04 16:33:45 +02:00
Stefan Junker 3662cf34c9 stage1: bump systemd source version to v220 2015-05-27 18:12:04 -07:00
Alban Crequy 40d5a031cc build: systemd: v215 -> v219
Use the new version by default since it works now
2015-04-28 17:24:52 +02:00
Alban Crequy a5274f92b4 build: ability to choose a different systemd version
When building stage1 from sources with RKT_STAGE1_USR_FROM=src,
it is now possible to choose which systemd tag or branch should be
built:

  $ export RKT_STAGE1_USR_FROM=src
  $ export RKT_STAGE1_SYSTEMD_SRC=git://anongit.freedesktop.org/systemd/systemd
  $ export RKT_STAGE1_SYSTEMD_VER=v215
  $ ./build

By default, it still fetch the upstream git repository with tag v215 as
before. So defining the new variables is not necessary.

It is also possible to build against a local systemd repository:

  $ export RKT_STAGE1_USR_FROM=src
  $ export RKT_STAGE1_SYSTEMD_SRC=/home/user/git/systemd
  $ export RKT_STAGE1_SYSTEMD_VER=HEAD
  $ ./build

This should help developers to test newer systemd versions.

The patches in stage1/rootfs/usr_from_src/patches/ are versioned: the
subdirectory used is defined by $RKT_STAGE1_SYSTEMD_VER. If "HEAD" is
used, the master patchset will be selected.
2015-04-28 17:24:52 +02:00
Alban Crequy 508365f6ee build: allow packagers to disable stage1 build
RKT_STAGE1_USR_FROM=none ./build

When rkt is built in this way, users will need to get stage1.aci from
another source and either move it to the correct directory or use the
option "-stage1-image=".
2015-04-28 17:24:52 +02:00
Eugene Yakubovich 7abd8f3b84 net: switch to using CNI plugins 2015-04-27 14:43:25 -07:00
Eugene Yakubovich 98e78d5f08 stage1: add stage1 gc entrypoint
Stage1 GC entrypoint is called as part of
"rkt gc", prior to recursively removing the
pod directory. This give the stage1 to do
any necessary cleanup.
2015-04-14 14:22:57 -07:00
Alban Crequy 5d8e59659d functional tests: new implementation 2015-04-09 16:05:52 +02:00
Jonathan Boulle 79753c9b19 *: rocket -> rkt 2015-03-31 16:31:21 -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
Vito Caputo 0219d440c7 build: parallelize stage1 by number of cpus reported by lscpu
This becomes significant when we build systemd from source.
2015-03-23 18:56:06 -07:00
Jonathan Boulle 10beb3920d build: allow setting of stage1 image path
This introduces the ability to set the default stage1 image path for
`rkt run` by setting the environment variable RKT_STAGE1_IMAGE at build
time (i.e when invoking ./build).

The variable should be set to the fully qualified path at which rkt can
find the stage1 image - for example:

	RKT_STAGE1_IMAGE=/usr/lib/rkt/stage1.aci ./build

Rocket will use this environment variable to set the default value for
the stage1-image flag. If the value is _not_ set, it will continue to
use the heuristic it does today to guess the location of the stage1
image, by looking for a file called stage1.aci that is in the same
directory as rkt itself.
2015-02-12 16:48:26 -08:00
Jimmy Zelinskie 67e4247e25 build: build network plugins only on linux
Without this, go throws an error about no source files available because
all of the source files for github.com/vishvananda/netlink/nl end in
"_linux.go".
2015-02-06 12:48:17 -05: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 630beda3ae net: cnvt ipmanager to ipam plugin; make use of ipam plugins
- Convert ipamanager into IPAM plugin (static) that uses env
variables instead of cmd line args
- Make bridge and veth plugins call out to IPAM plugin
- Refacor code around the new IPAM plugins
2015-02-02 18:15:51 -08:00
Vito Caputo bae52e60ae *: switch stage1 to aci image format
One may now specify an alternative stage1 in a style like run and fetch:
rkt run --stage1-image foo.com/rocket/stage1 app

--stage1-image defaults to "stage1.aci" within the same directory as the rkt
binary.  This is discovered at runtime via "/proc/self/exe"; as long as the rkt
executable and stage1.aci share a directory it should "just work" regardless of
the directory's location and where rkt is executed from.
2015-01-30 10:51:15 -08:00
Vito Caputo deaf549211 build: use go-bindata -nomemcopy=true to reduce runtime memory req. 2015-01-23 14:58:46 -08:00
Eugene Yakubovich 25ecad8162 Integrate metadata service
- Move metadatasvc into rkt as a subcommand
- Add option to spawn metadatasvc from rkt run
- Register container with metadatasvc
- Removes anti-spoofing logic -- this belongs in the network plugin

Fixes #33
2015-01-23 13:25:46 -08:00
Jonathan Boulle 53319e7f0d build: don't fail if GOPATH is unset
build should be callable even if the user's env has no GOPATH in it
2015-01-22 17:13:02 -08:00
Eugene Yakubovich fae32223e6 net: add --private-net to run cmd 2015-01-22 15:38:25 -08:00
Eugene Yakubovich ba9b6bc82a net: use env vars for plugin params; use stage1 rootfs for builtins
Simplifying the plugin interface. No more HTTP interface and plugin
configs. Plugin type maps to executable name in stage1 rootfs or
on host in a well known dir. Env vars are used for parameter passing
to the plugin. Also, default net conf is kept in stage1 rootfs to make
private networking work "out of the box".
2015-01-22 15:17:51 -08:00
Vito Caputo f6231f333a build/test: cleanup /tmp file and directory leaks 2015-01-21 14:17:49 -08:00
Eugene Yakubovich cda3e42555 incorporating code review feedback 2015-01-12 16:58:03 -08:00
Eugene Yakubovich 39ac3a2edf added proposed network plumbing 2015-01-12 16:58:03 -08:00
Vito Caputo 0eb317e119 stage1: componentize stage1 rootfs construction and use make
* Move stage1/*.go to stage1/init/

 * Split stage1/mkrootfs.sh's logical components into subdirs of
   stage1/rootfs:

   - Deriving tree from CoreOS image and caching: rootfs/usr
     * Cache management in cache.sh
     * File extraction and picking in mkbase.sh
     * File inclusions split under usr/manifest.d

   - Fakesdboot: rootfs/shim/
     * Renamed to 'shim' since we've gone past just tricking nspawn

   - Root compositing and aggregation of odds and ends: rootfs/aggregate

 * Introduction of Makefiles for every component and a simple recursive
   parallel-capable make for the rootfs tip.

 * Update toplevel build script to invoke make on stage1/rootfs and find
   init sources in stage1/init, .gitignore additions as well.

 * Removed stage1/mkrootfs.sh

 Since the image cache has moved there will be an image download on first build
 in the new arrangement.  The caching has also been improved to handle CoreOS
 image revision changes by naming the cached signature with a hash of the URL.
2014-12-19 16:39:44 -08:00
Jonathan Boulle a1d7eb8e9c *: move spec to new home
The appc spec has moved! Its new home is at https://github.com/appc/spec

This removes the spec (since it has already been migrated), and adds
placeholders linking to the new repo. It also updates rocket to
reference the spec repo _directly_ (i.e. NOT godepped). This means that
people will need to maintain the spec in their gopath for now when
building rocket.
2014-12-09 12:27:35 -08:00
Shaun Jackman 96243318b7 build: Fix non-POSIX commands realpath and mktemp
realpath is not POSIX and not available on all systems.
POSIX mktemp requires a mandatory template argument.
2014-12-07 17:46:33 -08:00
Jonathan Boulle 9e2c107d0f build: only build ACE validator if go linux/amd64 is available 2014-12-05 16:25:15 -08:00
Jonathan Boulle cb78269134 *: build a limited version of rkt on non-Linux
This introduces build tags to allow the actual rkt binary to be built on
platforms other than Linux. This does not change our current focus of rocket
being targeted at the Linux/amd64 platform, but means that users on e.g.
OS X and other operating systems can at least use `rkt fetch` to
retrieve ACI images and so forth.
2014-12-05 12:26:29 -08:00
Brandon Philips 915af3346a app-container: rename _ to - in validator 2014-12-01 01:41:23 -05:00
Jonathan Boulle 9b79880d91 *: cmd->rkt, split out rkt/ package 2014-11-30 11:05:35 -08:00
Vito Caputo 5ff85976d0 stage0: bundle stage1 rootfs and init binaries into rkt exe
This also runs mkrootfs.sh if necessary
2014-11-26 20:27:43 -08:00
Jonathan Boulle b128cc1218 appc: rename acfmt -> actool 2014-11-26 14:10:48 -08:00
Jonathan Boulle 049aa1e787 *: import container spec 2014-11-26 12:16:28 -08:00
Jonathan Boulle 28fff9c99d *: split out rkt executable, add CLI framework
In preparation for adding other top-level rkt commands (other than
"run"), break out stage0 and add a simple framework for adding
commmands.
2014-11-20 13:24:04 -08:00
Eugene Yakubovich 93c2ee9519 add http logging; cleanup 2014-11-18 15:59:17 -08:00
Brandon Philips acbbeae80c build: use environment GOPATH for now
until we vendor containers/standard use the user's GOPATH for now.
2014-11-18 14:10:30 -08:00
Jonathan Boulle 6dc57a7281 build: rename stage1 -> init 2014-11-13 23:38:34 -08:00
Jonathan Boulle 4b7162f8a1 *: rkt -> stage0, scf -> stage1 2014-11-13 23:33:14 -08:00
Jonathan Boulle 5b8ed9e617 build: add stage1 2014-11-13 22:09:06 -08:00
Jonathan Boulle 78c67f76cf rkt: add basic main + build script 2014-11-13 13:39:31 -08:00