added selenoid

This commit is contained in:
kev 2019-11-03 12:01:33 +08:00
parent 3d07dd0039
commit 8fa3f30613
8 changed files with 152 additions and 1 deletions

View File

@ -320,6 +320,13 @@ A collection of delicious docker recipes.
- [x] node-chrome
- [x] node-firefox
- [x] standalone-firefox
- [x] aerokube
- [x] selenoid
- [x] video-recorder
- [x] chrome
- [x] firefox
- [x] vnc
- selenoid-ui
- [x] sentry
- [x] scrapinghub/splash
- [x] teamatldocker

View File

@ -4,5 +4,11 @@ ggr
Go Grid Router (aka [Ggr][1]) is a lightweight active load balancer used to
create scalable and highly-available Selenium clusters.
```bash
$ curl -X POST http://localhost:4444/wd/hub
$ curl http://localhost:4444/ping
$ curl http://localhost:4444/quota
```
[1]: https://github.com/aerokube/ggr

View File

@ -1,5 +1,7 @@
version: '3.5'
version: '3.7'
services:
hub:
image: selenium/hub:3.141.59-selenium
ports:
@ -19,6 +21,7 @@ services:
- node.role == manager
restart_policy:
condition: on-failure
firefox:
image: selenium/node-firefox:3.141.59-selenium
entrypoint: bash -c 'REMOTE_HOST=http://$$HOSTNAME:5555 /opt/bin/entry_point.sh'
@ -39,6 +42,7 @@ services:
- node.role == manager
restart_policy:
condition: on-failure
chrome:
image: selenium/node-chrome:3.141.59-selenium
entrypoint: bash -c 'REMOTE_HOST=http://$$HOSTNAME:5555 /opt/bin/entry_point.sh'
@ -59,6 +63,7 @@ services:
- node.role == worker
restart_policy:
condition: on-failure
networks:
default:
ipam:

80
selenoid/README.md Normal file
View File

@ -0,0 +1,80 @@
selenoid
========
[Selenoid][1] is a Golang implementation of Selenium protocol using Docker to launch
browser sessions (so it is a replacement of Java-based Selenium server).
Currently it supports working with Docker directly (no support for Swarm or
Kubernetes).
Directory Tree
--------------
```
selenoid/
├── README.md
├── data/
│ ├── config/
│ │ └── browsers.json
│ ├── logs/
│ └── video/
└── docker-compose.yml
```
Required Images
---------------
- aerokube/selenoid:latest-release
- aerokube/selenoid-ui:latest-release
- selenoid/video-recorder:latest-release
- selenoid/chrome:78.0
- selenoid/firefox:70.0
- selenoid/vnc:chrome_78.0
- selenoid/vnc:firefox_70.0
```json
{
"chrome": {
"default": "78.0",
"versions": {
"78.0": {
"image": "selenoid/vnc:chrome_78.0",
"port": "4444"
}
}
},
"firefox": {
"default": "70.0",
"versions": {
"70.0": {
"image": "selenoid/vnc:firefox_70.0",
"port": "4444"
}
}
}
}
```
```python
#!/usr/bin/env python
from selenium import webdriver
capabilities = {
"browserName": "chrome",
"version": "78.0",
"enableVNC": True,
"enableVideo": False
}
driver = webdriver.Remote(
command_executor="http://172.0.0.1:4444/wd/hub",
desired_capabilities=capabilities)
driver.maximize_window()
driver.get('https://www.google.com/')
driver.save_screenshot('google.png')
driver.close()
```
[1]: https://aerokube.com/selenoid/latest/

View File

@ -0,0 +1,20 @@
{
"chrome": {
"default": "78.0",
"versions": {
"78.0": {
"image": "selenoid/vnc:chrome_78.0",
"port": "4444"
}
}
},
"firefox": {
"default": "70.0",
"versions": {
"70.0": {
"image": "selenoid/vnc:firefox_70.0",
"port": "4444"
}
}
}
}

View File

View File

View File

@ -0,0 +1,33 @@
version: "3.7"
services:
selenoid:
image: aerokube/selenoid:latest-release
command: |
-conf config/browsers.json
-video-output-dir video
-log-output-dir logs
-limit 5
-timeout 1m
-max-timeout 30m
-container-network selenoid_default
ports:
- "4444:4444"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/opt/selenoid
environment:
- TZ=UTC
- OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/data/video
working_dir: /opt/selenoid
restart: unless-stopped
selenoid-ui:
image: aerokube/selenoid-ui:latest-release
command: --selenoid-uri=http://selenoid:4444
ports:
- "8080:8080"
depends_on:
- selenoid
restart: unless-stopped