diff --git a/README.md b/README.md index 3245e0a960..5b0d5ddc82 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,11 @@ Run `docker compose -f docker-compose-prod.yaml --env-file scripts/variables.env All that's left for you is to add the devices. To add the devices you will need a running provider instance and one or multiple adb servers that are connected to the devices. The easiest way to run the provider is to do -1) npm ci -2) npm link --force -3) MONGODB_PORT_27017_TCP=mongodb://localhost:27017 stf provider --connect-sub "tcp://localhost:7250" --connect-push "tcp://localhost:7270" --storage-url "http://localhost:8082" +1) Ensure you have python and that setuptools is installed (needed for zeromq npm dependency) +2) Install node version 20.17 or later +3) npm ci +4) npm link --force +5) MONGODB_PORT_27017_TCP=mongodb://localhost:27017 stf provider --connect-sub "tcp://localhost:7250" --connect-push "tcp://localhost:7270" --storage-url "http://localhost:8082" Note: some features require direct access to the provider instance from the browser, so if you are running the provider on a different machine - make sure you pass accessible url to the --public-ip. diff --git a/README.ru.md b/README.ru.md index abcb790112..a5418402ac 100644 --- a/README.ru.md +++ b/README.ru.md @@ -22,9 +22,10 @@ VK DeviceHub - это форк проекта DeviceFarmer/stf, разработ Для этого нужно запустить провайдер и иметь работающее adb соединение с устройством. Самый простой способ это: 1) Убедиться что установлен питон и в нём установлен setuptools (нужен для одной из наших npm зависимостей) -2) `npm ci` - скачать и установить зависимости -3) `npm link --force` - Добавить исполняемый файл в текущий PATH -4) `MONGODB_PORT_27017_TCP=mongodb://localhost:27017 stf provider --connect-sub "tcp://localhost:7250" --connect-push "tcp://localhost:7270" --storage-url "http://localhost:8082"` +2) Установить npm версии не меньше 20.17 (рекомендуем nvm) +3) `npm ci` - скачать и установить зависимости +4) `npm link --force` - Добавить исполняемый файл в текущий PATH +5) `MONGODB_PORT_27017_TCP=mongodb://localhost:27017 stf provider --connect-sub "tcp://localhost:7250" --connect-push "tcp://localhost:7270" --storage-url "http://localhost:8082"` Замечание: Некоторый функционал требует наличия прямого доступа до провайдера из браузера. Поэтому в случае сложных инсталляций не забудьте передать внешнедоступный url в параметр --public-url diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 89aa0ee182..90e907b6bd 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -8,7 +8,7 @@ services: entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] networks: default: - ipv4_address: 172.88.0.2 + ipv4_address: 172.19.0.2 mongo2: image: mongo:6.0.10 hostname: mongo2 @@ -16,7 +16,7 @@ services: entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] networks: default: - ipv4_address: 172.88.0.3 + ipv4_address: 172.19.0.3 mongo3: image: mongo:6.0.10 hostname: mongo3 @@ -24,7 +24,7 @@ services: entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] networks: default: - ipv4_address: 172.88.0.4 + ipv4_address: 172.19.0.4 mongosetup: image: mongo:6.0.10 depends_on: @@ -34,7 +34,7 @@ services: volumes: - ./scripts/mongo_setup.sh:/scripts/mongo_setup.sh restart: "no" - entrypoint: [ "bash", "/scripts/mongo_setup.sh"] + entrypoint: ["bash", "/scripts/mongo_setup.sh"] adb: container_name: adb image: devicefarmer/adb:latest @@ -44,12 +44,12 @@ services: privileged: true networks: default: - ipv4_address: 172.88.0.6 + ipv4_address: 172.19.0.6 networks: default: driver: bridge ipam: driver: default config: - - subnet: 172.88.0.0/16 - gateway: 172.88.0.1 + - subnet: 172.19.0.0/16 + gateway: 172.19.0.1 diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml index 6a97f12cee..93fe69a276 100644 --- a/docker-compose-prod.yaml +++ b/docker-compose-prod.yaml @@ -1,6 +1,13 @@ version: "3" + networks: - devicehub: + default: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.19.0.0/16 + gateway: 172.19.0.1 services: nginx: @@ -26,16 +33,25 @@ services: ports: - 27017:27017 entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] + networks: + default: + ipv4_address: 172.19.0.2 mongo2: image: mongo:6.0.10 hostname: mongo2 container_name: mongo2 entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] + networks: + default: + ipv4_address: 172.19.0.3 mongo3: image: mongo:6.0.10 hostname: mongo3 container_name: mongo3 entrypoint: ["mongod", "--replSet", "myReplicaSet", "--bind_ip_all"] + networks: + default: + ipv4_address: 172.19.0.4 mongosetup: image: mongo:6.0.10 container_name: mongosetup diff --git a/docker-compose-test.yaml b/docker-compose-test.yaml index f98619b675..6da5887d36 100644 --- a/docker-compose-test.yaml +++ b/docker-compose-test.yaml @@ -9,7 +9,7 @@ services: ["mongod", "--replSet", "myReplicaSet", "--bind_ip", "localhost,mongo1"] networks: default: - ipv4_address: 172.88.0.2 + ipv4_address: 172.19.0.2 mongo2: image: mongo:6.0.10 hostname: mongo2 @@ -18,7 +18,7 @@ services: ["mongod", "--replSet", "myReplicaSet", "--bind_ip", "localhost,mongo2"] networks: default: - ipv4_address: 172.88.0.3 + ipv4_address: 172.19.0.3 mongo3: image: mongo:6.0.10 hostname: mongo3 @@ -27,7 +27,7 @@ services: ["mongod", "--replSet", "myReplicaSet", "--bind_ip", "localhost,mongo3"] networks: default: - ipv4_address: 172.88.0.4 + ipv4_address: 172.19.0.4 mongosetup: image: mongo:6.0.10 depends_on: @@ -47,7 +47,7 @@ services: privileged: true networks: default: - ipv4_address: 172.88.0.6 + ipv4_address: 172.19.0.6 devicehub: container_name: devicehub build: . @@ -58,19 +58,19 @@ services: - "7400-7500:7400-7500" environment: - TZ='America/Los_Angeles' - - MONGODB_PORT_27017_TCP=mongodb://172.88.0.2:27017 + - MONGODB_PORT_27017_TCP=mongodb://172.19.0.2:27017 - STF_ADMIN_EMAIL='test@example.com' - STF_ADMIN_NAME='test admin' restart: unless-stopped command: stf local --adb-host adb --public-ip 0.0.0.0 --provider-min-port 7400 --provider-max-port 7500 networks: default: - ipv4_address: 172.88.0.5 + ipv4_address: 172.19.0.5 networks: default: driver: bridge ipam: driver: default config: - - subnet: 172.88.0.0/16 - gateway: 172.88.0.1 + - subnet: 172.19.0.0/16 + gateway: 172.19.0.1 diff --git a/scripts/mongo_setup.sh b/scripts/mongo_setup.sh index 398b9dfb98..a45729837b 100644 --- a/scripts/mongo_setup.sh +++ b/scripts/mongo_setup.sh @@ -1,24 +1,24 @@ #!/bin/bash sleep 10 -mongosh --host mongo1:27017 <