This application provides back-end for external crowdsourcing job. A typical Amazon Mechanical Turk (AMT) task can be deployed in this server; participants answers will be stored in the dataset, and can be downloaded. You can deploy the server on a Linux Virtual Machine.
The following steps should be performed to prepare the system locally. Similarly it can be deployed on a VM.
-
Install
docker
anddocker-compose
, if they are not already installed. Follow the platform specific installation instructions (e.g. For Ubuntu docker engine, docker-compose). -
The server is published as a part of P.910 Toolkit. Clone or download the repository from Github: https://github.com/microsoft/P.910, e.g.
git clone https://github.com/microsoft/P.910 cd P.910/hitapp_server
-
Run the following commands to configure the repo:
cd configure pip install pyyaml python configure.py --config configs/online.yaml
-
Copy
.env.template
to a new file, name it.env
put it in the root directory of this project. Then change the passwords inside your.env
file:POSTGRES_PASSWORD=[Your_password] APP_DB_PASS=[Your_password]
-
Change the username/password for accessing to the front end by editing the
front-end/.htpasswd
. You can use openssl to create a new encoded password:openssl passwd -apr1 PASSWORD
Then edit the
front-end/.htpasswd
file, change "admin" with your username, and "YOUR_NEW_ENCODED_PASSWORD" with what you got from openssl command above:admin:YOUR_NEW_ENCODED_PASSWORD
-
Run the docker-compose
docker-compose up --build -d
Note, you may need to use
sudo
:sudo docker-compose up --build -d
-
Checkout the system on localhost. Use "admin" as username and "hitapp" as password to access the platform if you did not change the username and password in the previous step.
-
In case you want to stop the services use:
docker-compose down
or following command when the data-storage should be cleaned
docker-compose down --volumes
-
Create a Linux Virtual Machine (VM)
- Add a DNS name, so you have a URL for your VM
- Make sure that port 80 is open
-
Connect to the VM through SSH
-
Follow the rest of procedure given in the "Get started" section
It is recommended to use a TLS certificate to make the connection secure, as only Basic Authentication is used to access to admin part.
To do so, prepare your TLS certificate (self-signed or signed by a public authority) and use docker-compose-sec.yml
and front-end/nginx.conf.sec
instead of docker-compose.yml
and front-end/nginx.conf
, respectively.
If you want to use it with a local machine that does not have internet access, you can use the offline configuration. Follow the instructions in configure/README.md
to configure the repo for offline use.
If you get the following error during the setup:
Role "docker" does not exist.
Go to your dbx
docker image's terminal, and run the following command:
bash /docker-entrypoint-initdb.d/init-db.sh