Coder Social home page Coder Social logo

Comments (7)

jay0129 avatar jay0129 commented on August 17, 2024 1

@denis99999,
Sorry for not providing complete configuration in advance.
After fixing some network problems, it turned out that your solution, mapping ports for dev-triproxy, solved the problem.
Now it works perfectly and thank you again.

from stf.

issue-label-bot avatar issue-label-bot commented on August 17, 2024

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.93. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from stf.

denis99999 avatar denis99999 commented on August 17, 2024

@jay0129 ,

I have a dockerized setup using the script from stf-poc on a machineA

It is not part of DeviceFarmer/ STF documentation.

I am trying to attach machineB to machineA, but I am having trouble, please help me.

Please describe in detail the issue you met ? What is working and what is not working ?

1. Is it enough to just run or install `stf-provider` and `adb` on machineB?

Yes

2. For the command `stf provider` from machineB, should I pass `--public-ip` with machineA's IP or machineB's IP?

machineA's IP

3. For the command `stf provider` from machineB, should I pass `screen-ws-url-pattern` with machineA's IP and stations name?

Yes, it seems correct, in fact, it must match the location URL pattern you provided in nginx.conf file.

4. STF is already running on machineA, should I restart machineA after attaching machineB to it? I am wondering the sequence of these kinds of operations

No need to restart machineA, but if you modified the nginx.conf file you have perhaps to restart nginx unit.

nginx.conf on machineA:

    location ~ "^/d/machineA/([^/]+)/(?<port>[0-9]{3,5})/$" {
      proxy_pass http://provider:$port/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Real-IP $remote_addr;
    }

    location ~ "^/d/machineB/([^/]+)/(?<port>[0-9]{5})/$" {
      proxy_pass http://${MACHINE_B_IP}:$port/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Real-IP $remote_addr;
    }

For more information, you can see full nginx.conf here

The location URL for machineB seems correct expected that the STATION_NAME variable at provider side is equal to machineB.

docker-compose.yml on machineA:

Same as here with few changes including auth-ldap

You have also to include the groups-engine unit, report to DEPLOYMENT.md for help!

from stf.

jay0129 avatar jay0129 commented on August 17, 2024

Thanks for your help.
I followed all your instructions including groups-engine unit, but it still shows nothing about machineB on the STF web console.

I did these things additionally:

  1. Use 7400~7500 ports for machineA's provider
  2. Use 7501~7700 ports for machineB's provider

Console logs on machineB:

Creating network "stfbox_default" with the default driver
WARNING: Found orphan containers (stfbox_dev-triproxy_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating stfbox_adb_1 ... done
Creating stfbox_provider_1 ... done
Attaching to stfbox_adb_1, stfbox_provider_1
adb_1       | adb I 09-16 01:03:50     6     6 adb_auth_host.cpp:416] adb_auth_init...
adb_1       | adb I 09-16 01:03:50     6     6 adb_auth_host.cpp:174] read_key_file '/root/.android/adbkey'...
adb_1       | adb I 09-16 01:03:50     6     6 adb_auth_host.cpp:391] adb_auth_inotify_init...
provider_1  | 2020-09-16T01:03:53.201Z INF/provider 1 [*] Subscribing to permanent channel "xxxxxx"
provider_1  | 2020-09-16T01:03:53.221Z INF/provider 1 [*] Sending output to "tcp://MACHINE_A_IP:7270"
provider_1  | 2020-09-16T01:03:53.223Z INF/provider 1 [*] Receiving input from "tcp://MACHINE_A_IP:7250"
provider_1  | 2020-09-16T01:03:53.228Z INF/provider 1 [*] Tracking devices
provider_1  | 2020-09-16T01:03:53.230Z INF/provider 1 [*] Found device "HT7BR1Axxxxx" (device)

I dought about the internet connection between each machines, so I have tested these for all ports from 7400 to 7700.
Test result:

On machineA side
nc -l 7400
On machineB side
echo "hello" | nc ${MACHINE_A_IP} 7400
Message is sendable, but the connection is closed right after the message transmission

On machineB side
nc -l 7400
On machineA side
echo "hello" | nc ${MACHINE_B_IP} 7400
Message is sendable, and the connection is still opened

Additional question:
Following unit seems not running on machineA.
https://github.com/DeviceFarmer/stf/blob/master/doc/DEPLOYMENT.md#rethinkdb-proxy-28015service
Didn't I need to run rethinkdb-proxy on machineA?
I feel like there is no rethinkdb-proxy in my implementation, I followed this docker-compose.yml on machineA.

from stf.

denis99999 avatar denis99999 commented on August 17, 2024

@jay0129,

I followed all your instructions including groups-engine unit, but it still shows nothing about machineB on the STF web console.

Adding groups-engine unit is not to solve your issue but to reach a correct and complete configuration.

I did these things additionally:

1. Use 7400~7500 ports for machineA's provider

2. Use 7501~7700 ports for machineB's provider

Fyi, you can keep the same port range for the two providers beacuse they are running on two distinct machines.

It seems your provider unit on machineB is unable to reach the dev-triproxy unit on machineA, it is probably because the corresponding ports are not opened, so you have to add the following mapping port for dev-triproxy unit:

...
ports:
 - "7250:7250"
 - "7270:7270"
...

Like this, it should work better!

Didn't I need to run rethinkdb-proxy on machineA?

No need because all the main units are on the same machine.

from stf.

jay0129 avatar jay0129 commented on August 17, 2024

Thanks for your answer!
However, I can't fix the problem, with same console logs.

I realized that machineB was inside Virtualbox on a top of OSX.
Since I am using NAT, I forwarded 7400~7700 and 7250,7260,7270,7150,7160,7160.
Additionally 3000.
Is there any other ports I am missing to forward? I guess 7250 and 7270 is enough.

I did this also:
I changed provider's name on machineB to provider_bs2, since I thought same provider's name probably made this problem.

Do I have to add the following mapping port for provider unit of machineB?:

ports:
 - 7250:7250
 - 7270:7270

from stf.

denis99999 avatar denis99999 commented on August 17, 2024

@jay0129 ,

So far you have not provided your own complete configuration, nor your complete logs, but you only referred to an STF configuration template which is not part of the DeviceFarmer / STF documentation, so that I no longer understand your execution environment, under these conditions it is very difficult for me to help you further.

from stf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.