cmd/driver | ||
pkg/plugin | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
README.md |
nomad-driver-skeleton
This project is a Hashicorp Nomad runtime driver plugin skeleton implementation. You can clone and modify this to get started writing your own driver plugin.
Note that this is only a skeleton to help you get started. The Makefile only builds for linux/amd64
Requirements
Get Started
Clone repository to: `$GOPATH/src/github.com/hashicorp/nomad-driver-skeleton
Copy the files into your new driver's package and change package names as needed.
$ cd $GOPATH/src/github.com/hashicorp/nomad-driver-skeleton
$ make dep
$ make build
Requirements
Go should be installed on your machine.
You will also need to correctly setup a GOPATH
and add $GOPATH/bin
to your $PATH
.
To compile the driver plugin, run make build
. This will build the plugin and put the task driver binary under the
NOMAD plugin dir, which by default is located under <nomad-data-dir>/plugins/
.
Check Nomad -data-dir
and -plugin-dir
flags for more information.
$ make build
Makefile and project module structure were inspired by Sylab's singularity driver.
Code Organization
The skeleton driver comes with an in memory task state store (see state.go).
This in-memory map is for storing runtime details (like a process id). The details
of what to store is left to the implementation of the runtime driver.
Fields stored in the base implementation in this skeleton can be found in the taskHandle
struct.