-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up Rawls locally
Get a recent copy of rawls.conf, the master configuration file (from dsde-jenkins.broadinstitute.org if you have admin priveleges, or from a teammate if you don't). Put it in /etc/rawls.conf. Probably a good idea to make it readable by you alone, since it contains secrets.
Cd to your rawls git workarea, and type sbt. (Install sbt via http://www.scala-sbt.org/release/tutorial/Setup.html if needed.)
After a few preliminaries, you should see sbt's command prompt.
Type the command "re-start", and your server will spin up locally.
You can access rawls via the Swagger interface by pointing a browser at http://localhost:8080/. In order to actually use the endpoints, however, it's necessary to set your auth cookie following the procedure below. The error message indicating a missing/expired auth cookie is: Request is missing required cookie 'iPlanetDirectoryPro'
You can make code changes, and just type "re-start" again to re-run the service. sbt will recompile the code and package it up, and re-start the server for you.
Type exit (or ^C) when you're done and you want to kill sbt and the local server.
In order to use the Swagger "Try it out" interface on the local server you've just spun up you'll need to supply an OpenAM authorization cookie. CI servers (such as https://rawls-dev.broadinstitute.org/) are configured to redirect to OpenAM if the cookie is expired or missing, so visit one of these to set the cookie. The cookie is valid across .broadinstitute.org so it's necessary to access your local server by specifying localhost.broadinstitute.org instead of just localhost. Note: certain unknown browser security settings can prevent this cookie sharing. It may be necessary to try an uncustomized browser.
A good test that your cookie is set correctly and you are able to access appropriate ACLs is hitting the List Workspaces endpoint in CI https://rawls-dev.broadinstitute.org/workspaces. If that works, test the same endpoint in your local server: http://localhost.broadinstitute.org:8080/workspaces.
TODO: verify that this works with ACLs. I am very skeptical.
- Install the Firebug add-on. Go here: http://getfirebug.com/
- Right-click on a tab (even an empty one works fine) and choose "Inspect Element with Firebug". This brings up Firebug's UI at the bottom of the window.
- You're on the HTML tab. Click on the Cookies tab. You'll see three drop-downs at the top of the tab: Cookies, Filter, and Default (Accept session cookies).
- Frob the Cookies drop-down: first choice is "Create Cookie". Choose it, and you'll get a dialog box pop-up.
- Fill in the dialog box as follows: Name: iPlanetDirectoryPro Host: localhost Path: / Expires: sometime in the far distant future Value: test_token (it doesn't really matter) Now hit OK to create the cookie.
- Now surf to http://localhost:8080/ to visit the Swagger interface for your local server.
- "Try it out!" to your heart's content.
Navigate to http://localhost:8080 then enter this into the address bar: javascript:document.cookie="iPlanetDirectoryPro=myCookieValue" (NOTE: this doesn't actually seem to work)