项目作者: donovanmuller

项目描述 :
A Spring Cloud Deployer implementation for Hashicorp Nomad
高级语言: Java
项目地址: git://github.com/donovanmuller/spring-cloud-deployer-nomad.git
创建时间: 2016-10-14T10:08:53Z
项目社区:https://github.com/donovanmuller/spring-cloud-deployer-nomad

开源协议:Apache License 2.0

下载


Spring Cloud Data Flow Nomad Build Status

An implementation of the spring-cloud-deployer
SPI for scheduling applications with Hashicorp Nomad.

Please see the Spring Cloud Data Flow Server Nomad
for a runtime implementation of this deployer SPI implementation.

This implementation borrows heavily from the spring-cloud-deployer-kubernetes
project.

nomad-api

The Nomad HTTP API
is consumed using the nomad-api
project by Rafael Zanella.
Huge thanks for the already having done all the hard work.

Building

If you don’t have a Nomad/Consul instance available to run the integration tests as part of the build,
you can skip the integration tests and build the Nomad deployer with:

  1. $ ./mvnw install -Dnomad.enabled=false

Integration tests

Hashistack Vagrant box

If you require a local Nomad instance to run the integration tests, you can use the hashistack-vagrant
project to stand up Nomad and accompanying tools. Assuming you have Vagrant
installed, clone the hashistack-vagrant project and follow the below steps:

  1. $ git clone https://github.com/donovanmuller/hashistack-vagrant.git
  2. $ cd hashistack-vagrant
  3. $ vagrant plugin install landrush # requires the 'landrush' plugin
  4. $ vagrant up
  5. $ vagrant ssh
  6. ...
  7. vagrant@hashistack:~$ tmuxp load full-hashistack.yml
  8. ...

by default this will stand up a Nomad instance on 172.16.0.2:4646/nomad-client.hashistack.vagrant:4646.

Please see the hashistack-vagrant
GitHub project for more details.

Running the tests

Assuming you have access to a Nomad instance (see above if you don’t), you can run the integration tests with:

  1. $ ./mvnw test \
  2. -Dspring.cloud.deployer.nomad.nomadHost=172.16.0.2 \
  3. -Dspring.cloud.deployer.nomad.nomadPort=4646 \
  4. -Dspring.cloud.deployer.nomad.deployerHost=<local machines IP> \
  5. -Dspring.cloud.consul.host=<local machines IP>

where -Dspring.cloud.deployer.nomad.nomadHost and -Dspring.cloud.deployer.nomad.port
optionally specify the host and port where a Nomad client is listening. The default values are localhost and 4646 respectively.

The spring.cloud.deployer.nomad.deployerHost
value must be set for the Maven resource support. The value should be the accessible (from the VM) IP address of your local machine
from where you run the tests.