Skip to content

Instantly share code, notes, and snippets.

View andyshinn's full-sized avatar
🖥️
don't put computers in your mouth

Andy Shinn andyshinn

🖥️
don't put computers in your mouth
View GitHub Profile

Scale the Ruby application to one process:

$ deis ps:scale web=1
Scaling processes... but first, coffee!
done in 3s

=== fhbase Processes

--- web:
@andyshinn
andyshinn / DEISGCE.md
Last active June 7, 2020 19:17
Deis in Google Compute Engine

Deis in Google Compute Engine

Let's build a Deis cluster in Google's Compute Engine!

Google

Get a few Google things squared away so we can provison VM instances.

Google Cloud SDK

$ fleetctl status deis-controller.service
● deis-controller.service - deis-controller
   Loaded: loaded (/run/fleet/units/deis-controller.service; linked-runtime)
   Active: active (running) since Fri 2014-05-30 03:29:33 UTC; 3min 22s ago
  Process: 4890 ExecStartPre=/bin/sh -c docker inspect deis-controller >/dev/null && docker rm -f deis-controller || true (code=exited, status=0/SUCCESS)
  Process: 4882 ExecStartPre=/bin/sh -c docker history deis/controller >/dev/null || docker pull deis/controller:latest (code=exited, status=0/SUCCESS)
 Main PID: 4899 (docker)
   CGroup: /system.slice/deis-controller.service
           └─4899 /usr/bin/docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=10.240.39.251 --volumes-from=deis-logger deis/controller

The announcement sidekick unit:

$ fleetctl cat [email protected]
[Unit]
Description=Firehose etcd announcer
BindsTo=firehose@%i.service

[Service]
TimeoutStartSec=30s

port variable not available for next command?

$ /bin/sh -c "port=$(docker inspect -f '{{range $i, $e := .HostConfig.PortBindings }}{{$p := index $e 0}}{{$p.HostPort}}{{end}}' firehose-01); echo Port: $port"
Port:

docker inspect is returning correct port

@andyshinn
andyshinn / haproxy.conf
Last active July 23, 2018 20:31
HAProxy configuration as JSON
global
daemon
chroot /var/lib/haproxy
user haproxy
group haproxy
maxconn 4096
log logs.papertrailapp.com:45187 local0
log logs.papertrailapp.com:45187 local1 notice error
defaults
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "redis" do |redis|
redis.vm.provider "docker" do |d|
d.name = "redis"
@andyshinn
andyshinn / gist:9dbeeb5409de42de8249
Created June 19, 2014 16:40
Fleet no scheduling job and never exiting

Trying to schedule the following unit file linked to [email protected], [email protected], and [email protected] on 3 CoreOS (349.0.0) nodes:

[Unit]
Description=firehose server

[Service]
ExecStartPre=/usr/bin/docker pull firehose/server
ExecStartPre=/bin/sh -c "docker inspect firehose-%i >/dev/null && docker rm -f firehose-$i || true"
ExecStart=/usr/bin/docker run --name firehose-%i -p 7474 firehose/server
@andyshinn
andyshinn / start_haproxy.sh
Created June 23, 2014 17:27
HAProxy and Confd Docker startup script
#!/usr/bin/env bash
set -eo pipefail
export SHELL="/bin/bash"
readonly ETCD_PORT=4001
readonly ETCD_IP=172.17.42.1
readonly ETCD=$ETCD_IP:$ETCD_PORT
readonly HAPROXY_PIDS="/var/run/haproxy.pid"
Aug 07 05:59:08 core5 etcd[586]: [etcd] Aug 7 05:59:08.341 WARNING | transporter.ss.decoding.error:proto: field/encoding mismatch: wrong type for field
Aug 07 05:59:08 core5 etcd[586]: [etcd] Aug 7 05:59:08.391 WARNING | transporter.ss.decoding.error:proto: field/encoding mismatch: wrong type for field
Aug 07 05:59:08 core5 etcd[586]: [etcd] Aug 7 05:59:08.441 WARNING | transporter.ss.decoding.error:proto: field/encoding mismatch: wrong type for field
Aug 07 06:00:11 core5 sh[31229]: E0807 06:00:11.281150 02880 client.go:200] Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 100ms
Aug 07 06:00:11 core5 sh[31229]: E0807 06:00:11.382422 02880 client.go:200] Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 200ms
Aug 07 06:00:11 core5 sh[31229]: E0807 06:00:11.583095 02880 client.go:200] Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 400ms
Aug 07 06:00:11 core5 sh[31229]: E0807 06:00:11.983715 02880 client.go:200] Unable to get result