Nomad Skeleton Driver Plugin banner
hashicorp hashicorp

Nomad Skeleton Driver Plugin

Development community

Description

A template for writing a Nomad driver plugin.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Nomad Skeleton Driver Plugin

Skeleton project for [Nomad task driver plugins](https://www.nomadproject.io/docs/drivers/index.html).

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

Requirements

  • Go v1.18 or later (to compile the plugin)
  • Nomad v0.9+ (to run the plugin)

Building the Skeleton Plugin

[Generate](https://github.com/hashicorp/nomad-skeleton-driver-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](https://blog.golang.org/using-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:/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-driver-plugin
+ module github.com//
...
// main.go

package main

import (
    log "github.com/hashicorp/go-hclog"
-   "github.com/hashicorp/nomad-skeleton-driver-plugin/hello"
+.  "github.com///hello"
...

[!IMPORTANT] If your plugin imports `hashicorp/nomad` package, you may want to consult Nomad's top-level [`go.mod`](https://github.com/hashicorp/nomad/blob/main/go.mod) file to see if there aren't any "replace" directives that your package may also need.

Build the skeleton plugin.

$ make build

Deploying Driver Plugins in Nomad

The initial version of the skeleton is a simple task that outputs a greeting. You can try it out by starting a No