Skip to content
Dwayne Jeng edited this page Jan 13, 2024 · 16 revisions

NOTE: Before cloning the contents of this repository, please see https://sagebionetworks.jira.com/wiki/spaces/IT/pages/802881544/Using+GitHub

NOTE: Some of the information on this wiki page assumes that https://github.com/Sage-Bionetworks/BridgeWorkerPlatform/pull/47 has been merged.

This guide assumes you have git, Java, and an IDE set up, and that you have already set up Bridge Server. This guide also assumes you know how to set up Bridge accounts and that you know how to use AWS.

IMPORTANT: When you first load this project in IntelliJ, it will ask you if you want to auto-configure Kotlin. Do not click yes. If you click yes, you will get very weird compilation errors in your IDE.

If you're having issues with Kotlin code or with strange compilation errors in general, check your project root for files that end with *.iml. If those exist, delete those and restart IntelliJ.

Configuration

  1. First, follow the bootstrapping instructions for BridgeServer2, and ensure that you are able to run it locally.

  2. Create a file in your home directory called bridge-sdk.properties. It should look like:

     env = local
     app.identifier = api
    
  3. Create another file in your home directory called BridgeWorkerPlatform.conf. It should look like:

     bridge.env=local
     bridge.user=
     
     bridge.worker.appId=api
     bridge.worker.email=
     bridge.worker.password=
     
     local.workerPlatform.request.sqs.queue.url=
     
     synapse.user = 
     synapse.access.token = 
     synapse.principal.id=
     
     local.health.data.bucket.raw = org-sagebridge-rawhealthdata-local-yourusername
     local.upload.bucket = org-sagebridge-upload-local-yourusername
    

For bridge.worker, you'll need to create a new account and give it the WORKER role. See https://github.com/Sage-Bionetworks/BridgeServer2/wiki/Creating-Accounts

For workerPlatform.request.sqs.queue.url, this is created by BridgeServer2 bootstrapper. After BridgeServer2 runs for the first time, log into your AWS account and look for the SQS queue named Bridge-WorkerPlatform-Request-local-yourusername.

Configuring Additional Workers

You won't need to configure these unless you're specifically working on these workers.

Running the Worker Platform

In the root of the BridgeWorkerPlatform project, simply run mvn spring-boot:run.

Debugging

Run mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

This will start the Bridge Worker with remote debugging on port 5005 (the default debugging port in most IDEs).

NOTE: In Spring Boot v2.0 and above, they changed how to pass jvm args. When we update to Spring Boot v2.0 (or above), we'll need to update this doc as per Spring Boot documentation