-
Notifications
You must be signed in to change notification settings - Fork 7
Getting started
- On Mac OS X I recommend using the mac app, or you can use homebrew. For the mac app installation, remember to add the following to your .profile
export PATH=/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH
- *Start Postgres, and use the sql script
create.sqllocated atsql/common/inside the project, e.g.psql -U username -d myDataBase -a -f common/create.sql. It will create a useringress_userand the required tables. Point your configuration files to your Postgres instance, by defaultlocalhost:5432should work.
-
You can run DynamoDB locally by using the dev version
-
Install DynamoDB (see link above) and run it with
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -port 7777where7777is the port you wish to connect to and that you have added to your configuration files. Hint: you need to updatesuripu-service.dev.yml. -
Copy
*.dev.yml.exampleto*.dev.ymlin each sub module. Update all the username and password accordingly.
- You need Java 7 installed. Remember to set
JAVA_HOMEcorrectly by adding the following to your .profile
export JAVA_HOME=$(/usr/libexec/java_home).
-
Install Maven
brew install maven(3.2.1), or follow instructions here. See below for additional Maven settings for shared libraries. -
IntelliJ Community Edition is an amazing IDE for Java. **If you’re not using IntelliJ, you’re probably doing it wrong.
-
Now’s a good time to open IntelliJ and build the project by running
mvn clean packagein the terminal. -
run
java -jar your-jar create_table suripu-factory.dev.yml -
You’re now ready to start the multiple HTTP service. Each service is independent as they all have different availability, latency and security properties. To start a HTTP service you need to run
java -jar path/to/your/jar/file.jar server path/to/your/config/file.yml -
Each HTTP service listens on 2 ports (regular and admin) so make sure they are not conflicting. The REST endpoints will be logged by default and connections to databases will be initiated. Should one part of the system be unavailable – most likely misconfigured – your HTTP services will refuse to start.
-
Pre-populate your local DB with some data:
- download sql dump from dropbox [Product/software/Research/data_recording]
- create a temporary database, in psql
CREATE DATABASE database_Y_M_D - run in command line
psql database_Y_M_D < dump-Y-M-D.sql
- You will need to set environment variable for AWS keys.
AWS_ACCESS_KEY_ID BLAH-MY-KEY-HERE
AWS_SECRET_KEY something+secure+here+password-l33t
We are hosting some shared libraries on our own maven repo, hosted on S3.
Add the following to your ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>s3.site</id>
<username></username>
<password></password>
</server>
<server>
<id>s3.release</id>
<username></username>
<password></password>
</server>
<server>
<id>s3.snapshot</id>
<username></username>
<password></password>
</server>
<server>
<id>hello-maven</id>
<username></username>
<password></password>
</server>
</servers>
</settings>The username and password for maven are the AWS_ACCESS_KEY_ID and AWS_SECRET_KEY.