Skip to content

Commit

Permalink
Reworked properties files.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvb2univpitt committed Nov 10, 2016
1 parent fb5c987 commit 26cd298
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 100 deletions.
6 changes: 1 addition & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<artifactId>ccd-db</artifactId>
<version>0.6.2</version>
</dependency>

<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-commons</artifactId>
Expand All @@ -73,19 +72,16 @@
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.23.1</version>
<!-- <type>jar</type>-->
</dependency>

<!-- Auth0 JTW - https://github.com/auth0/java-jwt -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>2.2.0</version>
</dependency>

</dependencies>

<!-- This makes the jar execuitable, don not use it with other dependencies, like ccd-db -->
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,39 @@
@PropertySource("classpath:causal.properties")
public class CausalRestProperties {

@Value("${ccd.dir.workspace}")
private String workspaceDir;

@Value("${ccd.folder.lib}")
private String libFolder;

@Value("${ccd.jar.algorithm}")
private String algorithmJar;

@Value("${ccd.folder.data}")
@Value("${ccd.algorithm.fgs:fgs}")
private String fgs;

@Value("${ccd.algorithm.fgs.discrete:fgsc}")
private String fgsDiscrete;

@Value("${ccd.algorithm.gfci:gfci}")
private String gfci;

@Value("${ccd.server.workspace:}")
private String workspaceDir;

@Value("${ccd.folder.data:data}")
private String dataFolder;

@Value("${ccd.folder.tmp}")
@Value("${ccd.folder.lib:lib}")
private String libFolder;

@Value("${ccd.folder.tmp:tmp}")
private String tmpFolder;

@Value("${ccd.folder.results}")
@Value("${ccd.folder.results:results}")
private String resultsFolder;

@Value("${ccd.folder.results.algorithm}")
@Value("${ccd.folder.results.algorithm:algorithm}")
private String algorithmFolder;

@Value("${ccd.folder.results.comparison}")
@Value("${ccd.folder.results.comparison:comparison}")
private String comparisonFolder;

@Value("${ccd.algorithm.fgs}")
private String fgs;

@Value("${ccd.algorithm.fgs.discrete}")
private String fgsDiscrete;

@Value("${ccd.algorithm.gfci}")
private String gfci;

@Value("${ccd.jwt.issuer}")
private String jwtIssuer;

Expand All @@ -77,28 +77,44 @@ public class CausalRestProperties {
public CausalRestProperties() {
}

public String getWorkspaceDir() {
return workspaceDir;
public String getAlgorithmJar() {
return algorithmJar;
}

public void setWorkspaceDir(String workspaceDir) {
this.workspaceDir = workspaceDir;
public void setAlgorithmJar(String algorithmJar) {
this.algorithmJar = algorithmJar;
}

public String getLibFolder() {
return libFolder;
public String getFgs() {
return fgs;
}

public void setLibFolder(String libFolder) {
this.libFolder = libFolder;
public void setFgs(String fgs) {
this.fgs = fgs;
}

public String getAlgorithmJar() {
return algorithmJar;
public String getFgsDiscrete() {
return fgsDiscrete;
}

public void setAlgorithmJar(String algorithmJar) {
this.algorithmJar = algorithmJar;
public void setFgsDiscrete(String fgsDiscrete) {
this.fgsDiscrete = fgsDiscrete;
}

public String getGfci() {
return gfci;
}

public void setGfci(String gfci) {
this.gfci = gfci;
}

public String getWorkspaceDir() {
return workspaceDir;
}

public void setWorkspaceDir(String workspaceDir) {
this.workspaceDir = workspaceDir;
}

public String getDataFolder() {
Expand All @@ -109,6 +125,14 @@ public void setDataFolder(String dataFolder) {
this.dataFolder = dataFolder;
}

public String getLibFolder() {
return libFolder;
}

public void setLibFolder(String libFolder) {
this.libFolder = libFolder;
}

public String getTmpFolder() {
return tmpFolder;
}
Expand Down Expand Up @@ -141,30 +165,6 @@ public void setComparisonFolder(String comparisonFolder) {
this.comparisonFolder = comparisonFolder;
}

public String getFgs() {
return fgs;
}

public void setFgs(String fgs) {
this.fgs = fgs;
}

public String getFgsDiscrete() {
return fgsDiscrete;
}

public void setFgsDiscrete(String fgsDiscrete) {
this.fgsDiscrete = fgsDiscrete;
}

public String getGfci() {
return gfci;
}

public void setGfci(String gfci) {
this.gfci = gfci;
}

public String getJwtIssuer() {
return jwtIssuer;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application-hsqldb.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
# DATASOURCE (DataSourceProperties)
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.url=jdbc:hsqldb:mem:ccd;ifexists=false;shutdown=true

# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.HSQLDialect
# JPA (JpaBaseConfiguration)
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
11 changes: 5 additions & 6 deletions src/main/resources/application-mysql.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
# DATASOURCE (DataSourceProperties)
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/ccd?zeroDateTimeBehavior=convertToNull
# Remember to leave the username and password fields blank when pushing to github
spring.datasource.username=root
spring.datasource.password=123
spring.datasource.username=
spring.datasource.password=
spring.datasource.validation-query=SELECT 1
spring.datasource.test-on-borrow=true

# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
# JPA (JpaBaseConfiguration)
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
7 changes: 3 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spring.main.banner-mode=off
# PROFILES
# scheduler, slurm
# hsqldb, mysql
spring.profiles.active=scheduler,mysql
spring.profiles.active=scheduler,hsqldb

# LOGGING
logging.file=causal_rest_api.log
Expand All @@ -32,12 +32,11 @@ logging.level.org.hibernate=ERROR
# EMBEDDED SERVER CONFIGURATION (ServerProperties)
server.port=9000
server.session-timeout=-1
server.context-path=/causal/api/v1/
server.context-path=/ccd-api/

# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
# Hibernate ddl auto (create, create-drop, update)
# Hibernate ddl auto (create,create-drop,update)
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring.jpa.show-sql=false

# MULTIPART (MultipartProperties)
Expand Down
35 changes: 11 additions & 24 deletions src/main/resources/causal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,25 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# DIRECTORIES
ccd.dir.workspace=/home/zhy19/ccd/workspace

# Lib folder
ccd.folder.lib=lib

# causal-cmd JAR
# JAR LIBRARIES
ccd.jar.algorithm=causal-cmd-6.0.0.jar

# WORKSPACE FOLDERS
# User data folder
ccd.folder.data=data
# ALGORITHMS
ccd.algorithm.fgs=fgsc
ccd.algorithm.fgs.discrete=fgsd
ccd.algorithm.gfci=gfcic

# Tmp folder for running algorithm
# DIRECTORIES
ccd.server.workspace=
ccd.folder.data=data
ccd.folder.lib=lib
ccd.folder.tmp=tmp

# Results folder
ccd.folder.results=results

# Algorithm Results folder inside ccd.folder.results
ccd.folder.results.algorithm=algorithm

# Algorithm Results comparison folder
ccd.folder.results.comparison=comparison

# ALGORITHMS
ccd.algorithm.fgs=fgsc
ccd.algorithm.fgs.discrete=fgsd
ccd.algorithm.gfci=gfcic

# JWT settings for API Authentication
ccd.jwt.issuer=https://cloud.ccd.pitt.edu/
ccd.jwt.issuer=http://localhost/
ccd.jwt.secret=causal
# The token will expire after 3600 seconds
ccd.jwt.lifetime=3600
ccd.jwt.lifetime=3600
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;

/**
Expand All @@ -31,7 +30,7 @@
* @author Kevin V. Bui ([email protected])
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@SpringBootTest
public class CausalRestApiApplicationTest {

@Test
Expand Down
23 changes: 23 additions & 0 deletions src/test/resources/application-hsqldb.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2016 University of Pittsburgh.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# DATASOURCE (DataSourceProperties)
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.url=jdbc:hsqldb:mem:ccd;ifexists=false;shutdown=true

# JPA (JpaBaseConfiguration)
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
27 changes: 27 additions & 0 deletions src/test/resources/application-mysql.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2016 University of Pittsburgh.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# DATASOURCE (DataSourceProperties)
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/ccd?zeroDateTimeBehavior=convertToNull
spring.datasource.username=
spring.datasource.password=
spring.datasource.validation-query=SELECT 1
spring.datasource.test-on-borrow=true

# JPA (JpaBaseConfiguration)
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
27 changes: 27 additions & 0 deletions src/test/resources/application-slurm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2015 University of Pittsburgh.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA

# SLURM TEMPLATE
ccd.template.checkuserdir=causalUserWorkspace.vm
ccd.template.causaljob=slurmCausalJob.vm

# DIRECTORIES
ccd.remote.server.dataspace=
ccd.remote.server.workspace=
ccd.folder.job_templates=job_templates
ccd.script.checkuserdir=checkUserDir
ccd.script.runslurmjob=runSlurmJob
Loading

0 comments on commit 26cd298

Please sign in to comment.