...
 
Commits (1282)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -10,6 +10,7 @@ web/src/main/webapp/svnversion.txt
/target/
service/minerva-big/
npm-debug.log
converter-sbml/jsbml.log
.idea/workspace.xml
.idea/libraries/
image: node
before_script:
- cd frontend-js
- npm install
- cd ..
- apt-get update
stages:
- build
- test
test_frontend:
stage: test
script:
- cd frontend-js
- npm install
- npm test
\ No newline at end of file
build_war:
image: debian
stage: build
only:
- tags
artifacts:
paths:
- minerva.war
script:
- apt-get install -y curl sudo gnupg git openjdk-8-jdk ant maven
- curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
- sudo apt-get install -y nodejs
- ant maven-build
- cp web/target/web-1.0.war minerva.war
build_debian_package:
image: debian
stage: build
only:
- tags
artifacts:
paths:
- "debian/*.deb"
script:
- apt-get install -y curl sudo gnupg git openjdk-8-jdk ant maven dh-make build-essential lintian devscripts xsltproc fakeroot xsltproc docbook-xsl
- curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
- sudo apt-get install -y nodejs
- export DEBFULLNAME="Piotr Gawron"
- export DEBEMAIL="piotr.gawron@uni.lu"
- ant debian-pkg
This diff is collapsed.
......@@ -3,17 +3,17 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
import jp.sbi.celldesigner.MainWindow;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.XmlParser;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.annotation.XmlAnnotationParser;
import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import org.apache.log4j.Logger;
/**
* This abstract class defines common function for {@link CopyAction} and
* {@link PasteAction}.
......
......@@ -2,6 +2,8 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.util.Set;
import org.apache.log4j.Logger;
import jp.sbi.celldesigner.MainWindow;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginReaction;
......@@ -10,11 +12,9 @@ import jp.sbi.celldesigner.plugin.PluginSpecies;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.SystemClipboard;
import lcsb.mapviewer.converter.model.celldesigner.annotation.XmlAnnotationParser;
import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import lcsb.mapviewer.model.map.MiriamData;
import org.apache.log4j.Logger;
/**
* CD Plugin action resposible for translating annotation stored in notes to xml
* format stored in annotations.
......
#Set root logger 's level and its appender to an appender called CONSOLE which is defined below.
log4j.rootLogger=info, CONSOLE, R
log4j.rootLogger=info, CONSOLE
#Set the behavior of the CONSOLE appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
......
alias l='ls -al --color'
if test -z "$DISPLAY" -a "$TERM" = "xterm" -a -x /usr/bin/who ; then
WHOAMI="`/usr/bin/who am i`"
_DISPLAY="`expr "$WHOAMI" : '.*(\([^\.][^\.]*\).*)'`:0.0"
if [ "${_DISPLAY}" != ":0:0.0" -a "${_DISPLAY}" != " :0.0" \
-a "${_DISPLAY}" != ":0.0" ]; then
export DISPLAY="${_DISPLAY}";
fi
unset WHOAMI _DISPLAY
fi
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
cd ~
supervisord -c /etc/supervisor/conf.d/supervisord.conf
#Docker description file for minerva framework.
FROM debian:jessie
MAINTAINER Piotr Gawron <piotr.gawron@uni.lu>
#setup non interactive install in apt-get
ENV DEBIAN_FRONTEND noninteractive
#installation of needed packages
#Some basic tools (optionally)
RUN apt-get update
RUN apt-get install -y apt-utils w3m
RUN apt-get install -y telnet
RUN apt-get install -y vim
RUN apt-get install -y procps
RUN apt-get install -y wget
#Minerva repo is via ssl
RUN apt-get install -y apt-transport-https
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
#Java 8 repository
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN apt-get update
#Make sure that installer won't ask for accepting license
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
#Minerva uni.lu repository
RUN echo "deb http://repo-r3lab.uni.lu/debian/ stable main" | tee /etc/apt/sources.list.d/r3lab-uni.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xcb185f4e31872412
RUN apt-get update
#install dependencies separatelly (usefull when we change something - then we don't have to do everything from scratch)
RUN apt-get install -y tomcat7 && /etc/init.d/tomcat7 stop
RUN apt-get install -y postgresql
RUN apt-get install -y oracle-java8-set-default
ADD policy-rc.d /tmp/policy-rc.d
RUN apt-get update
#when we install minerva allow to start services, so everything can be installed properly
#but we need to disable tomcat7 because tomcat7 requires SYS_PTRACE and we cannot start it:
#take a look here:
#http://stackoverflow.com/questions/29683231/tomcat7-fail-to-start-inside-ubuntu-docker-container
RUN mv /usr/sbin/policy-rc.d /usr/sbin/policy-rc.d.backup && \
mv /tmp/policy-rc.d /usr/sbin/policy-rc.d && \
apt-get install -y minerva && \
mv /usr/sbin/policy-rc.d.backup /usr/sbin/policy-rc.d
EXPOSE 8080
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD .bashrc /root/
#!/bin/bash
#docker build --no-cache -t minerva .
docker build -t minerva .
docker run -p 8080:8080 -t -i minerva bash
#!/bin/sh
# For most Docker users, "apt-get install" only happens during "docker build",
# where starting services doesn't work and often fails in humorous ways. This
# prevents those failures by stopping the services from attempting to start.
echo "policy-rc.d for " $1
if [ "$1" = "tomcat7" ] || [ "$1" = "tomcat8" ];
then
exit 101
fi
exit 0;
[supervisord]
nodaemon=false
logfile=/var/log/supervisor/supervisor.log
[program:postgresql]
command=/etc/init.d/postgresql start
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
[program:tomcat]
command=/etc/init.d/tomcat7 start
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
startretries=0
This diff is collapsed.
[![build status](https://git-r3lab.uni.lu/piotr.gawron/minerva/badges/207-continous-integration-tests/build.svg)](https://git-r3lab.uni.lu/piotr.gawron/minerva/commits/207-continous-integration-tests)
[![build status](https://git-r3lab.uni.lu/piotr.gawron/minerva/badges/master/build.svg)](https://git-r3lab.uni.lu/piotr.gawron/minerva/commits/master)
# Rest API (version 11)
......
......@@ -30,6 +30,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
......
......@@ -21,123 +21,129 @@ import lcsb.mapviewer.model.cache.CacheType;
*/
public final class ApplicationLevelCache extends XmlParser implements QueryCacheInterface {
/**
* How many values should be stored in cache before we even try to consider
* releasing object due to huge memory usage.
*/
static final int MIN_CACHED_VALUES_BEFORE_CLEAN = 100;
/**
* Default class logger.
*/
private static Logger logger = Logger.getLogger(ApplicationLevelCache.class);
/**
* Cached nodes stored locally and identified by string.
*/
private static Map<String, Node> cachedQueryNodes = new HashMap<String, Node>();
/**
* Cached strings stored locally and identified by string.
*/
private static Map<String, String> cachedQueryString = new HashMap<String, String>();
/**
* Global instance of cache.
*/
private static ApplicationLevelCache cache = null;
/**
* Returns single instance of global application cache (singleton pattern).
*
* @return single instance of global application cache
*/
public static ApplicationLevelCache getInstance() {
if (Configuration.isApplicationCacheOn()) {
if (cache == null) {
cache = new ApplicationLevelCache();
}
return cache;
} else {
return null;
}
}
/**
* Default constructor. Prevents instatiation.
*/
private ApplicationLevelCache() {
}
@Override
public synchronized Node getXmlNodeByQuery(String query, CacheType type) {
Node result = null;
result = cachedQueryNodes.get(type.getId() + "\n" + query);
return result;
}
@Override
public synchronized String getStringByQuery(String query, CacheType type) {
String result = null;
result = cachedQueryString.get(type.getId() + "\n" + query);
return result;
}
@Override
public synchronized void setCachedQuery(String query, CacheType type, Object object) {
performMemoryBalance();
if (object instanceof String) {
cachedQueryString.put(type.getId() + "\n" + query, (String) object);
} else if (object instanceof Node) {
cachedQueryNodes.put(type.getId() + "\n" + query, (Node) object);
} else if (object == null) {
cachedQueryString.put(type.getId() + "\n" + query, (String) object);
} else {
throw new CacheException("Unknown object type: " + object.getClass());
}
}
/**
* Method that clean cache if memory usage is too high.
*/
synchronized void performMemoryBalance() {
long cacheCount = 0;
cacheCount += cachedQueryString.size();