Skip to content

Commit

Permalink
extract methods of starting
Browse files Browse the repository at this point in the history
simplifies the main README.md
  • Loading branch information
akash1810 committed Feb 17, 2016
1 parent bb65362 commit 80e5dfc
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 144 deletions.
146 changes: 2 additions & 144 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,152 +116,10 @@ config, so that CORS is enabled across APIs.
Make sure you put the generated ```.properties``` files in
```/etc/gu/``` instead of ```~/.gu/``` as many apps do.

### Run Media API

From the project root, run via sbt:
### Run the services
There are a few different ways to run the services, please see [here](./docs/running.md).

$ sbt
> project media-api
> run

You may pass an argument to `run` to define which port to attach to, e.g.:

> run 9001

The media api should be up at
[http://localhost:9001/](http://localhost:9001/).


### Run Thrall

From the project root, run via sbt:

$ sbt
> project thrall
> run 9002

The thrall should be up at
[http://localhost:9002/](http://localhost:9002/).


### Run the Image Loader

From the project root, run via sbt:

$ sbt
> project image-loader
> run 9003

The image loader should be up at
[http://localhost:9003/](http://localhost:9003/).

You can upload a test image to it using `curl`:

```
curl -X POST --data-binary @integration/src/test/resources/images/honeybee.jpg http://localhost:9003/images
```

It should then appear in the Media API at [http://localhost:9001/images](http://localhost:9001/images).


### Run the FTP Watcher

From the project root, run via sbt:

$ sbt -Dftp.active=true
> project ftp-watcher
> run 9004

The FTP watcher should be up at
[http://localhost:9004/](http://localhost:9004/).

Images should appear in the Media API at [http://localhost:9001/images](http://localhost:9001/images).


### Run Kahuna

Run the `setup.sh` script from the kahuna directory to get started:

$ cd kahuna
$ ./setup.sh

Then, from the project root, run via sbt:

$ sbt
> project kahuna
> run 9005

The user interface should be up at
[http://localhost:9005/](http://localhost:9005/).


### Run Cropper

From the project root, run via sbt:

$ sbt
> project cropper
> run 9006

The user interface should be up at
[http://localhost:9006/](http://localhost:9006/).


### Run Metadata Editor

From the project root, run via sbt:

$ sbt
> project metadata-editor
> run 9007

The user interface should be up at
[http://localhost:9007/](http://localhost:9007/).


### Run Collections

From the project root, run via sbt:

$ sbt
> project collections
> run 9010

The user interface should be up at
[http://localhost:9010/](http://localhost:9010/).


### [Run ImgOps](imgops/README.md)

### Running with [GridRunner](https://github.com/guardian/grid_runner/)
Grid Runner helps manage grid microservices

Install grid_runner:

$ gem install grid_runner

* aliases makes life better (in .bash_profile or somehwere similar):
alias gr=grid_runner
* remember to update once in a while

From the project root:

$ gr list
$ gr run all
$ gr kill kahuna media-api
$ gr restart elasticsearch
$ gr log thrall usage

* all commands take either "all" or a space-delimited list of apps

you can see the different application names in the Procfile (in project root)

### Running wih Docker
The Grid can be run within Docker containers!

NB: this has only been tested in DEV.

To do so, follow the [README](./docker/README.md#setup).

## Troubleshooting

Expand Down
59 changes: 59 additions & 0 deletions docs/running.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Running services

Grid consists of many micro-services. There are a few different ways to start them.

## Manually
From the **project root**:

- [elasticsearch](../elasticsearch/dev-start.sh)
- media-api `sbt "project media-api" "run 9001"`
- thrall `sbt "project thrall" "run 9002"`
- image-loader `sbt "project image-loader" "run 9003"`
- ftp-watcher (optional, and soon to be deprecated) `sbt -Dftp.active=true "project ftp-watcher" "run 9004"`
- kahuna `sbt "project kahuna" "run 9005"`
- cropper `sbt "project cropper" "run 9006"`
- metadata-editor `sbt "project metadata-editor" "run 9007"`
- collections `sbt "project collections" "run 9010"`
- auth `sbt "project auth" "run 9011"`
- [imgops](../imgops/README.md)

## [run.sh](../run.sh)
`run.sh` is a single script to start all the services.

## [run_tmux.sh](../run_tmux.sh)
`run_tmux.sh` is a single script to start all the services in a tmux environment.

## [GridRunner](https://github.com/guardian/grid_runner/)
Grid Runner helps manage grid micro-services

Install grid_runner:

$ gem install grid_runner

* aliases makes life better (in .bash_profile or somewhere similar):
alias gr=grid_runner
* remember to update once in a while

From the project root:

$ gr list
$ gr run all
$ gr kill kahuna media-api
$ gr restart elasticsearch
$ gr log thrall usage

* all commands take either "all" or a space-delimited list of apps

you can see the different application names in the Procfile (in project root)


## Docker
Its possible to run Grid using Docker. Please follow the [README](../docker/README.md#setup) beforehand.

To run the containers, run:

```sh
docker-compose up -d
```

NB: This has only been tested in DEV.

0 comments on commit 80e5dfc

Please sign in to comment.