Skip to content

Latest commit

 

History

History
107 lines (73 loc) · 3.59 KB

README.md

File metadata and controls

107 lines (73 loc) · 3.59 KB

HITApp Server

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.

Get started

The following steps should be performed to prepare the system locally. Similarly it can be deployed on a VM.

  1. Install docker and docker-compose, if they are not already installed. Follow the platform specific installation instructions (e.g. For Ubuntu docker engine, docker-compose).

  2. 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
  3. Run the following commands to configure the repo:

        cd configure
        pip install pyyaml
        python configure.py --config configs/online.yaml
  4. 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]
  5. 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
  6. Run the docker-compose

    docker-compose up --build -d

    Note, you may need to use sudo:

    sudo docker-compose up --build -d
  7. 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.

Stop the system

  1. 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

Deploying on cloud server

  1. Create a Linux Virtual Machine (VM)

    1. Add a DNS name, so you have a URL for your VM
    2. Make sure that port 80 is open
  2. Connect to the VM through SSH

  3. Follow the rest of procedure given in the "Get started" section

TLS certificate

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.

Offline Use

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.

Troubleshooting

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