This document outlines how to run our demo server locally. The demo consists of all three DTP components (an API server, a Transfer Worker server, and a frontend) all packaged into one Docker image. Note that in production, the API and Transfer Workers run separately, but they are combined into the same binary here for demo purposes.
To run the Data Transfer Project, each hosted instance (including your local one) needs its own API keys for each service it will facilitate transfers with.
Please see the API keys document for instructions on acquiring keys.
To be clear, you will only be able to transfer data to/from services you have acquired a key for. This is by design, as explained in API keys.
The first time you run the demo image, you need to configure your credentials by copying distributions/demo-server/env.secrets.template to env.secrets and inserting the API keys and secrets you acquired above.
See docs.docker.com/install to install Docker for your OS.
You only need to do this once:
sudo service docker start
You may run our latest demo image from dockerhub, or build it yourself.
To download our latest demo image, run:
docker pull datatransferproject/demo
Or, to build it yourself, run:
./gradlew :distributions:demo-server:dockerize
This will generate the dockerfile and build an image, copying over local settings (configured in .gradle/properties.gradle) and using the local "cloud hosting" extension.
docker run --rm -p 3000:443 -p 5005:5005 -p 8080:8080 --env-file distributions/demo-server/env.secrets --name dtp-demo datatransferproject/demo
will run the demo server image from above on localhost:8080.
--rm
tells docker to clean up the file system after it is done running-p 3000:443 -p 8080:8080
exposes some port from the docker system to your machinedatatransferproject/demo
is the name of the image you obtained
If everything worked, you'll start to see some log lines scrolling by, like:
2018-07-09 12:23:01,078 [JobPollingService RUNNING] DEBUG org.datatransferproject.transfer.JobPollingService - Polling for a job in state CREDS_AVAILABLE
You should now be able to access the web application at https://localhost:3000.
The API is accessible via https://localhost:8080/_/listDataTypes. A java debugger can be connected via port 5005.
You can interact with the docker image via docker exec -it dtp-demo <command>