GithubHelp home page GithubHelp logo

fig2coreos's Introduction

NOTE

This repo is no longer being maintained. Users are welcome to fork it, but we make no warranty of its functionality.

fig2coreos

Convert fig.yml to CoreOS formatted systemd configuration files

Install

$ sudo gem install fig2coreos
$ fig2coreos
Usage: fig2coreos [options] APP_NAME FIG_YAML OUTPUT_DIRECTORY
	-t, --type TYPE                  Output type: fleet (default) or vagrant (generate a Vagrantfile)
	-h, --help                       Display this screen

Usage

To convert any fig.yml into a set of CoreOS systemd configuration files, just point the command to your fig.yml file and a directory to put your CoreOS files in:

$ fig2coreos app-name fig.yml coreos-dir
$ cd coreos-dir
$ fleetctl start *

To see how to setup fleetctl and CoreOS, here is an end-to-end tutorial: https://labs.ctl.io/building-your-first-app-on-coreos/

Use with Vagrant

If you select vagrant output type, fig2coreos will assume you are running this locally with vagrant and VirtualBox installed, so it will create a Vagrantfile which you can run vagrant up in and have a CoreOS running locally with the equivalent of your fig.yml running in it.

$ cd coreos-dir
$ vagrant up

The fig2coreos command auto-generates etcd discovery registration and fleet integration as well, so you can inspect your app easily.

$ vagrant ssh
$ fleetctl list-units

fig2coreos's People

Contributors

parkerfleming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fig2coreos's Issues

command in fig to command in docker run

with the following fragment in fig yml

railsappdevelopment:
  image: myregistry:5000/railsapp
  ports:
    - "3000:3000"
  command: -e development

should generate following systemd:

[Unit]
Description=Run railsappdevelopment_1
After=docker.service
Requires=docker.service

[Service]
Restart=always
RestartSec=10s
ExecStartPre=/usr/bin/docker ps -a -q | xargs docker rm
ExecStart=/usr/bin/docker run -rm -name railsappdevelopment_1 -p 3000:3000    myregistry:5000/railsapp -e development
ExecStartPost=/usr/bin/docker ps -a -q | xargs docker rm
ExecStop=/usr/bin/docker kill railsappdevelopment_1
ExecStopPost=/usr/bin/docker ps -a -q | xargs docker rm

[Install]
WantedBy=local.target

In others words should add command in fig.yml to docker run call in ExecStart like a run command

Ruby error when running.

$ fig2coreos myapp fig.yml coreos-files

/Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:83:in `block (2 levels) in create_service_files': undefined method `first' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:76:in `open'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:76:in `block in create_service_files'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:34:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:34:in `create_service_files'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:29:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:9:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/lib/fig2coreos.rb:9:in `convert'
    from /Library/Ruby/Gems/2.0.0/gems/fig2coreos-0.1.4/bin/fig2coreos:47:in `<top (required)>'
    from /usr/bin/fig2coreos:23:in `load'
    from /usr/bin/fig2coreos:23:in `<main>'

And my fig file:

web:
  build: .
  volumes:
    - .:/code
  links:
   - db
   - redis
  ports:
   - 5000:5000
  command: python manage.py runserver 0.0.0.0:5000 --traceback
  environment:
    DJANGO_SETTINGS_MODULE: 'app.settings.local'

db:
  image: orchardup/postgresql

redis:
  image: orchardup/redis

Any ideas?

Feature Request - volumes-from

Please add volumes_from to docker run

volumes_from:
 - service_name
 - container_name
--volumes-from service_name --volumes-from container_name

fig2rkt ?

It seems that a few minor changes would help trying out coreos/rkt with existing fig/docker-compose files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.