Unverified Commit db6911fc authored by Emilio Garcia's avatar Emilio Garcia Committed by GitHub
Browse files

Merge pull request #213 from EGA-archive/bugfix/EE-2415

Bugfix/EE-2415
parents 829a4424 447ec377
Pipeline #297424 passed with stages
in 4 minutes and 36 seconds
......@@ -46,3 +46,5 @@ __pycache__
# Personal files
personal
local_run
config-map
......@@ -22,7 +22,9 @@ import eu.elixir.ega.ebi.commons.shared.service.AuthenticationService;
import lombok.extern.slf4j.Slf4j;
import eu.elixir.ega.ebi.dataedge.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Scope;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
......@@ -39,6 +41,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.*;
* @author asenf
*/
@RestController
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@EnableDiscoveryClient
@Slf4j
@RequestMapping("/files")
......
......@@ -56,9 +56,11 @@ import okhttp3.OkHttpClient;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.context.annotation.Scope;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
......@@ -89,6 +91,7 @@ import static eu.elixir.ega.ebi.commons.config.Constants.RES_SERVICE;
import static org.apache.catalina.connector.OutputBuffer.DEFAULT_BUFFER_SIZE;
@Service
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@EnableDiscoveryClient
@Slf4j
public class RemoteFileServiceImpl implements FileService {
......
......@@ -21,6 +21,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......@@ -154,12 +160,20 @@
<groupId>com.github.uio-bmi</groupId>
<artifactId>crypt4gh</artifactId>
<version>v1.2.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.ega</groupId>
<artifactId>fire-v3-core</artifactId>
......
......@@ -24,7 +24,9 @@ import htsjdk.samtools.seekablestream.ebi.BufferedBackgroundInputStream;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletContext;
......@@ -46,6 +48,7 @@ import java.util.stream.StreamSupport;
* @author asenf
*/
@RestController
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@EnableDiscoveryClient
@Slf4j
@RequestMapping("/file")
......
#!/bin/bash
## This script will launch the main components for data-api (config, eureka, key, filedatabase)
## Please run the following components in debug mode: res, data-edge, htsget
#Save current dir for future usage
DIR=$(pwd)
RUNDIR=$DIR/local_run
LOG_DIR=$RUNDIR/logs
VERSION=1.2.1-SNAPSHOT
mkdir -p $LOG_DIR
echo "Building project with maven in background..."
mvn clean install > /dev/null
echo "Done compiling."
#-------------------------------
echo "Launching config server..."
cd ega-data-api-netflix/ega-data-api-config
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-netflix/ega-data-api-config/target/ega-data-api-config-$VERSION.jar > $LOG_DIR/config.logs 2>&1 &
echo "config: $!" > $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching eureka server..."
cd ega-data-api-netflix/ega-data-api-eureka
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-netflix/ega-data-api-eureka/target/ega-data-api-eureka-$VERSION.jar > $LOG_DIR/eureka.logs 2>&1 &
echo "eureka: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching key server..."
cd ega-data-api-key
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-key/target/ega-data-api-key-$VERSION.jar > $LOG_DIR/key.logs 2>&1 &
echo "key: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching file-database server..."
cd ega-data-api-filedatabase
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-filedatabase/target/ega-data-api-filedatabase-$VERSION.jar > $LOG_DIR/file.logs 2>&1 &
echo "filedatabase: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching res server..."
cd ega-data-api-res
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-res/target/ega-data-api-res-$VERSION.jar > $LOG_DIR/res.logs 2>&1 &
echo "res: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching dataedge server..."
cd ega-data-api-dataedge
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-dataedge/target/ega-data-api-dataedge-$VERSION.jar > $LOG_DIR/dataedge.logs 2>&1 &
echo "dataedge: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo "Launching htsget server..."
cd ega-data-api-htsget
mvn package spring-boot:repackage > /dev/null
cd $DIR
nohup java -jar ega-data-api-htsget/target/ega-data-api-htsget-$VERSION.jar > $LOG_DIR/htsget.logs 2>&1 &
echo "htsget: $!" >> $RUNDIR/process_ids.txt
#-------------------------------
echo ""
echo "All processes started (Name: PID)"
cat $RUNDIR/process_ids.txt
echo ""
echo "Logs: $LOG_DIR"
ls -ltrh $LOG_DIR
echo ""
read -n 1 -r -s -p $'Press enter to exit...'
#-------------------------------
echo "Killing all processes:"
PIDS="$(cat $RUNDIR/process_ids.txt | awk -F' ' '{print $2}' | paste -s -d' ')"
KILL_COMMAND="kill -9 $PIDS"
echo " -> $KILL_COMMAND"
eval $KILL_COMMAND
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment