Code Monkey home page Code Monkey logo

expfactory-docker's Introduction

The Experiment Factory

DOI DOI Gitter chat

expfactory/static/img/expfactoryticketyellow.png

See our documentation for getting started. If you are new to containers, read our background or paper first. If you want a more guided entry, see the detailed start

The Experiment Factory is software to create a reproducible container that you can easily customize to deploy a set of web-based experiments.

Citation

If the Experiment Factory is useful to you, please cite the paper to support the software and open source development.

Sochat, (2018). The Experiment Factory: Reproducible Experiment Containers. Journal of Open Source Software, 3(22), 521, https://doi.org/10.21105/joss.00521

Contributing

We have many ways to contribute, and will briefly provide resources here to get you started.

How to Contribute

If you are a developer interested in working on the Experiment Factory software you should read out contributing guidelines for details. For contributing containers and experiments, see our user documentation. If you have any questions, please don't hesitate to ask a question. You'll need to lint your code using black:

$ pip install black
$ black expfactory --exclude template.py

Code of Conduct

It's important to treat one another with respect, and maintain a fun and respectful environment for the open source community. Toward this aim, we ask that you review our code of conduct

Background

It's predecessor at Expfactory.org was never able to open up to the public, and this went against the original goal of the software. Further, the badly needed functionality to serve a local battery was poorly met with expfactory-python as time progressed and dependencies changes.

This version is agnostic to the underlying driver of the experiments, and provides reproducible, instantly deployable "container" experiments. What does that mean?

  • You obtain (or build) one container, a battery of experiments.
  • You (optionally) customize it
    • custom variables (e.g., a study identifier) and configurations go into the build recipe
    • you can choose to use your own database (default output is flat files)
    • other options are available at runtime
  • The container can be easily shared.
  • You run the container, optionally specifying a subset and ordering, and collect your results

If you build on Docker Hub anyone else can then pull and use your exact container to collect their own results. It is exact down to the file hash. Note that bases for expfactory were initially provided on Docker Hub and have moved to Quay.io. Dockerfiles in the repository that use the expfactory-builder are also updated. If you need a previous version, please see the tags on the original Docker Hub.

Experiment Library

The experiments themselves are now maintained under expfactory-experiments, official submissions to be found by expfactory can be added to the library (under development) to be tested that they meet minimum requirements.

expfactory-docker's People

Contributors

rwblair avatar vsoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

expfactory-docker's Issues

Data Explorer

What we provide via the data explorer is likely going to coincide with what is provided with the API - and the data explorer needs more work before it is production ready. @poldrack and @rwblair let' discuss this at the same time as #31.

Certificates

We will need to do this when there is a domain. I'm not sure how to set this up for a new user that is doing the deployment, other than to provide instruction.

letsencrypt.com
https://gethttpsforfree.com

"Add experiment" functionality

Add experiment is currently too cumbersome. Either:
(1) allow you to add multiple experiments at once by checkboxes (later going back to edit expvariables)
or
(2) stay on the same "add_experiment page" after you add them.

Docker Container with SSL

It seems to me that the Docker container (nginx) will need to be customized to connect to / know about / set up /serve the SSL Certificate. Will need to figure this out soon.

Issues creating HIT

When I create a HIT, though only one entry shows up in expfactory.org, two HITs are created on Mturk.

If I press "Expire HIT", it expires one of those two HITs but not the other. If I press "Delete HIT" it only expires the HIT, doesn't delete.

When I look at the HIT, no ad is shown. I can't start the HIT. I've included the following in the "Ad" box:

Thank you for your interest in our experiment!

This is a large experiment with many different tasks for you to do. The HIT should last around 10 hours and will pay $60 plus performance bonuses linked with some of the tasks.

P

Most of these tasks require that you press keys and sometimes we'll ask you to respond quickly. It is very important that you follow all the instructions and don’t mindlessly press the keys to finish the HIT more quickly! Not only will this hurt our research, but all of the tasks are designed to take around the same amount of time no matter how quickly you respond. The tasks will be more interesting to you and useful for us if you follow the instructions and try your best on all of the tasks.

If you accept the HIT you will see a start button. After you press start you will be shown a waiver of consent to read over followed by a more detailed description of this HIT.

errors with making hits

I received a number of errors when creating hits. First, when submitting a "New HIT" I get this error:

new hit error

Regardless of the error, a HIT seemed to be created. However, I got errors when I tried to expire or delete the HIT:

Expire:
expire_hit

Delete:
delete_hit

Integrate data frame export functions into expfactory-python

we will want a set of standard analysis functions to work with data exports (either from a local battery, json, or from the docker instance, meaning tabular) and so the functions to generate the tabular data should be the basis for the analysis, and the functions to generate these tabular formats from the json data provided via expfactory-python (and not as a function in expfactory-docker).

Support for other JavaScript Experiment Types

The modular presentation of experiments will allow for (in the future) easy integration of other Javascript frameworks. I am creating this issue to remind us to implement this as an enhancement in the future.

Edit battery button broken

This button currently doesn't work. I assume it should allow me to edit the battery variables, including the consent/information/ad text. If it doesn't, add that functionality.

bonus experiment variable

Should be able to pay out "in proportion to" a value. So now just "if greater than", but the numeric value multiplied by some amount.

Password protect participant links

Right now, anyone could go to a participant link to take a battery. We should implement some kind of protection against this, such as a password specified by the battery owner to get access to take a specific battery. @rwblair

API Development

Once we have a user agreement in place, we should discuss specific structure of the API. My thoughts are that we can offer summarized versions of data that are open for all to see. It might be overkill to try and do some kind of API authentication to programatically serve private (not yet public) data. @poldrack and @rwblair we will want to meet to discuss this.

figure out bonus/rejection stuffs

Workflow should be like:

  • person finishes battery
  • assignment is submit to aws
  • task is sent to celery to calculate credit

In celery task:

  • look up credit conditions for bonus and rejection
  • calculate bonus / determine rejection
  • update assignment object
  • if rejection criteria --> send to flagged list for user
  • else: --> send updated object to AWS

In the case that the assignment is not approved from us, it is automatically approved after the time specified by the experimenter. This means that rendering of the assignments for review table should first obtain them from AWS to determine if they have still not been approved.

RDS Database Migrations

@rwblair there is currently a bug when I use AWS RDS that migrations aren't working. If you might have some time next week to take a look together, this would be very helpful!

JsPsych init not functioning correctly

jspsych display-stage, fullscreen, and presumably other init variables specified in the config file are not actualized.

It seems that the .click function for #start_experiment_button does not generate a jspsych.init that incorporates config variables. Here is the output:

$("#start_experiment_button").click(function(){
$("#instructions_modal").hide();
$("#bootstrap_css").remove()
jsPsych.init({
timeline: stroop_experiment,
on_data_update: function(data){
console.log(data);
expfactory.recordTrialData(data);
expfactory.djstatus = "UPDATE";
$.ajax({ type: "POST",
contentType: "application/json",
url : "/local/15/",
data : JSON.stringify(expfactory),
dataType: "json",
success: function(data){
console.log(data);
console.log("data update called")
}
});

Compare to the correct output from the same experiment run on expfactory.github.io:
jsPsych.init({
timeline: stroop_experiment,
display_element: "getDisplayElement",
fullscreen: true,
on_trial_finish: function(data){
addID()
},
on_finish: function(data){
jsPsych.data.localSave('stroop_results.csv', 'csv');
expfactory_finished = true;
}
});

Need to implement backup of data

must be encrypted, options could be s3, dropbox... @chrisfilo do you have suggestions for what you do for NeuroVault? Is it encrypted?

Deployment Outside of Mechanical Turk

Researchers should also be able to click a button, and manually enter a participant ID, and run the experiment on the computer (the idea being they are running on computers in their lab by way of an internet connection to expfactory.org)

The second possibly desired integration is with facebook. If we could get this done for the initial go, this would be huge.

Add Experiment failure

Three tasks currently are failing to install:
tower of london
psychological_refractory_period_two_choices
psychological_refractory_period_gonogo_choice

update experiment admin button

we need an admin button / view that will update files (and database options) for a given experiment. This is a significant decision as it will change all instances of the experiment, so it should be done with caution.

add data API

it should be possible to get (de-identified) results by way of an API, instead of needing to download stuffs.

Pilot Preparation

Now that we have fix #4 and have certificates for https, the server must be run in production mode in order to allow https to work with Django. We have two options here:

  • deploy in production outside of Docker (faster and easier, as we are currently developing outside of it, but this means we will still need to find the correct nginx container image to somehow connect to /deploy the same certificates).
  • deploy with Docker (harder as will need to figure out the above, but then it means that the piliot is more production ready).

When we decide on the above we can 1) deploy in production 2) pilot within lab to collect results and feedback, 3) meet with Russ and Ian to decide on new model with "forms" and make changes, and 4) pilot with larger group. Bonus / reject is in place #6 but we will still need some interface to manage the hits (and pending credits, etc) along with some kind of results interface. Right now all that can be done is download of results to tsv, which isn't so bad as this is the minimum requirements for this to work.

Functionality to upload zipped experiment

A user may want to deploy a custom experiment that is not part of expfactory-experiments, so we should allow for upload of a zipped file, and then have a "private" experiment only accessible to those with permissions for it.

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.