ipfs / infra

Tools and systems for the IPFS community
MIT License
132 stars 41 forks source link

docker-compose #96

Closed ghost closed 8 years ago

ghost commented 9 years ago

We can kill a lot of Ansible's complexity by managing our containers with docker-compose: https://docs.docker.com/compose/

A docker-compose.yml for a gateway host might look like this:

cjdns:
  image: hyperboria/cjdns:0.16.3
  cap_add: NET_ADMIN
  devices:
    - /dev/net/tun
  ports:
    - 54321:54321
  volumes:
    - ./cjdns:/etc/cjdns
nginx:
  image: nginx:1.9.3
  net: container:cjdns
  ports:
    - 80:80
    - 443:443
  volumes:
    - ./nginx:/etc/nginx
ipfs:
  image: ipfs/go-ipfs:0.3.8
  net: container:cjdns
  ports:
    - 4001:4001
    - 127.0.0.1:5001:5001
    - 127.0.0.1:8080:8080
  volumes:
    - ./ipfs:/ipfs
  log_driver: none
node_exporter:
  image: prometheus/node_exporter
  net: host
  ports:
    - 127.0.0.1:9100:9100

We can probably even generate the various config files locally, and get rid of Ansible for good.

jbenet commented 9 years ago

this sounds interesting. also see the new tools from hashicorp:

jbenet commented 9 years ago

i think @whyrusleeping thinks we can simply things a ton with Nomad

whyrusleeping commented 9 years ago

i would love to use nomad. I think its great right now, and its only getting better (theyre adding in consul integration for service discovery and notification).

The biggest way i see nomad making our life easier is the rolling upgrades and how easy it is to do.

we can specify in the job file to update one node at a time every hour (or even every day?) and then easily cancel the upgrade if things start going wrong and roll back.

davidar commented 9 years ago

NixOps also seems interesting (and better aligned with IPFS ;)

Cc: @rht

jbenet commented 9 years ago

nice links. yeah all the nix tools are very promising and aligned. thoughts here @whyrusleeping and @lgierth ?

ghost commented 8 years ago

They do look nice but to be honest I'm not sold. I think we don't have a good idea yet what our needs will be in the foreseeable future. For now I just wanted to cut away the complexity and complication that we definitely don't need: Ansible.

All we really do is run a small handful of containers, generate config files for each of them, and reload if the config changes. It's easily doable with a few shell scripts.

whyrusleeping commented 8 years ago

@lgierth yeah, that sounds good to me.

rht commented 8 years ago

I think we don't have a good idea yet what our needs will be in the foreseeable future.

But isn't content-addressed stateless vm / package manager in one of them?

ghost commented 8 years ago

But isn't content-addressed stateless vm / package manager in one of them?

Maybe, I guess so -- what do you have in mind?

ghost commented 8 years ago

runC it'll be, supervised by runit.