-
Notifications
You must be signed in to change notification settings - Fork 141
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
Feature request: Docker container image #162
Comments
👍 to this! I'm happy to take this on, though I probably won't have time until February or so. |
I think this should serve as a good inspiration: https://github.com/jupyter/jupyterhub/blob/master/Dockerfile Copies the user-file and starts the server when the container is started. |
Yeah, something like that is where I was thinking of starting from (I've been working with some of the jupyterhub docker stuff recently for a class I'm running this spring). |
👍, i'm all for this. |
Here's a humble beginning:
Should change this to not run as root but it seems to work. To build: |
I think psiturk could easily just use the installation and then users could easily inherit from an image on dockerhub. |
Yeah, I spent a bit of time thinking about the way to do this and there are sort of two options:
|
Good ideas! I feel a bit that number 1 goes against the philosophy of |
Hi all, I'm about to begin rolling out some experiments using Docker & Psiturk. I think I've done (1) that @jhamrick suggested and that @twiecki advised possibly not doing. I found the solution below pretty easy, but would you recommend a better way? 3 things below:
and then the bash script (e.g.
and then run with All the best, |
Though, I am currently doing it this way (with command line option I have been thinking about spawning a mysql container and linking them so that each running experiment can use that instead. But that seems a bit more complicated and not worth the effort at the moment. |
This is my attempt to use docker-combine to start a psiturk container + mysql and link them. So far I only tested on my server, and with the psiturk-example, and it seems to work. Thanks to @twiecki and @braingineer for the inspiration from their Dockerfile. Here's the repo https://github.com/mvdoc/psiturk-docker My solution as well was to map a local directory to a volume within the container (as @braingineer ) Works well in my opinion. One of the major drawbacks is that I didn't find a way to set the permissions correctly if using another user within the container (using root makes me paranoid). I welcome suggestions :) |
I've started a repository for psiTurk Docerk images (GitHub; DockerHub). The Dockerfile is (at the time of writing this comment):
The idea is that people build on top of this Docker file in their own projects. This approach allows for either of the two options proposed by @jhamrick above. Mount volume If you want to mount a volume, you just have to create a Dockerfile with the following content:
Then just do the following (assuming your experiment is in a subdirectory called docker build -t <YOUR_USERNAME>/<YOUR_EXPERIMENT> .
docker run -it --rm --name <YOUR_EXPERIMENT> -p 22362:22362 -v `pwd`/experiment:/psiturk <YOUR_USERNAME>/<YOUR_EXPERIMENT> Put experiment files in image On the other hand, if you want the experiment files to actually be part of the image, you can create a Dockerfile with the following content (
And then do the following: docker build -t <YOUR_USERNAME>/<YOUR_EXPERIMENT> .
docker run -it --rm --name <YOUR_EXPERIMENT> -p 22362:22362 <YOUR_USERNAME>/<YOUR_EXPERIMENT> The former approach, in my opinion, is much preferred for developing and tweaking an experiment. Especially if the idea is to keep the Docker image as minimal as possible, the container doesn't have any text editors, so it's much nicer to be able to edit the files on the host computer and not have to rebuild the image each time you make an edit. However, the latter approach is probably better for deployment and/or distributing an experiment (perhaps it could even improve on/replace the current psiTurk experiment exchange (haven't looked at it that closely, to be honest ... )). I'm curious if folks have any feedback/suggestions. I'm relatively new to Docker, so there are probably ways to improve this setup. After incorporating any feedback I get, I was probably planning on adding images with at least some of the older versions of psiturk. Currently the only tags in the DockerHub repository are Also, if this approach is appealing, I'd be happy to work with the psiturk folks to make this more 'official', by, for example, transitioning the DockerHub repo to P.S.: @mvdoc I like where you are going with the |
It'd be sweet if you all got this working on the new OpenShift v3, which uses docker. And I think nginx is a necessity. Over and over I've seen the counsel -- "DO NOT RUN GUNICORN AS A PUBLIC-FACING SERVER , use a reverse proxy in front," |
@deargle I'm not familiar with OpenShift (I've always used Linode), but I assume it would be pretty straightforward to do since this is precisely the sort of thing that Docker is designed to make easy. I've been writing some blog posts about how to do this with Linode, which I plan to make public at some point, too. So hopefully that'd be helpful to folks. And again, if anyone has any suggestions/feedback on the Docker implementation, please let me know! 😸 |
I've made psiTurk Docker images available for some older versions of psiTurk, in case anyone is interested. Everything is here on GitHub and here on Docker Hub. Feedback welcome. Feel free to build on top of these images in your own Dockerfiles. I plan to keep the (CC especially @deargle and @mvdoc) Update: As of 2018-07-28, I've also added a |
Fair warning that `us_only` and `approve_requirement` didn't work before
2.2.0 <https://github.com/NYUCCL/psiTurk/releases/tag/2.2.0>
…On Sat, Oct 14, 2017 at 9:41 PM Adam Liter ***@***.***> wrote:
I've made psiTurk Docker images available for some older versions of
psiTurk, in case anyone is interested. Everything is here on GitHub
<https://github.com/adamliter/psiTurk-docker> and here on Docker Hub
<https://hub.docker.com/r/adamliter/psiturk/>. Feedback welcome. Feel
free to build on top of these images in your own Dockerfiles. I plan to
keep the latest tag up to date with the latest version of psiTurk.
(CC especially @deargle <https://github.com/deargle> and @mvdoc
<https://github.com/mvdoc>)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABHsfa-muCdZMoxCvukD-zBS57qYgN6_ks5ssX8DgaJpZM4DPwWr>
.
|
Thanks @deargle. I've added a warning about this in the README. |
@mvdoc This looks fantastic! |
Great project. As a suggestion, I think you guys should look into Docker as a psiTurk in a box. This will make deployment totally trivial. You can also set up docker hub to rebuild the image for every push to master.
The text was updated successfully, but these errors were encountered: