Skip to content

Commit

Permalink
Update CHANGELOG and README
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMa committed Oct 3, 2020
1 parent 1d1c818 commit 07026a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Support for granting additional capabilities to containers. @mateuszlewko
- Support for all new options of `resolv_conf` added in Systemd 246. @mateuszlewko
- Ensure images can be safely downloaded in paralell.
- Ported tests from `exec` driver to this project. They cover basic
functionality like starting, stopping, killing, destroying tasks and
executing commands in them.
- Added Makefile for common build operations.
### Changed
- Improved error message if systemd-nspawn fails to start a task.
- `NewNspawnDriver()` now returns a driver with the default config settings.
### Fixed
- Fixed a runtime panic which occured if a task had no resources assigned.

## [0.3.0] - 2020-08-12
### Added
- Support for Nomad `bridge` networking mode. This also enables the use of
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ and their machine ID will be set to the allocation ID of the started Nomad task.
## Client requirements

* [Nomad](https://nomadproject.io) 0.12+ running as `root`
* [Go](https://golang.org/doc/install) 1.14+
* [Go](https://golang.org/doc/install) 1.14
* Linux
* [`systemd-nspawn`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html)
installed

## Building the driver from source

Checkout this repository and simply run `go build -mod=vendor`
Checkout this repository and simply run `make`.

```shell
$ git clone https://github.com/JanMa/nomad-driver-nspawn.git
$ cd nomad-driver-nspawn
$ go build -mod=vendor
$ make
```

## Testing the driver

To execute the built-in test suite run

``` shell
$ make test
```

## Using the driver
Expand All @@ -32,6 +40,7 @@ command
```shell
$ sudo nomad agent -dev -plugin-dir=$(pwd) -config=example/config.hcl
```

## Minimal job example

```hcl
Expand Down Expand Up @@ -87,11 +96,11 @@ should cover a broad range of use cases:
* `image_download` - (Optional) Download the used image according to the
settings defined in this block. Structure is documented below.
* [`pivot_root`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--pivot-root=) -
(Optional) Pivot the specified directory to the be containers root directory.
(Optional) Pivot the specified directory to be the containers root directory.
* [`resolv_conf`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--resolv-conf=) -
(Optional) Configure how `/etc/resolv.conf` is handled inside the container.
* [`user`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#-u) -
(Optional) Change to the specified user in the containers user database.
(Optional) Change to the specified user in the container's user database.
* [`volatile`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--volatile) -
(Optional) Boot the container in volatile mode.
* [`working_directory`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--chdir=) -
Expand Down Expand Up @@ -142,7 +151,7 @@ should cover a broad range of use cases:
```
* [`capability`](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--capability=) -
(Optional) List of additional capabilities to grant the container.

```hcl
config {
capability = ["CAP_NET_ADMIN"]
Expand All @@ -158,10 +167,3 @@ The `image_download` block supports the following arguments:
* `force` - (Optional) `true` or `false` (default) If a local copy already
exists, delete it first and replace it by the newly downloaded image.
* `type` - (Optional) `tar` (default) or `raw`. The type of image to download.

## TODO
- [x] download images via `machinectl`
- [ ] support network modes
- [x] support exec commands
- [x] bind task directories in container
- [ ] write tests

0 comments on commit 07026a6

Please sign in to comment.