This is the prototype web service for the dockstore. The usage of this is to enumerate the docker containers (from quay.io and hopefully docker hub) and the workflows (from github) that are available to users of Collaboratory.
If you maven build in the root directory this will build not only the web service but the client tool:
mvn clean install
docker build -t dockstore:1.0.0 .
Probably the best way to run this since it includes a bundled postgres. Keep in mind once you terminate the Docker container any state in the DB is lost.
- Fill in the template dockstore.yml and stash it somewhere outside the git repo (like ~/.dockstore)
- Start with
docker run -it -v ~/.dockstore/dockstore.yml:/dockstore.yml -e POSTGRES_PASSWORD=iAMs00perSecrEET -e POSTGRES_USER=webservice -p 8080:8080 dockstore:1.0.0
You can also run it on your local computer but will need to setup postgres separately.
- Fill in the template dockstore.yml and stash it somewhere outside the git repo (like ~/.dockstore)
- Start with
java -jar dockstore-webservice/target/dockstore-webservice-*.jar server ~/.dockstore/dockstore.yml
- Setup a new OAuth application at Register a new OAuth application
- Browse to http://localhost:8080/integration.github.com
- Authorize via github.com using the provided link
- Browse to http://localhost:8080/github.repo to list repos along with their collab.json (if they exist)
- Setup an application as described in Creating a new Application
- Browse to http://localhost:8080/integration.quay.io
- Authorize via quay.io using the provided link
- Browse to http://localhost:8080/container to list repos that we have tokens for at quay.io
First add all your organizations/namespaces you are associated to on Quay.io to the constructor ofThe webservice will now only use user's Quay username as namespace. This means that you will see only your own Quay repositories.dockstore/dockstore-webservice/src/main/java/io/dockstore/webservice/resources/DockerRepoResource.java
. See next section for details.- Build the project and run the webservice. NOTE: The webservice will grab and use the IP of the server running the API. For example, if running on a docker container with IP 172.17.0.24, the API will use this for the curl commands and request URLs.
- Add your Github token. Follow the the steps above to get your Github token. This will create a user with the same username.
- Add your Quay token. It will automatically be assigned to the user created with Github if the username is the same. If not, you need to user /token/assignEndUser to associate it with the user.
- To load all your containers from Quay, use /container/refresh to load them in the database for viewing. This needs to be done automatically once the Quay token is set.
- Now you can see and list your containers. Note that listing Github repos do not return anything because it does not return a valid json.
Recently, Quay has fixed/optimized their API. To list a user's repositories, the required parameters: namespace, starred or public will have to be specified. If you do not specify namespace, you will see other people's public repositories, which is not what we want. Therefore we need to have namespace.
However, the only way to list all namespaces and organizations is to use their /api/v1/user/ resource. But this resource seems to have a bug and does not list the organizations. Therefore, we are temporarily hard coding our namespaces to DockerRepoResource.java.
Some background on the client:
- https://sdngeeks.wordpress.com/2014/08/01/swagger-example-with-java-spring-apache-cxf-jackson/
- http://developers-blog.helloreverb.com/enabling-oauth-with-swagger/
The dockstore command line should be installed in a location in your path.
/dockstore-client/bin/dockstore
You then need to setup a ~/.dockstore/config
file with the following contents:
token: <dockstore_token_from_web_app>
server-url: http://www.dockstore.org:8080
If you are working with a custom-built or updated dockstore client you will need to update the jar in: ~/.dockstore/config/self-installs
.
- we need to define how this interacts with a single sign-on service
- in general, users should be able to list their own information (such as tokens and repos)
- only admin users (or our other services) should be able to list all information
- items from Brian 2. you need better directions for filling in the yml settings file
- you need to document how you created the Java Swagger client (e.g show the commands used)
- you need to document the config file
- you need to document better how to setup the dockstore command line
- you need to document the release process, how to update the jar the dockstore command line downloads