Skip to content

Commit

Permalink
clean up docs in preparation for refactor of style
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Sep 25, 2021
1 parent 86327f8 commit 6ad1c4a
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 55 deletions.
16 changes: 8 additions & 8 deletions 0-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ docker run -p 80:80 vanessa/expfactory-surveys start
docker run -p 80:80 vanessa/expfactory-experiments start
```

If you want a more gentle introduction, start with reading some [background](pages/0-background.md) on containers and why the Experiment Factory exists in the first place. Then move on to our quick start to [generate](https://expfactory.github.io/generate#quick-start) your own experiment container. Please [give feedback](https://www.github.com/expfactory/expfactory/issues) about your needs to further develop the software. The [library](https://expfactory.github.io/experiments/) will show you a selection to choose from, including all experiments, surveys, and games migrated from [the legacy Expfactory](https://www.github.com/expfactory/expfactory-experiments). If you have web-based experiments to contribute, please [reach out](https://www.github.com/expfactory/expfactory/issues)! Your contributions and feedback are greatly appreciated!
If you want a more gentle introduction, start with reading some [background](pages/0-background.md) on containers and why the Experiment Factory exists in the first place. Then move on to our quick start to [generate](https://expfactory.github.io/generate#quick-start) your own experiment container. Please [give feedback](https://github.com/expfactory/expfactory/issues) about your needs to further develop the software. The [library](https://expfactory.github.io/experiments/) will show you a selection to choose from, including all experiments, surveys, and games migrated from [the legacy Expfactory](https://github.com/expfactory/expfactory-experiments). If you have web-based experiments to contribute, please [reach out](https://github.com/expfactory/expfactory/issues)! Your contributions and feedback are greatly appreciated!

## User Guide

Expand All @@ -37,7 +37,7 @@ If you want a more gentle introduction, start with reading some [background](pag

## Developer Guide

- [Contribute](pages/5-contribute.md) an experiment to the [library](https://www.github.com/expfactory/experiments) for others to use.
- [Contribute](pages/5-contribute.md) an experiment to the [library](https://github.com/expfactory/experiments) for others to use.
- [Interactive Development](pages/6-develop.md) suggested practice to develop and debug an experiment interactively in the container

## Library
Expand Down Expand Up @@ -72,13 +72,13 @@ You'll notice a little eliipsis (<i class="fa fa-ellipsis-h"></i>) next to each

We are here for you! You can ask a question directly or open an issue for:

- [Experiment Factory Core](https://www.github.com/expfactory/expfactory/issues)
- [Experiment Library](https://www.github.com/expfactory/experiments/issues)
- [Survey Generator](https://www.github.com/expfactory/survey-generator/issues)
- [Expfactory Builder](https://www.github.com/expfactory/expfactory-builder/issues)
- [Expfactory Robots](https://www.github.com/expfactory/expfactory-robots/issues)
- [Experiment Factory Core](https://github.com/expfactory/expfactory/issues)
- [Experiment Library](https://github.com/expfactory/experiments/issues)
- [Survey Generator](https://github.com/expfactory/survey-generator/issues)
- [Expfactory Builder](https://github.com/expfactory/expfactory-builder/issues)
- [Expfactory Robots](https://github.com/expfactory/expfactory-robots/issues)

If your issue is for a particular experiment, open the issue at the respective repository for the [expfactory-experiments](https://www.github.com/expfactory-experiments) organization.
If your issue is for a particular experiment, open the issue at the respective repository for the [expfactory-experiments](https://github.com/expfactory-experiments) organization.

<div>
<a href="/generate"><button class="next-button btn btn-primary"><i class="fa fa-chevron-right"></i> </button></a>
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: The Experiment Factory
tagline: ""
baseurl: "/"
repo: "https://www.github.com/expfactory/expfactory.github.io"
repo: "https://github.com/expfactory/expfactory.github.io"

# About/contact
author:
Expand Down
2 changes: 1 addition & 1 deletion _includes/page-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<span style="float:right">
<a href="{{ site.repo }}" target="_blank"><i style="margin-right:5px" class="fa fa-github fa-2x"></i></a>
<a href="/pdf" target="_blank"><i style="margin-right:5px" class="fa fa-save fa-2x"></i></a>
<a href="https://www.github.com/expfactory-experiments">Experiments</a>
<a href="https://github.com/expfactory-experiments">Experiments</a>
</span>
</footer>
4 changes: 2 additions & 2 deletions pages/0-background.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ This general workflow using the experiment factory builder means that you could
- go back and use the same version of the builder to re-create your experiment container, or a slight derivation of it
- (developers) contribute to the core expfactory Python software to enhance the builder, or [another integration or tool](/integrations).

If you have not heard of Docker we recommend that you [read about it first](https://www.docker.com/what-container) and go through a [getting started](https://docs.docker.com/get-started/) tutorial. When you are ready, come back here and try out the quick start. If you have any questions, [please don't hesitate to ask](https://www.github.com/expfactory/expfactory/issues).
If you have not heard of Docker we recommend that you [read about it first](https://www.docker.com/what-container) and go through a [getting started](https://docs.docker.com/get-started/) tutorial. When you are ready, come back here and try out the quick start. If you have any questions, [please don't hesitate to ask](https://github.com/expfactory/expfactory/issues).

Do you have more questions? Please [post an issue](https://www.github.com/expfactory/expfactory/issues).
Do you have more questions? Please [post an issue](https://github.com/expfactory/expfactory/issues).

<div>
<a href="/"><button class="previous-button btn btn-primary"><i class="fa fa-chevron-left"></i> </button></a>
Expand Down
58 changes: 32 additions & 26 deletions pages/1-generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ What experiments do you want in your container? Let's see the ones that are avai
docker run quay.io/vanessa/expfactory-builder list
```

Cool, I like `digit-span`, `spatial-span`, `test-task`, and `tower-of-london`.
Cool, I like `digit-span`, `spatial-span`, `test-task`, and `tower-of-london`. Notice here
that we are running as our user so the resulting files don't have permissions issues.

```
docker run -v $PWD:/data quay.io/vanessa/expfactory-builder build digit-span spatial-span tower-of-london test-task
docker run -v $PWD:/data --user "$(id -u):$(id -g)" \
quay.io/vanessa/expfactory-builder build \
digit-span spatial-span tower-of-london test-task
```

Let's build the container from the Dockerfile! We are going to name it `expfactory/experiments`
Expand All @@ -58,6 +61,7 @@ Open your browser to localhost ([http://127.0.0.1](http://127.0.0.1)) to see the


# Detailed Start

The generation of a container comes down to adding the experiments to a text file that records all the commands to generate your container. Since we are using Docker, this file will be the Dockerfile, and you should [install Docker](https://docs.docker.com/engine/installation/) first and be comfortable with the basic usage. In these sections, we will be building your container from a customized file. You will be doing the following:

- generating a recipe with (reproducible) steps to build a custom container
Expand All @@ -67,6 +71,7 @@ Note that if you want to deploy a container with https, you should read our [htt


## The Expfactory Builder Image

Both of these steps start with the expfactory builder container.
We've [provided an image](https://quay.io/repository/vanessa/expfactory-builder?tab=tags) that will generate a Dockerfile, and from it you can build your Docker image.
Note that bases for expfactory were initially provided on [Docker Hub](https://hub.docker.com/r/vanessa/expfactory-builder/tags) and have moved to [Quay.io](https://quay.io/repository/vanessa/expfactory-builder?tab=tags). 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. We don't build the image within the same
Expand Down Expand Up @@ -98,26 +103,27 @@ docker run quay.io/vanessa/expfactory-builder list
Expfactory Version: 3.0
Experiments
1 adaptive-n-back https://www.github.com/expfactory-experiments/adaptive-n-back
2 breath-counting-task https://www.github.com/expfactory-experiments/breath-counting-task
3 dospert-eb-survey https://www.github.com/expfactory-experiments/dospert-eb-survey
4 dospert-rp-survey https://www.github.com/expfactory-experiments/dospert-rp-survey
5 dospert-rt-survey https://www.github.com/expfactory-experiments/dospert-rt-survey
6 test-task https://www.github.com/expfactory-experiments/test-task
7 tower-of-london https://www.github.com/expfactory-experiments/tower-of-london
1 adaptive-n-back https://github.com/expfactory-experiments/adaptive-n-back
2 breath-counting-task https://github.com/expfactory-experiments/breath-counting-task
3 dospert-eb-survey https://github.com/expfactory-experiments/dospert-eb-survey
4 dospert-rp-survey https://github.com/expfactory-experiments/dospert-rp-survey
5 dospert-rt-survey https://github.com/expfactory-experiments/dospert-rt-survey
6 test-task https://github.com/expfactory-experiments/test-task
7 tower-of-london https://github.com/expfactory-experiments/tower-of-london
```

Try using grep if you want to search for a term in the name or url

```
docker run quay.io/vanessa/expfactory-builder list | grep survey
2 alcohol-drugs-survey https://www.github.com/expfactory-experiments/alcohol-drugs-survey
4 dospert-eb-survey https://www.github.com/expfactory-experiments/dospert-eb-survey
5 dospert-rp-survey https://www.github.com/expfactory-experiments/dospert-rp-survey
6 dospert-rt-survey https://www.github.com/expfactory-experiments/dospert-rt-survey
2 alcohol-drugs-survey https://github.com/expfactory-experiments/alcohol-drugs-survey
4 dospert-eb-survey https://github.com/expfactory-experiments/dospert-eb-survey
5 dospert-rp-survey https://github.com/expfactory-experiments/dospert-rp-survey
6 dospert-rt-survey https://github.com/expfactory-experiments/dospert-rt-survey
```

## Local Experiment Selection

If you have experiments on your local machine where an experiment is defined based on [these criteria](/contribute#experiment-pre-reqs) or more briefly:

- the config.json has all required fields
Expand Down Expand Up @@ -190,7 +196,7 @@ This is really great! Now we can add the `Dockerfile` and `startscript.sh` to ou
LABEL EXPERIMENT_test-task /scif/apps/test-task
WORKDIR /scif/apps
RUN expfactory install https://www.github.com/expfactory-experiments/test-task
RUN expfactory install https://github.com/expfactory-experiments/test-task
LABEL EXPERIMENT_test-task-two /scif/apps/test-task-two
ADD test-task-two /scif/apps/test-task-two
Expand Down Expand Up @@ -487,22 +493,22 @@ url again? Let's ask...
expfactory list
Expfactory Version: 3.0
Experiments
1 adaptive-n-back https://www.github.com/expfactory-experiments/adaptive-n-back
2 alcohol-drugs-survey https://www.github.com/expfactory-experiments/alcohol-drugs-survey
3 breath-counting-task https://www.github.com/expfactory-experiments/breath-counting-task
4 digit-span https://www.github.com/expfactory-experiments/digit-span
5 dospert-eb-survey https://www.github.com/expfactory-experiments/dospert-eb-survey
6 dospert-rp-survey https://www.github.com/expfactory-experiments/dospert-rp-survey
7 dospert-rt-survey https://www.github.com/expfactory-experiments/dospert-rt-survey
8 spatial-span https://www.github.com/expfactory-experiments/spatial-span
9 test-task https://www.github.com/expfactory-experiments/test-task
10 tower-of-london https://www.github.com/expfactory-experiments/tower-of-london
1 adaptive-n-back https://github.com/expfactory-experiments/adaptive-n-back
2 alcohol-drugs-survey https://github.com/expfactory-experiments/alcohol-drugs-survey
3 breath-counting-task https://github.com/expfactory-experiments/breath-counting-task
4 digit-span https://github.com/expfactory-experiments/digit-span
5 dospert-eb-survey https://github.com/expfactory-experiments/dospert-eb-survey
6 dospert-rp-survey https://github.com/expfactory-experiments/dospert-rp-survey
7 dospert-rt-survey https://github.com/expfactory-experiments/dospert-rt-survey
8 spatial-span https://github.com/expfactory-experiments/spatial-span
9 test-task https://github.com/expfactory-experiments/test-task
10 tower-of-london https://github.com/expfactory-experiments/tower-of-london
```

Ah yes, let's install test-task:

```
$ expfactory install https://www.github.com/expfactory-experiments/test-task
$ expfactory install https://github.com/expfactory-experiments/test-task
Expfactory Version: 3.0
Cloning into '/tmp/tmp5xn6oc4v/test-task'...
remote: Counting objects: 62, done.
Expand All @@ -528,7 +534,7 @@ You then should have the new experiment installed in the container! Remember, yo
docker run -v $PWD:/data quay.io/vanessa/expfactory-builder build digit-span test-task
```

If you have any questions about the above, or want more detail, please [get in touch](https://www.github.com/expfactory/issues) as I am looking to develop this.
If you have any questions about the above, or want more detail, please [get in touch](https://github.com/expfactory/issues) as I am looking to develop this.


Now that you are comfortable generating your container, check out how to [customize it](/customize).
Expand Down
2 changes: 1 addition & 1 deletion pages/2-customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The next set are relevant for installation.
Note that bases for expfactory were initially provided on [Docker Hub](https://hub.docker.com/r/vanessa/expfactory-builder/tags) and have moved to [Quay.io](https://quay.io/repository/vanessa/expfactory-builder?tab=tags). 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.

## Expfactory wants Your Feedback!
The customization process is very important, because it will mean allowing you to select variable stimuli, lengths, or anything to make a likely general experiment specific to your use case. To help with this, please [let us know](https://www.github.com/expfactory/expfactory/issues) your thoughts.
The customization process is very important, because it will mean allowing you to select variable stimuli, lengths, or anything to make a likely general experiment specific to your use case. To help with this, please [let us know](https://github.com/expfactory/expfactory/issues) your thoughts.

<div>
<a href="/generate"><button class="previous-button btn btn-primary"><i class="fa fa-chevron-left"></i> </button></a>
Expand Down
18 changes: 13 additions & 5 deletions pages/3-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ and export the environment variable in the container to the file. Make sure to o

For a complete tutorial of the above, see the [test-parse-url repository](https://github.com/expfactory-experiments/test-parse-url/tree/master/docker).



## Start a Headless Experiment Container

"Headless" refers to the idea that you going to be running your experiment with remote participants, and you will need to send them to a different portal that has them login first. In order to do this, you need to start the container with the `--headless` flag, and then issue a command to pre-generate these users.

First we can start the container (notice that we are giving it a name to easily reference it by) with `--headless` mode.
Expand All @@ -189,10 +188,10 @@ docker run -p 80:80 -d --name experiments -v /tmp/data:/scif/data <container> \
--experiments test-task,tower-of-london start
```

If you ask for non random order without giving a list, you will present the experiments in the order listed on the filesystem. See [pre-set-experiments](#pre-set-experiments) for more information.

If you ask for non random order without giving a list, you will present the experiments in the order listed on the filesystem. See [pre-set-experiments](#pre-set-experiments) for more information.

### Generate tokens

A "token" is basically a subject id that is intended to be used once, and can be sent securely to your participants to access the experiments. The token can be refreshed, revoked, or active. You will need to generate them, and briefly it looks like this:


Expand All @@ -219,9 +218,18 @@ And of course it follows that if you enter a bad token, you cannot enter.
</div>

Once entry is given, the user can continue normally to complete the experiments in the protocol.
If you want to provide the pre-generated URL to your participants to skip the login, you can have them navigate to this url

```
https://<your-server>/login?token=<token>
https://<your-server>/login?token=a34d4512-1841-4219-873d-2b9d1727a37a
```

**Important** since this is sending data with a GET request, this is not recommended to do without https.


### Headless Finish

When the user finishes the protocol, the user will have the token revoked so an additional attempt to do the experiments will not work. You would need to generate a new session with token (the `--new` command above) or restart the participant to rewrite the previously generated data.


Expand Down Expand Up @@ -851,7 +859,7 @@ A few questions for you!

- Would password protection of the portal be desired?

To best develop the software for different deployment, it's important to discuss these issues. Please [post an issue](https://www.github.com/expfactory/expfactory/issues) to give feedback.
To best develop the software for different deployment, it's important to discuss these issues. Please [post an issue](https://github.com/expfactory/expfactory/issues) to give feedback.


<br>
Expand Down

0 comments on commit 6ad1c4a

Please sign in to comment.