Skip to content

Instantly share code, notes, and snippets.

@tylerflint
tylerflint / drains.sh
Created September 26, 2018 20:09
Nanobox external logdrains
# papertrail
# export LOGGER_TOKEN=(from /etc/logvac/config.json)
# export APP=app-name
# export ENDPOINT=logs7.papertrailapp.com:16810
curl -k -v -X POST -H "X-Auth-Token: $LOGGER_TOKEN" https://127.0.0.1:6361/drains -d '{"type": "papertrail", "id": "${APP}", "endpoint": "${ENDPOINT}"}'
# datadog
# export LOGGER_TOKEN=(from /etc/logvac/config.json)
# export APP=app-name
# export KEY=(from dashboard)
@tylerflint
tylerflint / summary.md
Last active October 19, 2017 03:10
How does nanobox orchestration differ from Docker Swarm and Kubernetes

Generally speaking, Nanobox treats containers as lightweight VMs. So, many concepts from docker swarm or kubernetes won’t track with our system. If you’re familiar with solaris zones, the way we treat containers is very much like a solaris zone.

At a high level, docker (swarm) and kubernetes are moving the process management, logging, supervision, networking, etc out of the container and into the orchestration layer. Details aside, conceptually, they are moving pretty aggressively towards the notion of running simple processes inside of a namespace and a filesystem chroot, then the orchestration layer handles everything else.

Ultimately, the developer is left to define the service details in every implementation, like which commands to run, etc. I don’t necessarily think that’s a bad thing, in fact I think the implementation of kubernetes’ pods is pretty clever, thats just the direction they're going.

Our system was designed differently, on the notion of autonomy. Essentially, a docker image should have e

@tylerflint
tylerflint / boxfile.yml
Created September 20, 2017 00:16
Nanobox multi-headed nodejs app example boxfile configuration
run.config:
engine: nodejs
dev_packages:
- forego
extra_packages:
- nginx-nchan
web.main:
@tylerflint
tylerflint / 0-instructions.md
Last active July 18, 2017 17:04
Install Hugo on Nanobox

Create a boxfile.yml

First create a boxfile using the content from this gist

Start the local env

nanobox run

Create a new site

@tylerflint
tylerflint / boxfile.yml
Created June 4, 2017 04:09
Nanobox Rails Example
run.config:
  engine: ruby
  cache_dirs:
    - node_modules
    - vendor/assets/bower_components
    - .bundle
    - vendor/bundle
  extra_packages:
@tylerflint
tylerflint / current.txt
Created February 28, 2017 17:31
potential output styles
Preparing environment :
* Mounting codebase
Root privileges are required to modify network shares. Your password may be requested...
✓ Mounting codebase
--------------------------------------------------------------------------------
+ HEADS UP:
+ This is the first build for this project and will take longer than usual.
@tylerflint
tylerflint / prototype.txt
Created February 10, 2017 22:01
mount /data to host mount to bypass docker layering, to achieve best throughput on data services
# 1 - copy the contents of /data from within the image onto the host share
docker run \
-it \
--rm \
-v /var/nanobox/test-volume:/host \
nanobox/mysql \
bash -c "cp -a /data/* /host"
# 2 - run the real container with the host mount at /data
docker run \
@tylerflint
tylerflint / catalog.json
Created January 27, 2017 23:07
aws nanobox catalog
[{
"id": "us-east-1",
"name": "US East (N. Virginia)",
"plans": [{
"id": "general_purpose",
"name": "General purpose",
"specs": [{
"id": "m1.small",
"ram": 1740,
"cpu": 0.25,
@tylerflint
tylerflint / catalog.json
Created January 13, 2017 23:56
aws pricing catalog for Nanobox
{
"us-east-1": {
"id": "us-east-1",
"name": "US East (N. Virginia)",
"plans": {
"general_purpose": {
"id": "general_purpose",
"name": "General purpose",
"specs": [{
"id": "m1.small",
@tylerflint
tylerflint / boxfile.yml
Created January 11, 2017 22:40
elixir deploy strategy configuration
run.config:
engine: elixir
engine.config:
rel_manager: distillery
distillery_rel: foo
distillery_env: bar