Skeleton project for Nomad device plugins.
This project is intended for bootstrapping development of a new device plugin.
- Website: https://www.nomadproject.io
- Mailing list: Google Groups
Generate
a new repository in your account from this template by clicking the Use this template
button above.
Clone the repository somewhere in your computer. This project uses
Go modules so you will need to set
the environment variable GO111MODULE=on
or work outside your GOPATH
if it
is set to auto
or not declared.
$ git clone git@github.com:<ORG>/<REPO>git
Enter the plugin directory and update the paths in go.mod
and main.go
to
match your repository path.
// go.mod
- module github.com/hashicorp/nomad-skeleton-device-plugin
+ module github.com/<ORG>/<REPO>
...
// main.go
package main
import (
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/plugins"
- "github.com/hashicorp/nomad-skeleton-device-plugin/device"
+ "github.com/<REPO>/<ORG>/device"
)
...
Build the skeleton plugin.
$ make build
You can test this plugin (and your own device plugins) in development using the plugin launcher. The makefile provides a target for this:
$ make eval
Copy the plugin binary to the plugins directory and configure the plugin in the client config. Then use the device stanza in the job file to schedule with device support. (Note, the skeleton plugin is not intended for use in Nomad.)