华为云为 STF 主服务器,已经在控制台开启了对应端口,然后本地局域网有一台 centos7.6 的机器作为插手机的从机,可以正常在 STF 的页面进行 shell 命令的执行,
但是 STF 给出的 Remote Debug 地址,无法通过本地的笔记本进行 adb connect 连接、
version: '3'
volumes:
rethinkdb:
storage-temp:
services:
nginx:
build: nginx/
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
restart: unless-stopped
ports:
- 80:80 # 这个配置,stf不需要再输入7100 即可访问前端页面
depends_on:
- app
- auth
- storage-plugin-apk
- storage-plugin-image
- storage-temp
- websocket
- api
adb:
image: sorccu/adb:latest
restart: unless-stopped
privileged: true
volumes:
- /dev/bus/usb:/dev/bus/usb
rethinkdb:
image: rethinkdb:2.3
restart: unless-stopped
volumes:
- rethinkdb:/data
app:
image: openstf/stf:latest
restart: unless-stopped
environment:
- RETHINKDB_PORT_28015_TCP
- SECRET
command: stf app --auth-url http://${PUBLIC_IP}/auth/mock/ --websocket-url ws://${PUBLIC_IP}/ --port 3000
depends_on:
- rethinkdb
- auth
- websocket
auth:
image: openstf/stf:latest
restart: unless-stopped
environment:
- RETHINKDB_PORT_28015_TCP
- SECRET
command: stf auth-mock --app-url http://${PUBLIC_IP}/ --port 3000
depends_on:
- rethinkdb
processor:
image: openstf/stf:latest
restart: unless-stopped
environment:
- RETHINKDB_PORT_28015_TCP
command: stf processor --connect-app-dealer tcp://triproxy:7160 --connect-dev-dealer tcp://dev-triproxy:7260
depends_on:
- rethinkdb
- triproxy
- dev-triproxy
triproxy: ##这个是provider和主服务器交流的关键,因为到时候子节点运行的时候会配该节点的信息
image: openstf/stf:latest
restart: unless-stopped
command: stf triproxy app --bind-pub "tcp://*:7150" --bind-dealer "tcp://*:7160" --bind-pull "tcp://*:7170"
ports:
- 7150:7150
- 7170:7170
## 如果你想搭建集群,这个地方一定要配置端口映射,不然子节点无法和该单元通讯
dev-triproxy:
image: openstf/stf:latest
restart: unless-stopped
command: stf triproxy dev --bind-pub "tcp://*:7250" --bind-dealer "tcp://*:7260" --bind-pull "tcp://*:7270"
ports:
- 7270:7270
- 7250:7250
- 7260:7260
## 如果你想搭建集群,这个地方一定要配置端口映射,不然子节点无法和该单元通讯
migrate:
image: openstf/stf:latest
environment:
- RETHINKDB_PORT_28015_TCP
command: stf migrate
depends_on:
- rethinkdb
provider:
image: openstf/stf:latest
restart: unless-stopped
command: stf provider --name ${STATION_NAME} --connect-sub tcp://dev-triproxy:7250 --connect-push tcp://dev-triproxy:7270 --storage-url http://${PUBLIC_IP}/ --public-ip ${PUBLIC_IP} --heartbeat-interval 10000 --screen-ws-url-pattern "ws://${PUBLIC_IP}/d/nuc/<%= serial %>/<%= publicPort %>/" --adb-host adb --min-port 7400 --max-port 7700 --allow-remote
ports:
- 7400-7700:7400-7700
depends_on:
- adb
- dev-triproxy
- triproxy
- storage-temp
reaper:
image: openstf/stf:latest
restart: unless-stopped
environment:
- RETHINKDB_PORT_28015_TCP
depends_on:
- migrate
- rethinkdb
- dev-triproxy
- triproxy
command: stf reaper dev --connect-push tcp://dev-triproxy:7270 --connect-sub tcp://triproxy:7150 --heartbeat-timeout 30000
storage-plugin-apk:
image: openstf/stf:latest
restart: unless-stopped
command: stf storage-plugin-apk --port 3000 --storage-url http://${PUBLIC_IP}/
depends_on:
- storage-temp
storage-plugin-image:
image: openstf/stf:latest
restart: unless-stopped
command: stf storage-plugin-image --port 3000 --storage-url http://${PUBLIC_IP}/
depends_on:
- storage-temp
storage-temp:
build: storage-temp/
restart: unless-stopped
volumes:
- storage-temp:/app/data
command: stf storage-temp --port 3000 --save-dir /app/data
websocket:
image: openstf/stf:latest
restart: unless-stopped
environment:
- SECRET
- RETHINKDB_PORT_28015_TCP
command: stf websocket --port 3000 --storage-url http://${PUBLIC_IP}/ --connect-sub tcp://triproxy:7150 --connect-push tcp://triproxy:7170
depends_on:
- migrate
- rethinkdb
- storage-temp
- triproxy
- dev-triproxy
api:
image: openstf/stf:latest
restart: unless-stopped
environment:
- SECRET
- RETHINKDB_PORT_28015_TCP
command: stf api --port 3000 --connect-sub tcp://triproxy:7150 --connect-push tcp://triproxy:7170 --connect-sub-dev tcp://dev-triproxy:7250 --connect-push-dev tcp://dev-triproxy:7270
depends_on:
- migrate
- rethinkdb
- triproxy
docker pull openstf/stf:latest # 拉取openstf/stf
docker pull sorccu/adb:latest # 拉取adb service
docker run -d --name adbd --privileged -v /dev/bus/usb:/dev/bus/usb --net host sorccu/adb:latest
docker run -d \
--name slave_provider_1 \
--net host openstf/stf stf provider \
--name slave_provider_1 --min-port 7400 \
--max-port 7700 --connect-sub tcp://xxxxxx:7250
--connect-push tcp://xxxxxx:7270 \
--group-timeout 9000 --public-ip xxxxx \
--storage-url http://xxxx/ --vnc-initial-size 600x800 \
--allow-remote \
-- screen-ws-url-pattern "ws://xxxxx/d/slaveprovider/<%= serial %>/<%= publicPort %>/"