View shutdown.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stop hydra-router | |
docker stop redis |
View startup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOSTIP=`echo "show State:/Network/Global/IPv4" | scutil | grep PrimaryInterface | awk '{print $3}' | xargs ifconfig | grep inet | grep -v inet6 | awk '{print $2}'` | |
echo "Host IP: ${HOSTIP}" | |
docker run -d -p 6379:6379 --rm --name redis redis:6.0.6 | |
sleep 5 | |
docker run -d -p 5353:5353 --add-host host:${HOSTIP} --rm --name hydra-router pnxtech/hydra-router:1.7.0 |
View alights.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Project on Github: https://github.com/cjus/brainlights | |
#include <Arduino.h> | |
#include <string.h> | |
#include <math.h> | |
#include <Wire.h> | |
#include <Adafruit_NeoPixel.h> | |
#define DEBUG | |
#define LEDPIN 4 | |
#define BUTTONPIN 3 |
View jobqueue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redis = require('redis'); | |
const moment = require('moment'); | |
class JobQueue { | |
constructor() { | |
this.config = null; | |
this.redisdb = null; | |
this.redisKey; | |
} |
View message.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async checkForTasks(callback) { | |
let message; | |
try { | |
message = await this.hydra.getQueuedMessage(this.serviceName); | |
} catch (e) { | |
this.logger('fatal', e); | |
return; | |
} | |
// message processing code lines deleted here... |
View segment-transfer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async queueAggregatorJob(jobID, status, statusMessage) { | |
return hydra.queueMessage(hydra.createUMFMessage({ | |
to: 'aggregator-svcs:/', | |
frm: 'segment-transfer-svcs', | |
typ: 'process', | |
bdy: { | |
jobID, | |
status, | |
statusMessage | |
} |
View stackdn.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export STACK_NAME='test' | |
docker stack rm ${STACK_NAME} |
View stackup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export STACK_NAME='test' | |
mkdir -p ~/data/${STACK_NAME}/redis | |
echo "\nStarting core services" | |
sudo STACK_NAME=${STACK_NAME} docker stack deploy --compose-file compose.yml ${STACK_NAME} |
View compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
networks: | |
servicenet: | |
driver: overlay | |
ipam: | |
config: | |
- | |
subnet: 10.0.9.0/24 |
View stackup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export STACK_NAME='test' | |
mkdir -p ~/data/${STACK_NAME}/redis | |
STACK_NAME=${STACK_NAME} docker stack deploy --compose-file sample-stack.yml ${STACK_NAME} |
NewerOlder