Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clarifications] Testing in a local environment #419

Closed
federicoruggeri opened this issue Mar 16, 2021 · 6 comments · Fixed by #655
Closed

[Clarifications] Testing in a local environment #419

federicoruggeri opened this issue Mar 16, 2021 · 6 comments · Fixed by #655
Labels
architect-api bug Something isn't working

Comments

@federicoruggeri
Copy link

Dear All,
I've started working with ParlAI and Mephisto some days ago in order to define an interface for data collection. In particular, I've extend the parlai-chat-demo to meet my task-specific requirements.

I was wondering how to test the interface with users in a local network or by remotely connecting to my server. Thus, I've looked up for existing threads about the same topic: #409 and #303 as the main examples.

Since I'm no expert in this kind of stuff, I'm not completely sure what are the current networking setups that I can consider at the moment. Therefore, I kindly ask you for a gentle summary/tutorial concerning the particular objective of testing locally/remotely with own server.

To summarize, I would like to know if there's an answer to these main questions:
Q: Is it possible to easily test the interface with other people in a local environment (same network)?
Q: How to do so?

Down below I report a list of additional questions with related comments:

  1. My server has a static IP, can I test it locally on the same network? Connecting from the same network to the server brings up a 'disconnected' status in the interface.

  2. Can I use the mentioned nginx reverse proxy to access to my interface? What are the steps? I've tried setting it up and then access to the server. I'm able to access to the interface but the connection status is still 'disconnected'.

  3. Do I need a specific mephisto configuration for local testing? Up until now I've worked with "mephisto/architect"="local" and "mephisto/provider"="mock".

Thanks in advance and apologies if this issue sounds just as a duplicate of some past issues.
Unfortunately, I'm not sure I've done everything right until now.

@JackUrb
Copy link
Contributor

JackUrb commented Mar 22, 2021

Hi @federicoruggeri, sorry for the delay here. To answer your questions, testing locally should be possible, and shouldn't require usage of a reverse proxy. If you have a static IP on the network, you can specify the IP itself as the mephisto.architect.hostname argument, which updates the LocalArchitect to be listening to more than just requests for localhost. This should resolve your issue, but let me know if you're still stuck after this.

@federicoruggeri
Copy link
Author

Hi @JackUrb!
Thank you very much for your reply.
I've tried what you suggested as follows:

python run.py mephisto.architect.hostname="**static IP**"

But, unfortunately, I still get 'disconnected' status bar with the parlai_chat_task_demo app.

By the way, what is the corresponding python version for setting the suggested property? I'm referring to the defaults variable in the run.py script (in the parlai_chat_task_demo, the script is called parlai_test_script.py).

I've tried the following ones with no success:

defaults = [ {"mephisto/blueprint": BLUEPRINT_TYPE}, {"mephisto/architect: "local"}, {"mephisto/provider": "mock"}, {"mephisto/hostname": "**static IP**"}, {"conf": "my_conf"} ]

and

defaults = [ {"mephisto/blueprint": BLUEPRINT_TYPE}, {"mephisto/architect: "local"}, {"mephisto/provider": "mock"}, {"mephisto/architect/hostname": "**static IP**"}, {"conf": "my_conf"} ]

Thanks in advance for your courtesy!


Anyway, I've managed to run the custom web app with heroku. I've initially wrongly assumed that I needed to do something more, but the url I was using turned out to be wrong. Stupidly, I was just clicking on the heroku web app base url, while I should have added /?worker_id=X&assignment_id=Y as well.

@JackUrb
Copy link
Contributor

JackUrb commented Mar 22, 2021

I still get 'disconnected' status bar with the parlai_chat_task_demo app.

That's somewhat surprising - anything appear in your javascript console logs, or in the terminal logs, when you try to do this?

what is the corresponding python version for setting the suggested property?

At the moment we're suggesting using .yaml files for this, at least until Hydra 1.1 comes out. Ideally we'd like to do away with using a python defaults list where possible, as it adds to the boilerplate of run files. If you'd like to learn more about how to do it anyways though you can visit the Hydra guides - I expect it would be ... {"mephisto.architect.hostname": "<IP>"} ... . Hydra uses / notation for setting configuration types, and . notation for values.

Stupidly, I was just clicking on the heroku web app base url, while I should have added /?worker_id=X&assignment_id=Y as well.

This is really something we should document, it's one of the most common mistakes new users run into when trying out local development at this point.

@federicoruggeri
Copy link
Author

Here's the javascript console output (it keeps repeating this output in the console):

Screenshot 2021-03-23 101905

Looking at the terminal output (script output), it doesn't detect any connection: no particular output is produced when connecting to the link.


I'm working directly with the repo version (downloaded 6th March 2021). Is it possible that I'm missing some recent update?

@JackUrb
Copy link
Contributor

JackUrb commented Mar 23, 2021

Ah okay I think I see the issue, the server may not be configured to handle wss over another IP, and our JS check for if the socket should be served securely is simply a check for localhost. We should be inheriting the security of the regular url.

@JackUrb
Copy link
Contributor

JackUrb commented Mar 2, 2022

This should be resolved by #655, and will be included in the 1.0 release!

@JackUrb JackUrb closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architect-api bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants