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

having trouble running Spatial Span on a local machine #524

Open
lsuemily opened this issue Oct 25, 2017 · 15 comments
Open

having trouble running Spatial Span on a local machine #524

lsuemily opened this issue Oct 25, 2017 · 15 comments

Comments

@lsuemily
Copy link

Hi,

I'm working with the Spatial Span experiment file, and I downloaded it from the github repository. I tried setting it up so that jsPsych5.0.3 would run the script locally on my machine, but I'm having some trouble getting it to work.

My questions may be very basic, but I think I may be missing a critical detail. Should a user be able to directly download an experiment, such as Spatial Span, and run it on their own local machine, or do I need to make modifications to the file to make it run locally? I've looked at the documentation, and tried to install the "pip" using Python, but was unsuccessful there as well.

Thanks for any guidance you can offer!
Best wishes,
Emily

@IanEisenberg
Copy link
Member

Hi Emily,

Can you run me through the steps you've taken? If you aren't using "pip", what are you trying to run? You will need to get expfactory working. It is only available for python 2.x (I believe >2.7), so you'll need to make sure you have that.

Once you have expfactory installed, the easiest way to run an experiment locally is to run it using "expfactory --run". Instructions below:

Clone this repo (expfactory-experiments). Then you run the following command:
expfactory --run --experiments spatial_span --folder [location of expfactory-experiments]

This will run the experiment contained in [location of expfactory-experiments]/spatial_span locally. When it finishes it will download a csv file. If you want the subject ID to be a part of the data you can run:
expfactory --run --experiments spatial_span --folder [location of expfactory-experiments] --subid [ID]

If you wanted to modify the spatial_span task for some reason, all you would have to do is edit the spatial_span folder in expfactory-experiments. You could even create a new one in a new folder. Let's say you had a folder called 'Emily_experiments' and an experiment in it called 'Spatial_Span_Emily'. As long as 'Spatial_Span_Emily' corresponds to jspsych syntax, has a javascript file and a config file (basically looks like spatial_span) you can run it like so:

expfactory --run --experiments Spatial_Span_Emily --folder [location of Emily_experiments] --subid [ID]

@lsuemily
Copy link
Author

lsuemily commented Nov 1, 2017

Hi Ian,

Thanks so much- this is very helpful. I do have Python on my machine. I recently downloaded the latest version, so it is Python 3.6. I’ll try to follow the steps you described below and I will get back in touch if I have any questions.

Thanks again! I really appreciate your help!

Emily

@vsoch
Copy link
Member

vsoch commented Nov 7, 2017

hey @lsuemily! I have the early (alpha?) version of a newly developed reproducible Experiments Container that I think will help with some of these issues, and importantly, will provide a truly reproducible (immutable) battery. I've written up some documentation for you to get started:

https://expfactory.github.io/expfactory/

My plan is to get feedback from a handful of users, do a bit more work, and then port the rest of the library (experiment, games, surveys) over to the new version. You can give feedback at the new repository. For example, I'm guessing you are running Windows? I will need to make you a Docker image to run the Singularity image. Yes, a container in a container :)

@lsuemily
Copy link
Author

lsuemily commented Nov 7, 2017

This is fantastic and I'm really excited to take a look! I've been doing the tutorials in jsPsych and Git, because I was a complete beginner in both of those. Now I have a basic understanding of what it means to clone a repository :)

Also, you are right, I am running Windows.

Thanks!

@vsoch
Copy link
Member

vsoch commented Nov 12, 2017

okay, this was a lot of work (and likely there are some bugs we need to catch) but I have a start for a walkthrough using Docker + Experiment Factory.

Here is the experiment factory quickstart. It's hugely simplified, and has a lot more functionality for development than the previous. You should hopefully be able to just run the example container to try it out, and then follow the instructions for generating one on your own.

This is all very beta, so please report any and all issues. For example, the experiments (that I've generated) are both saving and saving a file to the local machine, and likely I'm just doing the post incorrectly. For now I need a break from working on this, but my next todo will be to fix the bug mentioned above, and any issues that you run into. I'm worried about helping to debug Windows (I've never used Docker on Windows) but I'll do my best!

@lsuemily
Copy link
Author

hi! I downloaded docker toolbox because I have Windows 10 and Windows 7 on different machines, due to compatibility issues we were having with Eprime and Windows 10. I'm working on it now! I hope it's ok that i used docker toolbox instead of the link that you send- i couldn't get that one to work and I think it's because of the Windows version.
Thanks!

@lsuemily
Copy link
Author

I'm making progress! I think I need to have a better understanding of the folder structures in Windows first. I'm thinking I need to create some basic level folders in the C drive to make this work but I'll do some more research on Docker (I learn a lot from watching YouTube videos on stuff like this so I'll see what I can find on using Docker on Windows). Here's a screen shot of my latest Docker session, if that helps.
docker screen shot.

You are the best! I'll be back in touch after I try a few more things.

@vsoch
Copy link
Member

vsoch commented Nov 13, 2017

haha, okay so the line "cd to recipe" doesn't mean to do cd recipe, it means to cd to where the recipe was generated on your local machine. But that isn't actually the first error! So I think you would first confirm that there is a Dockerfile in /tmp/my-experiment:

$ ls
Dockerfile

Actually I think this is the issue:

moby/moby#14339 (comment)

So it sounds like it might be related to some verison of docker engine, and you could try any of the following:

  • making sure the Dockerfile is in the present working directory, named exactly Dockerfile
  • generating it where there aren't symbolic links
  • specifying the direct path to it with -f

@vsoch
Copy link
Member

vsoch commented Nov 20, 2017

hey @lsuemily ! Did you get Docker up and running? If you want to give the spatial span task a go, it's provided in one of the example containers, along with all the other experiments. You should be able to do:

docker run -p 80:80 vanessa/expfactory-experiments start

and then open your browser to 127.0.0.1. Once you get that up and running we can talk about specifics like how you want to save data, etc.

@lsuemily
Copy link
Author

Hi! So I've been doing lots of learning, and have made some really big progress. I get slowed down by silly things along the way (like learning how to name a "Dockerfile" without any extension on it because Notepad was automatically saving anything I made with .txt) and also there seems to be some differences between Docker for Windows (which is for Windows 10) and for Docker Toolkit, which runs on Windows 7. Using the http://127.0.0.1 works for Docker for Windows but I ran into some trouble translating that for the Docker Toolkit version. I did make it farther in Docker tonight than I've made it yet!
So the short answer is yes, I got Docker up and running and got it to do the step you listed above, but then I get stuck trying to open it in the browser...
Thanks for checking in with me!!

@vsoch
Copy link
Member

vsoch commented Nov 20, 2017

okay great! Unfortunately I know almost nothing about Docker for Winodws / Docker Toolkit, but I can suggest that you try a Virtual Machine (vagrant) installed with Docker for a potential workaround , a container in a container? If your institution has some kind of resource you can use (and they are able to install Docker) that's another possibility. The final possibility would be to use a tiny instance on a cloud provider - I think AWS still has some sort of free tier, and Google Cloud might too.

The .txt extension added by notepad is a good rationale to check out some development environments that you might like! I have heard on windows notepad++ is well liked, and also Sublime Text. Another good one (although a bit slower some times) that has a bunch of plugins is Github's Atom, and then (I hate to admit this because I'm not a fan of Microsoft) there is another one called VS Code. Here is a bunch of links. If you are like me, you will go nuts configuring it to be how your like :)

I am on ubuntu so I use gedit, which doesn't do anything but change text colors. But I kind of love it anyhoo :)

Happy tweaking!

@lsuemily
Copy link
Author

@vsoch I am sorry to say that I am still getting stuck. I think I'm going to take a break from this Docker strategy until I can find someone locally that can look at this with me. I don't want to take up any more of your time, and I really appreciate all that you've done to help me.

@vsoch
Copy link
Member

vsoch commented Nov 27, 2017

hey @lsuemily are you able to run a simple Docker image, like:

docker run hello-world

If so, I can easily build the container for you, and you just have to issue that command to use it. The only reason you need to think about Dockerfiles and any of the above is if you want to do it yourself. Don't give up hope! I would still definitely find someone locally, and I'm glad to do the above if it can helpful.

@lsuemily
Copy link
Author

Hi @vsoch thanks so much for being so positive! I was able to successfully get all the way through the Getting Start Guide part 2
(https://docs.docker.com/get-started/part2/) and was feeling really good about it, which included being able to set up my own Dockerfile. Then I tried going back through your instructions and I keep getting stuck. I think there is something about the $PWD and the way the directories are set up on this computer with Windows 7. I tried reading the link you sent to me about how to fix it, and I made sure to set up a new folder so that none of my previous Docker attempts would be in the way, but I was always ending up with problems. I have two colleagues here in another department that I'm hoping will be able to take a look at it with me. I'm also going to try working with Windows 10 on one of the computers in my lab, to see if that helps.

@vsoch
Copy link
Member

vsoch commented Nov 28, 2017

ah I see! I think with windows you might need to just specify the hard path ($PWD is an environment variable that I'm not sure windows supports?) And you also might need to change the slashes. For example if we look at a windows usage example for another container:

docker run \
-v D:\host\path\where\to\output\singularity\image:/output \
singularityware/docker2singularity \
ubuntu:14.04

notice how the windows path is an absolute path (we don't use $PWD) and it's for the D drive and the slashes are the opposite way (on linux they are like /). So maybe if you try something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants