Граф коммитов

12 Коммитов

Автор SHA1 Сообщение Дата
Pieter Noordhuis 3af322a694 warden: Use string keys in unchecked hashes
Change-Id: I4056bea0bcbe673d030747ba25b3f168b81769ad
2012-03-29 15:37:35 -07:00
Pieter Noordhuis d3427a88a2 warden: Remove quota-related code
Change-Id: Ia9d5280070c2905320c9e0e8460637f3b265f317
2012-02-23 09:49:22 -08:00
Pieter Noordhuis 788994c1ec warden: Only include Linux-related features on Linux
Change-Id: I5f4057f145d307ad6f0a484359550dd15eb828d8
2012-02-08 15:04:29 -08:00
mpage cc5931aaa8 [warden] Add option to specify config file to warden:start
Change-Id: I08ffd0b8801459fb7a26bd16d40608741d5f5c15
2012-01-20 13:10:13 -08:00
mpage 284d00d8ab Add quota monitor to tear down containers that exceed their disk usage limits
This diff includes a few of things:
1. A class for monitor quota usage and tearing down containers that exceed their limits.
2. A small C program for reporting quota usage. This is necessary because repquota
   has several bugs that prevent us from using it to reliably check quota usage.
3. Small refactor that moves everything under the :quota config hash. This makes sense,
   as we only need the uidpool if quota support is enabled.

Test plan:
- Existing unit tests pass
- New unit tests pass

Change-Id: I8dccd91bb4571f051c7a328d22436b77c6fb3f0c
2011-12-07 15:34:15 -08:00
mpage e0cfcc15ea Add command for setting/retrieving disk usage limit.
This add plumbing for setting limits on containers. The syntax is:

    limit <handle> <name>             # Retrieve limit named <name>
    limit <handle> <name> <limit>+    # Set limit named <name>

This diff also implements support for setting and retrieving disk usage
limits (enforced via quotas).

Test plan:
- All existing tests pass
- New tests pass.

Change-Id: I9b5d3c7ffdd22e06a2dcfd2605146a3a3ae48d23
2011-12-05 16:33:11 -08:00
mpage ce10fc982b Add uid pool to LXC container
This is in preparation for adding quota support to the LXC container.
If a uid pool is supplied the LXC container will now attempt to acquire a
uid for each container that is created. A WardenError will be raised in the
event that a uid cannot be acquired. Note that the uid is the same both inside
and outside the container in order to facilitate enforcement of disk quotas.

Test plan:
- All existing tests pass.
- New tests pass.

Change-Id: Ic509c0cd9e40275f92207d35bb9bfb943d700026
2011-12-05 14:30:00 -08:00
Pieter Noordhuis ca29ace2ba warden: Allow external ports to be mapped to containers
Change-Id: Id24aee6a6c78137cfefe82b4cbc4bf1e7c771c92
2011-11-29 11:02:06 -08:00
Pieter Noordhuis f68086a3bc warden: Abstraction for executing sequence of commands
Instead of simply running commands in a fire and forget manner, we want
to optionally run rollback hooks to undo (or try to undo) the mutation
caused by the initial command. When a command halfway through the
sequence fails, it should execute a rollback for all commands up to the
failing one.

This is best-effort approach, as commands may irreversibly mutate global
state. It can therefore be seen best as an abstraction to a set of nested
begin/rescue/end blocks.

Change-Id: I5132a0135fce07c69760e77fa6517d28048a3a77
2011-11-28 17:27:17 -08:00
Pieter Noordhuis 248335e082 warden: More prep work to support both LXC and insecure
Change-Id: I886d7de9244bfd60ba8c2dea72f5857d3c1d4e73
2011-11-17 19:32:38 -08:00
Pieter Noordhuis 7e9405dd99 warden: Move separate concerns to their own files
This also includes prep work for supporting execution environments that
are less secure than LXC. This is required for MCF, OSX, dev, etc.

Change-Id: I82ee0aef3dce60ea0f174598663b9d78ab89bb6c
2011-11-17 17:21:06 -08:00
Pieter Noordhuis 33459df52c Add warden: manager for ephemeral Linux containers
Change-Id: I3913e5be6392ffec183e9eb58d933988c15deafb
2011-11-17 13:37:25 -08:00