From 21a4ebadcca7084c880f0f04c67491298d978676 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 25 Jun 2019 20:44:59 -0700 Subject: [PATCH] Bootstrap the orchestration service from a common configuration --- config/custom-environment-variables.yml | 4 ++++ config/default.yml | 4 ++++ services/orchestrator/README.adoc | 4 ++++ services/orchestrator/src/index.ts | 16 ++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 config/custom-environment-variables.yml create mode 100644 config/default.yml create mode 100644 services/orchestrator/README.adoc diff --git a/config/custom-environment-variables.yml b/config/custom-environment-variables.yml new file mode 100644 index 0000000..f920cf7 --- /dev/null +++ b/config/custom-environment-variables.yml @@ -0,0 +1,4 @@ +--- +orchestrator: + host: OR_HOST + port: OR_PORT diff --git a/config/default.yml b/config/default.yml new file mode 100644 index 0000000..5671616 --- /dev/null +++ b/config/default.yml @@ -0,0 +1,4 @@ +--- +orchestrator: + host: localhost + port: 3030 diff --git a/services/orchestrator/README.adoc b/services/orchestrator/README.adoc new file mode 100644 index 0000000..9bcd501 --- /dev/null +++ b/services/orchestrator/README.adoc @@ -0,0 +1,4 @@ += Otto Orchestrator + +The Otto Orchestration service is responsible for provisioning agents to do their +necessary work. diff --git a/services/orchestrator/src/index.ts b/services/orchestrator/src/index.ts index 69a6ffc..21813a8 100644 --- a/services/orchestrator/src/index.ts +++ b/services/orchestrator/src/index.ts @@ -3,4 +3,20 @@ require('module-alias/register'); import logger from '@otto/logger'; import { serveApp } from '@otto/server' +import feathers from '@feathersjs/feathers'; +import configuration from '@feathersjs/configuration'; +import express from '@feathersjs/express'; + logger.info('Starting orchestrator'); + +const app = express(feathers()); + +// We need to fish out the orchestrator specific settings +const settings = configuration()(app); +app.configure((app) => { + Object.keys(settings['orchestrator']).forEach((key) => { + app.set(key, settings['orchestrator'][key]); + }); +}); + +serveApp(app);