I'm a little confused about the separability of the dashboard and server -- I know that running `psiturk` launches the dashboard, and then from the dashboard you can launch the experiment server. I've been setting up my experiment and testing it using the dashboard/server locally, but now that I'm actually ready to deploy it, I'm not exactly sure what the correct way to set it up is.
The server that I would like to run it on is remote, and has no GUI interface. When I run `psiturk`, it launches the dashboard server as I would expect, but also launches Links (a terminal browser, which is the only browser actually installed), which isn't terribly usable. If I run `psiturk -i <server> -p <port>`, then I can access the dashboard over the internet, but then it's publicly accessible and I don't really like the idea of running it unsecured like that.
I thought maybe I would be able to run just the experiment server, but when I try to do so with `psiturk-server`, it can't find the `experiment` app:
```
Traceback (most recent call last):
File "/home/cocosci/jhamrick_python/lib/python2.6/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/home/cocosci/jhamrick_python/lib/python2.6/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/home/cocosci/jhamrick_python/lib/python2.6/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/home/cocosci/psiturk/psiturk/experiment_server.py", line 42, in load
return util.import_app("experiment:app")
File "/home/cocosci/jhamrick_python/lib/python2.6/site-packages/gunicorn/util.py", line 354, in import_app
__import__(module)
ImportError: No module named experiment
```
I think maybe I'm confused about the way I'm supposed to be using PsiTurk. Is the idea that you should be able to have X-server access to the server that you're running it on, so you can view the dashboard locally/privately and still run the experiment server publicly? What do you think the best option is for me, if I want to run it on a server that has no GUI interface, but still have access to the dashboard? Perhaps it would be possible to add an option to secure the dashboard interface?
Thanks!
Jess
Ok, cool, for now I'll just block the port, then.
It looks like there's some code to support auth in `experiment.py` -- I imagine it wouldn't be too hard to use that as a template for the dashboard, too. If I have time, I may poke at it a bit!
Cheers,
Jess
Coming back to this issue a little bit, I was wondering if you all would be interested in me working on a more substantial contribution regarding the interface between dashboard and experiment, especially when the experiment is on a different machine and/or is using a different server. For example, the default use case (the way PsiTurk is set up currently) is to have the dashboard and experiment run on the same machine, ideally locally. Another use case (which is how I'm currently doing it) is to run the dashboard on the same machine that my experiment is running on, but I'm not running the gunicorn experiment server (I have my server set up to run the flask app itself).
I think it would be cool to think a bit more about what different use cases there are/might be and adjust the interface accordingly to make it really easy to set up regardless of what people are trying to do. For example, if the server is something other than the gunicorn server, the "launch server" button should be disabled, but you should still be able to launch test runs.
I am taking a class on scientific Python this term, and the final project is to either contribute to an open source project or do something that would be useful for your research. A project like this would actually fulfill both of those requirements for me, and I'd really like to contribute more regardless, too.
Anyway, let me know what you think!
Cheers,
Jess
How is the CLI currently being built? Is it something like:
experiment app --> API of some sort --> CLI
If so, then you could easily have as many front ends as you would like, e.g.
experiment app --> API of some sort --> (1) dashboard
--> (2) CLI
--> (3) etc.
Or were you all thinking of it in a different way?
Cheers,
Jess
Also, Todd sent me an example of a session using the CLI, but I guess it didn't go through to the google group -- it looks very cool!
I think though what I'm thinking of with respect to the dashboard (or CLI)/experiment server might still apply. Currently my understanding of how it works is:
1. If you want to interface with the experiment server, you have to use the gunicorn server and talk to it through the controller defined in `experiment_server_controller.py`.
2. You can still otherwise use the dashboard/CLI, but you can't do anything with relation to the experiment server.
What I'm thinking of would be something like this:
1. Define a new route in `experiment.py` (e.g. `/status`) that allows someone to ping the server for its status via that route, rather than doing the port check with the controller.
2. Have the API keep track of whether it started the server, or whether the server was already running. If the server was already running, then disable the option to shut it down. Otherwise, you'll still have the experiment controller and can restart/shutdown/etc.
3. Potentially do something like check to see if the experiment server address is local or not. If it's not, then disable the launch option, because then that would require something like SSHing into the remote server to start it, which might be too complicated at least for the moment.
In other words, I think it would be easier to setup/understand if the experiment server was decoupled from the dashboard. The dashboard/CLI should offer the ability to interface with *any* experiment server you might define (as long as it has routes that will let you check the status and stuff), and then also offer the option of launching it's own experiment server (if you don't want to set up your own) -- but it shouldn't necessarily be limited to that.
Similarly, maybe routes like `/data` in the dashboard server should be moved (with authentication enabled) to the experiment server. Technically, the dashboard shouldn't really need to worry about how the data is saved into the database -- the experiment server knows, and so the experiment server should also be the one to extract it. There could still be a command to download the data from the dashboard, but in the background it could query the experiment server instead.
Would something like that sound reasonable? Definitely let me know if this is not at all how you're thinking of structuring things -- I don't want to jump in and mess up the flow you all already have!
--
You received this message because you are subscribed to a topic in the Google Groups "PsiTurk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psiturk/8KbjZ5f4_44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psiturk+u...@googlegroups.com.
To post to this group, send email to psi...@googlegroups.com.
Visit this group at http://groups.google.com/group/psiturk.
For more options, visit https://groups.google.com/groups/opt_out.
`from psiturk.experiment import app as application`
You received this message because you are subscribed to the Google Groups "PsiTurk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psiturk+u...@googlegroups.com.