Skip to content

Commit

Permalink
Merge pull request docker#835 from aanand/rebrand
Browse files Browse the repository at this point in the history
Rebrand (pre-RC)
  • Loading branch information
aanand committed Jan 20, 2015
2 parents 7be8b4c + 16d6018 commit 4869fed
Show file tree
Hide file tree
Showing 79 changed files with 314 additions and 698 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/dist
/docs/_site
/venv
fig.spec
docker-compose.spec
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Fig
# Contributing to Compose

## TL;DR

Expand All @@ -11,14 +11,14 @@ Pull requests will need:

## Development environment

If you're looking contribute to [Fig](http://www.fig.sh/)
If you're looking contribute to Compose
but you're new to the project or maybe even to Python, here are the steps
that should get you started.

1. Fork [https://github.com/docker/fig](https://github.com/docker/fig) to your username.
1. Clone your forked repository locally `git clone [email protected]:yourusername/fig.git`.
1. Enter the local directory `cd fig`.
1. Set up a development environment by running `python setup.py develop`. This will install the dependencies and set up a symlink from your `fig` executable to the checkout of the repository. When you now run `fig` from anywhere on your machine, it will run your development version of Fig.
1. Fork [https://github.com/docker/compose](https://github.com/docker/compose) to your username.
1. Clone your forked repository locally `git clone [email protected]:yourusername/compose.git`.
1. Enter the local directory `cd compose`.
1. Set up a development environment by running `python setup.py develop`. This will install the dependencies and set up a symlink from your `docker-compose` executable to the checkout of the repository. When you now run `docker-compose` from anywhere on your machine, it will run your development version of Compose.

## Running the test suite

Expand Down Expand Up @@ -84,15 +84,15 @@ Note that this only works on Mountain Lion, not Mavericks, due to a [bug in PyIn

1. Open pull request that:

- Updates version in `fig/__init__.py`
- Updates version in `compose/__init__.py`
- Updates version in `docs/install.md`
- Adds release notes to `CHANGES.md`

2. Create unpublished GitHub release with release notes

3. Build Linux version on any Docker host with `script/build-linux` and attach to release

4. Build OS X version on Mountain Lion with `script/build-osx` and attach to release as `fig-Darwin-x86_64` and `fig-Linux-x86_64`.
4. Build OS X version on Mountain Lion with `script/build-osx` and attach to release as `docker-compose-Darwin-x86_64` and `docker-compose-Linux-x86_64`.

5. Publish GitHub release, creating tag

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RUN python setup.py install

RUN chown -R user /code/

ENTRYPOINT ["/usr/local/bin/fig"]
ENTRYPOINT ["/usr/local/bin/docker-compose"]
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Fig
===
Docker Compose
==============

[![wercker status](https://app.wercker.com/status/d5dbac3907301c3d5ce735e2d5e95a5b/s/master "wercker status")](https://app.wercker.com/project/bykey/d5dbac3907301c3d5ce735e2d5e95a5b)

Expand Down Expand Up @@ -29,9 +29,7 @@ db:
(No more installing Postgres on your laptop!)
Then type `fig up`, and Fig will start and run your entire app:

![example fig run](https://orchardup.com/static/images/fig-example-large.gif)
Then type `docker-compose up`, and Compose will start and run your entire app.

There are commands to:

Expand Down
16 changes: 7 additions & 9 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
# Roadmap

Fig will be incorporated as part of the Docker ecosystem and renamed Docker Compose. The command-line tool and configuration file will get new names, and its documentation will be moved to [docs.docker.com](https://docs.docker.com).

## More than just development environments

Over time we will extend Fig's remit to cover test, staging and production environments. This is not a simple task, and will take many incremental improvements such as:
Over time we will extend Compose's remit to cover test, staging and production environments. This is not a simple task, and will take many incremental improvements such as:

- Fig’s brute-force “delete and recreate everything” approach is great for dev and testing, but it not sufficient for production environments. You should be able to define a "desired" state that Fig will intelligently converge to.
- Compose’s brute-force “delete and recreate everything” approach is great for dev and testing, but it not sufficient for production environments. You should be able to define a "desired" state that Compose will intelligently converge to.
- It should be possible to partially modify the config file for different environments (dev/test/staging/prod), passing in e.g. custom ports or volume mount paths. ([#426](https://github.com/docker/fig/issues/426))
- Fig recommend a technique for zero-downtime deploys.
- Compose should recommend a technique for zero-downtime deploys.

## Integration with Swarm

Fig should integrate really well with Swarm so you can take an application you've developed on your laptop and run it on a Swarm cluster.
Compose should integrate really well with Swarm so you can take an application you've developed on your laptop and run it on a Swarm cluster.

## Applications spanning multiple teams

Fig works well for applications that are in a single repository and depend on services that are hosted on Docker Hub. If your application depends on another application within your organisation, Fig doesn't work as well.
Compose works well for applications that are in a single repository and depend on services that are hosted on Docker Hub. If your application depends on another application within your organisation, Compose doesn't work as well.

There are several ideas about how this could work, such as [including external files](https://github.com/docker/fig/issues/318).

## An even better tool for development environments

Fig is a great tool for development environments, but it could be even better. For example:
Compose is a great tool for development environments, but it could be even better. For example:

- [Fig could watch your code and automatically kick off builds when something changes.](https://github.com/docker/fig/issues/184)
- [Compose could watch your code and automatically kick off builds when something changes.](https://github.com/docker/fig/issues/184)
- It should be possible to define hostnames for containers which work from the host machine, e.g. “mywebcontainer.local”. This is needed by apps comprising multiple web services which generate links to one another (e.g. a frontend website and a separate admin webapp)
3 changes: 3 additions & 0 deletions bin/docker-compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python
from compose.cli.main import main
main()
3 changes: 0 additions & 3 deletions bin/fig

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 19 additions & 11 deletions fig/cli/command.py → compose/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ def dispatch(self, *args, **kwargs):

def perform_command(self, options, handler, command_options):
if options['COMMAND'] == 'help':
# Skip looking up the figfile.
# Skip looking up the compose file.
handler(None, command_options)
return

explicit_config_path = options.get('--file') or os.environ.get('FIG_FILE')
if 'FIG_FILE' in os.environ:
log.warn('The FIG_FILE environment variable is deprecated.')
log.warn('Please use COMPOSE_FILE instead.')

explicit_config_path = options.get('--file') or os.environ.get('COMPOSE_FILE') or os.environ.get('FIG_FILE')
project = self.get_project(
self.get_config_path(explicit_config_path),
project_name=options.get('--project-name'),
Expand All @@ -59,7 +63,7 @@ def get_client(self, verbose=False):
client = docker_client()
if verbose:
version_info = six.iteritems(client.version())
log.info("Fig version %s", __version__)
log.info("Compose version %s", __version__)
log.info("Docker base_url: %s", client.base_url)
log.info("Docker version: %s",
", ".join("%s=%s" % item for item in version_info))
Expand All @@ -72,7 +76,7 @@ def get_config(self, config_path):
return yaml.safe_load(fh)
except IOError as e:
if e.errno == errno.ENOENT:
raise errors.FigFileNotFound(os.path.basename(e.filename))
raise errors.ComposeFileNotFound(os.path.basename(e.filename))
raise errors.UserError(six.text_type(e))

def get_project(self, config_path, project_name=None, verbose=False):
Expand All @@ -88,7 +92,11 @@ def get_project_name(self, config_path, project_name=None):
def normalize_name(name):
return re.sub(r'[^a-z0-9]', '', name.lower())

project_name = project_name or os.environ.get('FIG_PROJECT_NAME')
if 'FIG_PROJECT_NAME' in os.environ:
log.warn('The FIG_PROJECT_NAME environment variable is deprecated.')
log.warn('Please use COMPOSE_PROJECT_NAME instead.')

project_name = project_name or os.environ.get('COMPOSE_PROJECT_NAME') or os.environ.get('FIG_PROJECT_NAME')
if project_name is not None:
return normalize_name(project_name)

Expand All @@ -102,13 +110,13 @@ def get_config_path(self, file_path=None):
if file_path:
return os.path.join(self.base_dir, file_path)

if os.path.exists(os.path.join(self.base_dir, 'fig.yaml')):
log.warning("Fig just read the file 'fig.yaml' on startup, rather "
"than 'fig.yml'")
log.warning("Please be aware that fig.yml the expected extension "
if os.path.exists(os.path.join(self.base_dir, 'docker-compose.yaml')):
log.warning("Compose just read the file 'docker-compose.yaml' on startup, rather "
"than 'docker-compose.yml'")
log.warning("Please be aware that .yml is the expected extension "
"in most cases, and using .yaml can cause compatibility "
"issues in future")

return os.path.join(self.base_dir, 'fig.yaml')
return os.path.join(self.base_dir, 'docker-compose.yaml')

return os.path.join(self.base_dir, 'fig.yml')
return os.path.join(self.base_dir, 'docker-compose.yml')
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions fig/cli/errors.py → compose/cli/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(self, url):
""" % url)


class FigFileNotFound(UserError):
class ComposeFileNotFound(UserError):
def __init__(self, filename):
super(FigFileNotFound, self).__init__("""
super(ComposeFileNotFound, self).__init__("""
Can't find %s. Are you in the right directory?
""" % filename)
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions fig/cli/main.py → compose/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ class TopLevelCommand(Command):
"""Fast, isolated development environments using Docker.
Usage:
fig [options] [COMMAND] [ARGS...]
fig -h|--help
docker-compose [options] [COMMAND] [ARGS...]
docker-compose -h|--help
Options:
--verbose Show more output
--version Print version and exit
-f, --file FILE Specify an alternate fig file (default: fig.yml)
-f, --file FILE Specify an alternate compose file (default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name (default: directory name)
Commands:
Expand All @@ -99,16 +99,16 @@ class TopLevelCommand(Command):
"""
def docopt_options(self):
options = super(TopLevelCommand, self).docopt_options()
options['version'] = "fig %s" % __version__
options['version'] = "docker-compose %s" % __version__
return options

def build(self, project, options):
"""
Build or rebuild services.
Services are built once and then tagged as `project_service`,
e.g. `figtest_db`. If you change a service's `Dockerfile` or the
contents of its build directory, you can run `fig build` to rebuild it.
e.g. `composetest_db`. If you change a service's `Dockerfile` or the
contents of its build directory, you can run `compose build` to rebuild it.
Usage: build [options] [SERVICE...]
Expand Down Expand Up @@ -261,11 +261,11 @@ def run(self, project, options):
For example:
$ fig run web python manage.py shell
$ docker-compose run web python manage.py shell
By default, linked services will be started, unless they are already
running. If you do not want to start linked services, use
`fig run --no-deps SERVICE COMMAND [ARGS...]`.
`docker-compose run --no-deps SERVICE COMMAND [ARGS...]`.
Usage: run [options] [-e KEY=VAL...] SERVICE [COMMAND] [ARGS...]
Expand All @@ -280,7 +280,7 @@ def run(self, project, options):
--rm Remove container after run. Ignored in detached mode.
--service-ports Run command with the service's ports enabled and mapped
to the host.
-T Disable pseudo-tty allocation. By default `fig run`
-T Disable pseudo-tty allocation. By default `docker-compose run`
allocates a TTY.
"""
service = project.get_service(options['SERVICE'])
Expand Down Expand Up @@ -352,7 +352,7 @@ def scale(self, project, options):
Numbers are specified in the form `service=num` as arguments.
For example:
$ fig scale web=2 worker=3
$ docker-compose scale web=2 worker=3
Usage: scale [SERVICE=NUM...]
"""
Expand All @@ -372,7 +372,7 @@ def scale(self, project, options):
'Service "%s" cannot be scaled because it specifies a port '
'on the host. If multiple containers for this service were '
'created, the port would clash.\n\nRemove the ":" from the '
'port definition in fig.yml so Docker can choose a random '
'port definition in docker-compose.yml so Docker can choose a random '
'port for each container.' % service_name)

def start(self, project, options):
Expand All @@ -387,7 +387,7 @@ def stop(self, project, options):
"""
Stop running containers without removing them.
They can be started again with `fig start`.
They can be started again with `docker-compose start`.
Usage: stop [SERVICE...]
"""
Expand All @@ -405,14 +405,14 @@ def up(self, project, options):
"""
Build, (re)create, start and attach to containers for a service.
By default, `fig up` will aggregate the output of each container, and
when it exits, all containers will be stopped. If you run `fig up -d`,
By default, `docker-compose up` will aggregate the output of each container, and
when it exits, all containers will be stopped. If you run `docker-compose up -d`,
it'll start the containers in the background and leave them running.
If there are existing containers for a service, `fig up` will stop
If there are existing containers for a service, `docker-compose up` will stop
and recreate them (preserving mounted volumes with volumes-from),
so that changes in `fig.yml` are picked up. If you do not want existing
containers to be recreated, `fig up --no-recreate` will re-use existing
so that changes in `docker-compose.yml` are picked up. If you do not want existing
containers to be recreated, `docker-compose up --no-recreate` will re-use existing
containers.
Usage: up [options] [SERVICE...]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fig/project.py → compose/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def from_config(cls, name, config, client):
dicts = []
for service_name, service in list(config.items()):
if not isinstance(service, dict):
raise ConfigurationError('Service "%s" doesn\'t have any configuration options. All top level keys in your fig.yml must map to a dictionary of configuration options.' % service_name)
raise ConfigurationError('Service "%s" doesn\'t have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.' % service_name)
service['name'] = service_name
dicts.append(service)
return cls.from_dicts(name, dicts, client)
Expand Down
2 changes: 1 addition & 1 deletion fig/service.py → compose/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def has_container(self, container, one_off=False):
return project == self.project and name == self.name

def get_container(self, number=1):
"""Return a :class:`fig.container.Container` for this service. The
"""Return a :class:`compose.container.Container` for this service. The
container must be active, and match `number`.
"""
for container in self.client.containers():
Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore-gh-pages

This file was deleted.

1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

10 changes: 0 additions & 10 deletions docs/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions docs/Gemfile

This file was deleted.

Loading

0 comments on commit 4869fed

Please sign in to comment.