GithubHelp home page GithubHelp logo

isabella232 / nomad-skeleton-driver-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hashicorp/nomad-skeleton-driver-plugin

0.0 0.0 0.0 3 MB

A template for writing a Nomad driver plugin.

License: Mozilla Public License 2.0

Go 98.08% HCL 1.19% Makefile 0.73%

nomad-skeleton-driver-plugin's Introduction

Nomad Skeleton Driver Plugin

Skeleton project for Nomad task driver plugins.

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

Requirements

  • Nomad v0.9+
  • Go v1.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-driver-plugin
+ module github.com/<ORG>/<REPO>
...
// main.go

package main

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

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 Nomad agent and running the job provided in the example folder:

$ make build
$ nomad agent -dev -config=./example/agent.hcl -plugin-dir=$(pwd)

# in another shell
$ nomad run ./example/example.nomad
$ nomad logs <ALLOCATION ID>

Code Organization

Follow the comments marked with a TODO tag to implement your driver's logic. For more information check the Nomad documentation on plugins.

nomad-skeleton-driver-plugin's People

Contributors

cgbaker avatar jrasell avatar lgfa29 avatar preetapan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.