https://github.com/donpage/grid-composer
A layer on top of Selenium Docker that exposes docker-compose commands via API (using express)
https://github.com/donpage/grid-composer
docker-compose docker-selenium selenium-grid
Last synced: 2 months ago
JSON representation
A layer on top of Selenium Docker that exposes docker-compose commands via API (using express)
- Host: GitHub
- URL: https://github.com/donpage/grid-composer
- Owner: DonPage
- Created: 2017-03-12T16:39:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-25T18:07:03.000Z (about 9 years ago)
- Last Synced: 2025-05-18T04:37:08.259Z (about 1 year ago)
- Topics: docker-compose, docker-selenium, selenium-grid
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Grid Composer
Grid Composer is a layer on top of [Docker-Selenium](https://github.com/SeleniumHQ/docker-selenium) and [Docker-Compose](https://docs.docker.com/compose/) to provide API endpoints for commonly used commands for your Selenium Nodes.
## API
_All API methods are public by default. Passing in `{token: 'secretToken'}` will confirm request by checking the token parameter in the request. IE `/status?token=secretToken`._
| Method | Endpoint | Docker-Compose equivalent | Description |
| ---- | ----------- | ----------- | ----------- |
| POST | `/start` | `$ docker-compose up -d` | boot up docker containers. |
| POST | `/stop` | `$ docker-compose down` | shutdown docker containers. |
| POST | `/restart` | `$ docker-compose restart` | restart all docker containers. |
| PUT | `/scale/:browserName/:numberOfNodes` | `$ docker-compose scale =` | Scale up a specific browser node. |
| GET | `/status` | `$ docker-compose ps` | get info on node containers. |
## How to use
1. cd into the location of `docker-compose.yml`.
2. clone repo: `$ git clone https://github.com/DonPage/grid-composer.git .` (the `.` is so it clones everything _within_ in the repo.)
3. (_optional_) create `config.json`.
4. run `$ npm install`.
5. run `$ npm start`.
## Config options
_These options should be a json format inside config.json_
| Option | Type | Default | Description |
| ---- | ----------- | ----------- | ----------- |
| maxNodes | `number` | `20` | Max number of nodes that should be idle/up at any given time. |
| token | `string` | `false` | token to confirm against before executing docker-compose commands. If `false`, all API endpoints will be open |
| port | `number` | `8080` | The open port you want the API to listen on. |