Skip to content

Sample Nomad driver plugin to present folders within a directory as a schedulable device.

License

Notifications You must be signed in to change notification settings

angrycub/nomad-folder-device-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nomad Skeleton Device Plugin

Skeleton project for Nomad device plugins.

This project is intended for bootstrapping development of a new device plugin.

Requirements

  • Nomad 0.9+
  • Go 1.11 or later (to build the plugin)

Building the Skeleton Plugin

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 [email protected]:<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

Running the Plugin in Development

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

Deploying Device Plugins in Nomad

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.)

About

Sample Nomad driver plugin to present folders within a directory as a schedulable device.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published