\n";
119 | return "\n\n\n
\n";
120 | }
121 |
122 | sub get_enclosing_div_end {
123 | my ($self) = @_;
124 |
125 | return "\n
\n\n\n";
126 | }
127 |
128 | sub get_index_html_content {
129 | my ($self) = @_;
130 | # when running in a docker container, $host must always be localhost.
131 | # Otherwise, "joomla-sites" gets propagated to the "base" element of the template
132 | # and then none of the resources load properly.
133 | # my $host = 'localhost';
134 | my $host = $GKB::Config::HOST_NAME;
135 | chomp $host;
136 | my $content = `wget --no-check-certificate -qO- $host/template-cgi`;
137 | $content =~ s|http:\/\/|https:\/\/|g;
138 | $content =~ s/favth\-content\-block\s?//g;
139 | return $content;
140 | }
141 |
142 | 1;
143 |
--------------------------------------------------------------------------------
/test_standalone_analysis_service.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | # Before running this test script, start the stand-alone AnalysisService:
4 | # docker run --rm -p 8080:8080 reactome/stand-alone-analysis-service:ReleaseXX (eg:Release74; if port is already allocated locally, try '1234:8080')
5 |
6 | # Getting the path to `time` ensures that we don't use the built-in *shell* command with the same name.
7 | # This "other" time command allows some better formatting options for output.
8 | PATH_TO_TIMECMD=$(which time)
9 |
10 | # Checks valus via GET
11 | function check_vals()
12 | {
13 | ENDPOINT=$1
14 | VAL_NAME=$2
15 | JQ_FILTER=$3
16 |
17 | echo "Checking remote..."
18 | # Use jq to remove the token element - it will always cause a comparison to fail, since each server will generate a different token.
19 | $PATH_TO_TIMECMD -f %E curl --output /tmp/REMOTEOUT -s "https://reactome.org/$ENDPOINT"
20 | echo "checking local..."
21 | $PATH_TO_TIMECMD -f %E curl --output /tmp/LOCALOUT -s "http://localhost:8080/$ENDPOINT"
22 |
23 | LOCAL_VAL=""
24 | REMOTE_VAL=""
25 | # process the returned value with jq if a jq filter was given.
26 | if [ ! -z "$JQ_FILTER" ] ; then
27 | LOCAL_VAL=$(cat /tmp/LOCALOUT | jq -S "$JQ_FILTER")
28 | REMOTE_VAL=$(cat /tmp/REMOTEOUT | jq -S "$JQ_FILTER")
29 | else
30 | LOCAL_VAL=$(cat /tmp/LOCALOUT)
31 | REMOTE_VAL=$(cat /tmp/REMOTEOUT)
32 | fi
33 | # If values don't match, write them to temp files, then output the diff.
34 | if [ "$LOCAL_VAL" != "$REMOTE_VAL" ] ; then
35 | echo "$VAL_NAME don't match!"
36 |
37 | if [ ! -z "$JQ_FILTER" ] ; then
38 | echo $LOCAL_VAL | jq '.' > /tmp/${VAL_NAME}_L
39 | echo $REMOTE_VAL | jq '.' > /tmp/${VAL_NAME}_R
40 | else
41 | echo $LOCAL_VAL > /tmp/${VAL_NAME}_L
42 | echo $REMOTE_VAL > /tmp/${VAL_NAME}_R
43 | fi
44 | diff /tmp/${VAL_NAME}_L /tmp/${VAL_NAME}_R
45 | else
46 | echo -e "$VAL_NAME test passed.\n"
47 | fi
48 | }
49 |
50 | # Checks values via POST
51 | check_vals_post()
52 | {
53 | ENDPOINT=$1
54 | VAL_NAME=$2
55 | POSTDATA=$3
56 | JQ_FILTER=$4
57 |
58 | echo "Checking remote..."
59 | $PATH_TO_TIMECMD -f %E curl -X POST --output /tmp/REMOTEOUT -H "Accept: application/json" -H "content-type: text/plain" -d "$POSTDATA" -s "https://reactome.org/$ENDPOINT"
60 | echo "checking local..."
61 | $PATH_TO_TIMECMD -f %E curl -X POST --output /tmp/LOCALOUT -H "Accept: application/json" -H "content-type: text/plain" -d "$POSTDATA" -s "http://localhost:8080/$ENDPOINT"
62 | LOCAL_VAL=""
63 | REMOTE_VAL=""
64 | if [ ! -z "$JQ_FILTER" ] ; then
65 | LOCAL_VAL=$(cat /tmp/LOCALOUT | jq -S "$JQ_FILTER" )
66 | REMOTE_VAL=$(cat /tmp/REMOTEOUT | jq -S "$JQ_FILTER" )
67 | else
68 | LOCAL_VAL=$(cat /tmp/LOCALOUT )
69 | REMOTE_VAL=$(cat /tmp/REMOTEOUT )
70 | fi
71 |
72 | if [ "$LOCAL_VAL" != "$REMOTE_VAL" ] ; then
73 | echo "$VAL_NAME don't match!"
74 | # "jq '.'" ensures that JSON gets pretty-formatted before it's output to file. Makes debugging easier."
75 | echo $LOCAL_VAL | jq -S '.' > /tmp/${VAL_NAME}_L
76 | echo $REMOTE_VAL | jq -S '.' > /tmp/${VAL_NAME}_R
77 | diff /tmp/${VAL_NAME}_L /tmp/${VAL_NAME}_R
78 | else
79 | echo -e "$VAL_NAME test passed.\n"
80 | fi
81 | }
82 |
83 | echo -e "\nChecking names..."
84 | check_vals AnalysisService/database/name 'Names'
85 |
86 | echo -e "\nChecking versions..."
87 | check_vals AnalysisService/database/version 'Versions'
88 |
89 | echo -e "\nCheck identifiers lookup & projection"
90 | check_vals 'AnalysisService/identifier/BRAF/projection?interactors=true&pageSize=20&page=1&sortBy=ENTITIES_PVALUE&order=ASC&resource=TOTAL&pValue=1&includeDisease=true' 'Identifier_projection' 'del( .summary.token )'
91 |
92 | echo -e "\nCheck batch look for identifiers"
93 | check_vals_post 'AnalysisService/identifiers/?interactors=true&pageSize=20&page=1&sortBy=ENTITIES_PVALUE&order=ASC&resource=TOTAL&pValue=1&includeDisease=true' 'Identifier_batch' "BRAF, BRCA" 'del( .summary.token )'
94 |
95 | echo -e "\nCheck identifier mappings"
96 | check_vals_post 'AnalysisService/mapping/?interactors=true' 'IdentifierMapping' 'TGFBR2, 15611' '.'
97 |
98 | echo -e "\nCheck identifier mappings projection"
99 | check_vals_post 'AnalysisService/mapping/projection?interactors=true' 'IdentifierMappingProjection' 'TGFBR2, 15611' '.'
100 |
101 | echo -e "\nCheck species comparison"
102 | check_vals 'AnalysisService/species/homoSapiens/49646?pageSize=20&page=1&sortBy=ENTITIES_PVALUE&order=ASC&resource=TOTAL&pValue=1&includeDisease=true' 'SpeciesComparison' 'del( .summary.token )'
103 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.7'
2 | services:
3 |
4 | mysql-for-tomcat:
5 | image: reactome/reactome-mysql:$RELEASE_VERSION
6 | build:
7 | context: ./mysql
8 | dockerfile: mysql.dockerfile
9 | args:
10 | RELEASE_VERSION: $RELEASE_VERSION
11 | hostname: mysql-for-tomcat
12 | container_name: mysql-for-tomcat
13 | env_file:
14 | - tomcat.env
15 | volumes:
16 | - ./mysql/init.sh:/init.sh
17 | - ./logs/mysql/tomcat:/var/log/mysql
18 | - mysql-for-tomcat-log:/backup
19 | command: bash -c "/init.sh && exec /entrypoint.sh mysqld"
20 |
21 | neo4j-db:
22 | image: "reactome/graphdb:${RELEASE_VERSION}"
23 | build:
24 | context: ./neo4j
25 | dockerfile: neo4j_generated_from_mysql.dockerfile
26 | args:
27 | RELEASE_VERSION: $RELEASE_VERSION
28 | container_name: neo4j-db
29 | hostname: neo4j-db
30 | env_file:
31 | - neo4j.env
32 | volumes:
33 | - ./logs/neo4j/:/var/lib/neo4j/logs/
34 | ports:
35 | - 7474:7474
36 | - 7687:7687
37 |
38 | solr:
39 | image: "reactome/solr:${RELEASE_VERSION}"
40 | container_name: solr-for-reactome
41 | hostname: solr-for-reactome
42 | build:
43 | context: ./solr
44 | dockerfile: index-builder.dockerfile
45 | args:
46 | RELEASE_VERSION: $RELEASE_VERSION
47 | ports:
48 | - 8983:8983
49 | volumes:
50 | - ./logs/solr/:/opt/solr/server/logs/:rw
51 | - ./solr/solr-security.json:/opt/solr/server/solr/security.json:rw
52 | entrypoint: solr start -f
53 |
54 | tomcat:
55 | image: reactome/tomcat
56 | container_name: tomcat-server
57 | hostname: tomcat-server
58 | build:
59 | context: ./tomcat
60 | dockerfile: tomcat.dockerfile
61 | depends_on:
62 | - mysql-for-tomcat
63 | - joomla-sites
64 | - neo4j-db
65 | - solr
66 | links:
67 | - mysql-for-tomcat
68 | - joomla-sites
69 | - neo4j-db
70 | entrypoint: bash -c "ls -lht /certs && /wait-for.sh neo4j-db:7687 -t 500 && /wait-for.sh neo4j-db:7474 -t 500 && /wait-for.sh solr-for-reactome:8983 -t 500 && /wait-for.sh mysql-for-tomcat:3306 -t 500 && /wait-for.sh joomla-sites:80 -t 500 && { echo yes | keytool -v -import -file /certs/server.crt -alias joomla-sites -keystore cacerts.jks -keypass changeit -storepass changeit || ( keytool -v -delete -alias joomla-sites -keystore cacerts.jks -storepass changeit && echo yes | keytool -v -import -file /certs/server.crt -alias joomla-sites -keystore cacerts.jks -keypass changeit -storepass changeit ) ; } && catalina.sh run"
71 | volumes:
72 | - fireworks-dir:/usr/local/tomcat/webapps/download/current/fireworks
73 | - diagrams-dir:/usr/local/tomcat/webapps/download/current/diagram
74 | - ./wait-for.sh:/wait-for.sh
75 | - ./tomcat/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml
76 | - ./tomcat/tomcat-server.xml:/usr/local/tomcat/conf/server.xml
77 | - ./tomcat/tomcat-manager.xml:/usr/local/tomcat/conf/Catalina/localhost/manager.xml
78 | - ./tomcat/analysis-service/results:/usr/local/AnalysisService/analysis-results
79 | - ./tomcat/analysis-service/reports:/usr/local/AnalysisService/analysis-reports
80 | - ./logs/applications/AnalysisService:/usr/local/AnalysisService/log
81 | - ./logs/applications/ContentService:/usr/local/search/log/content-service
82 | - ./logs/applications/DataContent:/usr/local/search/log/data-content
83 | - ./logs/tomcat/:/usr/local/tomcat/logs/ #to save logs inside host directory of tomcat/logs/
84 | - ./certificates:/certs
85 | env_file:
86 | - tomcat.env
87 | ports:
88 | - 8082:8080
89 |
90 | mysql-for-joomla:
91 | image: mysql:5.7.24
92 | hostname: mysql-for-joomla
93 | container_name: mysql-for-joomla
94 | env_file:
95 | - joomla.env
96 | volumes:
97 | - ./joomla/Website/database/:/docker-entrypoint-initdb.d
98 | - ./mysql/init.sh:/init.sh
99 | - ./logs/mysql/joomla:/var/log/mysql
100 | - mysql-for-joomla-log:/backup
101 | command: bash -c "/init.sh && exec /entrypoint.sh mysqld"
102 |
103 | joomla-sites:
104 | hostname: joomla-sites
105 | image: reactome/joomla
106 | build:
107 | context: ./joomla
108 | dockerfile: joomla.dockerfile
109 | container_name: joomla-sites
110 | links:
111 | - mysql-for-joomla
112 | depends_on:
113 | - mysql-for-joomla
114 | env_file:
115 | - joomla.env
116 | ports:
117 | - 80:80
118 | - 443:443
119 | entrypoint: bash -c "/wait-for.sh mysql-for-joomla:3306 -t 360 -- cp /etc/apache2/ssl/* /certs/ && /usr/local/bin/docker-php-entrypoint apache2-foreground"
120 | volumes:
121 | - ./wait-for.sh:/wait-for.sh
122 | - ./joomla/000-default-common.conf:/etc/apache2/sites-common/000-default-common.conf
123 | - ./joomla/000-default.conf:/etc/apache2/sites-enabled/000-default.conf
124 | - ./joomla/configuration.php:/var/www/html/configuration.php
125 | - ./certificates:/certs
126 | - ./joomla/Secrets.pm:/var/www/html/cgi-modules/GKB/Secrets.pm
127 | - ./joomla/cgi-modules/GKB/FrontPage3.pm:/var/www/html/cgi-modules/GKB/FrontPage3.pm
128 | - ./joomla/cgi-modules/GKB/Utils/InstructionLibrary.pm:/var/www/html/cgi-modules/GKB/Utils/InstructionLibrary.pm
129 | - ./joomla/cgi-modules/GKB/WebUtils.pm:/var/www/html/cgi-modules/GKB/WebUtils.pm
130 | - ./joomla/cgi-modules/GKB/Config.pm:/var/www/html/cgi-modules/GKB/Config.pm
131 | - ./joomla/cgi-modules/GKB/URLMaker.pm:/var/www/html/cgi-modules/GKB/URLMaker.pm
132 | - fireworks-dir:/var/www/html/download/current/fireworks
133 | - diagrams-dir:/var/www/html/download/current/diagram
134 |
135 | volumes:
136 | mysql-for-joomla-log:
137 | mysql-for-tomcat-log:
138 | fireworks-dir:
139 | diagrams-dir:
140 |
--------------------------------------------------------------------------------
/test_standalone_content_service.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | # Before running this test script, start the stand-alone ContentService:
4 | # docker run --rm -p 8080:8080 reactome/stand-alone-content-service:ReleaseXX (eg:Release74; if port is already allocated locally, try '1234:8080')
5 |
6 | # get path to shell-independent "time" command. Many shells define a "time" keyword which is not what we want here.
7 | PATH_TO_TIMECMD=$(which time)
8 |
9 | # Check values at local and remote ContentService
10 | function check_vals()
11 | {
12 | ENDPOINT=$1
13 | VAL_NAME=$2
14 |
15 | echo "Checking remote..."
16 | $PATH_TO_TIMECMD -f %E curl --output /tmp/REMOTEOUT -s "https://reactome.org/$ENDPOINT" && REMOTE_VAL=$(cat /tmp/REMOTEOUT)
17 | echo "checking local..."
18 | $PATH_TO_TIMECMD -f %E curl --output /tmp/LOCALOUT -s "http://localhost:8080/$ENDPOINT" && LOCAL_VAL=$(cat /tmp/LOCALOUT)
19 | # If values from the different servers don't match, output the diff to the console.
20 | if [ "$LOCAL_VAL" != "$REMOTE_VAL" ] ; then
21 | echo "$VAL_NAME don't match!"
22 | echo $LOCAL_VAL > /tmp/${VAL_NAME}_L
23 | echo $REMOTE_VAL > /tmp/${VAL_NAME}_R
24 | diff /tmp/LOCALOUT /tmp/REMOTEOUT
25 | else
26 | echo -e "$VAL_NAME test passed.\n"
27 | fi
28 | }
29 |
30 | echo -e "\nChecking names..."
31 | check_vals ContentService/data/database/name 'Name'
32 |
33 | echo -e "\nChecking versions..."
34 | check_vals ContentService/data/database/version 'Version'
35 |
36 | echo -e "\nChecking \"discover\"..."
37 | check_vals ContentService/data/discover/R-HSA-446203 'Discovery'
38 |
39 | echo -e "\nChecking \"discover\"..."
40 | check_vals ContentService/data/discover/R-HSA-446203 'Discovery'
41 |
42 | echo -e "\nChecking diseases..."
43 | check_vals ContentService/data/diseases 'Diseases'
44 |
45 | echo -e "\nChecking disease DOIDs..."
46 | check_vals ContentService/data/diseases/doid 'Disease DOIDs'
47 |
48 | echo -e "\nChecking complex (subunits)"
49 | check_vals ContentService/data/complex/R-HSA-5674003/subunits?excludeStructures=false 'Complex (subunits)'
50 |
51 | echo -e "\nChecking entity; componentOf"
52 | check_vals ContentService/data/entity/R-HSA-199420/componentOf 'Entity - componentOf'
53 |
54 | echo -e "\nChecking event hierarchy (Human)"
55 | check_vals ContentService/data/eventsHierarchy/9606 'Human event hierarchy'
56 |
57 | # PDF diffs cause problems
58 | # echo -e "\nChecking PDF export"
59 | # check_vals 'ContentService/exporter/document/event/R-HSA-177929.pdf?level%20%5B0%20-%201%5D=1&diagramProfile=Modern&resource=total&analysisProfile=Standard' "PDF_Export"
60 | # Checking images is also not always going to work because even if a raster image is off by a pixel or two, the diff will fail.
61 | # Even SVGs fail because I guess sometimes different XML elements are added to the file in a non-deterministic way, so that the rendered images are
62 | # the same but the sources are not identical.
63 | # ...let's just stick with comparing text (JSON) responses...
64 | # echo -e "\nChecking pathway image export"
65 | # check_vals 'ContentService/exporter/diagram/R-HSA-177929.svg?quality=5&flgInteractors=true&title=true&margin=15&ehld=true&diagramProfile=Modern&resource=total&analysisProfile=Standard' "SVG_Export"
66 | # It seems like for SBGN, the order of output elements might also be non-deterministic, so I guess only SBML is going to be easy to test...
67 |
68 | # ...never mind, it seems that the elements in SBML Exports might not be in the same sequence, and it looks like even some metadata might not be exactly the same. Comparing outputs could be very difficult.
69 | # Verify that they are produced but don't freak out if they don't match. OR, use some sort of SBML-specific tool (if it exists) to check for diffs.
70 | echo -e "\nChecking SBML export"
71 | check_vals 'ContentService/exporter/event/R-HSA-5205682.sbml' 'SBML_Export'
72 |
73 | echo -e "\nChecking interactors - psiquic summary"
74 | check_vals 'ContentService/interactors/psicquic/molecule/MINT/Q13501/summary' 'Interactors_psiquic_summary'
75 |
76 | echo -e "\nChecking interactors - list of psiquic resources"
77 | check_vals 'ContentService/interactors/psicquic/resources' 'Interactors_psiquic_resources'
78 |
79 | echo -e "\nChecking interactors - pathays with molecule"
80 | check_vals 'ContentService/interactors/static/molecule/Q9BXM7-1/pathways?species=Homo%20sapiens' 'Interactors_molecule_pathways'
81 |
82 | echo -e "\nChecking mapping to UniProt"
83 | check_vals 'ContentService/data/mapping/UniProt/PTEN/reactions' 'Maping_to_UniProt'
84 |
85 | echo -e "\nChecking Orthology"
86 | check_vals 'ContentService/data/orthology/R-HSA-6799198/species/49633' 'orthology'
87 |
88 | echo -e "\nChecking participants"
89 | check_vals 'ContentService/data/participants/5205685' 'participants'
90 |
91 | echo -e "\nChecking events contained in pathways"
92 | check_vals 'ContentService/data/pathway/R-HSA-5673001/containedEvents' 'events_contained_in_pathways'
93 |
94 | echo -e "\nCheck top level pathways in species"
95 | check_vals 'ContentService/data/pathways/top/Gallus%2Bgallus' 'top_level_pathways_for_species_ggallus'
96 |
97 | echo -e "\nCheck person endpoint - search by name"
98 | check_vals 'ContentService/data/people/name/Steve%20Jupe' 'lookup_steve_jupe'
99 |
100 | echo -e "\nCheck person endpoint - pathways authoured by Person"
101 | check_vals 'ContentService/data/person/391309/authoredPathways' 'authoured_pathways'
102 |
103 | echo -e "\nCheck enhanced query"
104 | check_vals 'ContentService/data/query/enhanced/R-HSA-60140' 'query'
105 |
106 | echo -e "\nCheck cross-references lookup"
107 | check_vals 'ContentService/references/mapping/15377' 'cross-references'
108 |
109 | echo -e "\nCheck number of entries for a schema type (Pathway)"
110 | check_vals 'ContentService/data/schema/Pathway/count' 'schema_count'
111 |
112 | echo -e "\nCheck Solr"
113 | check_vals 'ContentService/search/facet_query?query=TP53' 'solr_facet_search'
114 |
115 | echo -e "\nCheck species list"
116 | check_vals 'ContentService/data/species/all' 'species_list'
117 |
--------------------------------------------------------------------------------
/joomla/cgi-modules/GKB/Utils/InstructionLibrary.pm:
--------------------------------------------------------------------------------
1 | package GKB::Utils::InstructionLibrary;
2 |
3 | use strict;
4 | use vars qw(@ISA @EXPORT $XML_FORCEARRAY);
5 | use Exporter;
6 | use Carp;
7 | use GKB::Config;
8 | use XML::Simple;
9 | use Data::Dumper;
10 | use Carp;
11 | @ISA = qw(Exporter);
12 |
13 | $XML_FORCEARRAY = [qw(attributes reverse_attributes INSTRUCTION CLASS FOLLOWINGINSTRUCTION OUTPUTCLASS OUTPUTINSTRUCTION OUTPUTCONDITION)];
14 |
15 | @EXPORT = qw($XML_FORCEARRAY);
16 |
17 | sub get_instruction_id_and_desc_for_class {
18 | my ($cls) = @_;
19 | my $library = get_library_file();
20 | my @libraryresults;
21 | my $h = XMLin($library, ForceArray => $XML_FORCEARRAY);
22 | foreach my $elem (@{$h->{'INSTRUCTION'}}){
23 | foreach my $class (@{$elem->{CLASS}}){
24 | if($class eq $cls){
25 | push @libraryresults, [$elem->{'ID'}, $elem->{DESCRIPTION}];
26 |
27 | }
28 | }
29 | }
30 | return \@libraryresults;
31 | }
32 |
33 | sub get_instructions_for_class {
34 | my ($cls) = @_;
35 | my $library = get_library_file();
36 | my @out;
37 | my $h = XMLin($library, ForceArray => $XML_FORCEARRAY);
38 | foreach my $elem (@{$h->{'INSTRUCTION'}}){
39 | foreach my $class (@{$elem->{CLASS}}){
40 | if($class eq $cls){
41 | push @out, $elem;
42 | }
43 | }
44 | }
45 | return \@out;
46 | }
47 |
48 | sub get_instructions_for_classes {
49 | my (@clss) = @_;
50 | my %classes;
51 | map {$classes{$_}++} @clss;
52 | my $library = get_library_file();
53 | my @out;
54 | my $h = XMLin($library, ForceArray => $XML_FORCEARRAY);
55 | foreach my $elem (@{$h->{'INSTRUCTION'}}){
56 | foreach my $class (@{$elem->{CLASS}}){
57 | if($classes{$class}){
58 | push @out, $elem;
59 | }
60 | }
61 | }
62 | return \@out;
63 | }
64 |
65 | sub get_instruction_by_id {
66 | my $id = shift;
67 | my $library = get_library_file();
68 | my $h = XMLin($library, ForceArray => $XML_FORCEARRAY);
69 | foreach my $elem (@{$h->{'INSTRUCTION'}}){
70 | if ($elem->{'ID'} eq $id) {
71 | return $elem;
72 | }
73 | }
74 | return;
75 | }
76 |
77 | sub get_instruction_from_string {
78 | my $str = shift;
79 | my $h = XMLin($str, ForceArray => $XML_FORCEARRAY);
80 | return $h;
81 | }
82 |
83 | sub check_instruction {
84 | my $instruction = shift;
85 |
86 | if (!(defined $instruction)) {
87 | die("Undefined instruction\n");
88 | }
89 |
90 | # No instructions should not be a failure condition
91 | if (scalar(keys(%{$instruction}))==0) {
92 | return;
93 | }
94 |
95 | unless ($instruction->{'FOLLOWINGINSTRUCTION'} ||
96 | $instruction->{'OUTPUTCLASS'} ||
97 | $instruction->{'OUTPUTINSTRUCTION'} ||
98 | $instruction->{'OUTPUTCONDITION'}
99 | ) {
100 | die("Badly formed instruction:\n" . Dumper($instruction));
101 | }
102 | }
103 |
104 | sub get_library_file
105 | {
106 | # When Reactome runs in a container, *this* is the correct path to the instructionlibrary
107 | return '/var/www/html/cgi-modules/instructionlibrary.xml';
108 | }
109 |
110 | sub taboutputter_popup_form1 {
111 | my $i = shift;
112 | my $instructions = get_instructions_for_class($i->class);
113 | @{$instructions} || return '';
114 | my $form_name = 'taboutputter_form_' . $i->db_id;
115 | # This is a truely twisted way of doing things. The problem is that forms for some reason get a "newline"
116 | # inserted before and after them. Hence they won't be on the same line with teh preceding text, which is
117 | # what I want. Hence the trickery of using an "orphan" popup menu with invisible form followwing it.
118 | # Not nice. Should be replaced with js menu.
119 | my $out = qq(\n
\n\n);
125 | $out .=
126 | qq(
\n);
131 | return $out;
132 | }
133 |
134 | sub taboutputter_popup_form {
135 | my @a = @_;
136 | my %seen;
137 | map {$seen{$_->class}++} @a;
138 | my $instructions = get_instructions_for_classes(keys %seen);
139 | @{$instructions} || return '';
140 | my $form_name = 'taboutputter_form_' . $a[0]->db_id;
141 | # This is a truely twisted way of doing things. The problem is that forms for some reason get a "newline"
142 | # inserted before and after them. Hence they won't be on the same line with teh preceding text, which is
143 | # what I want. Hence the trickery of using an "orphan" popup menu with invisible form followwing it.
144 | # Not nice. Should be replaced with js menu.
145 | my $out = qq(\n
\n\n);
151 | $out .=
152 | qq(
\n);
159 | return $out;
160 | }
161 |
162 |
163 | 1;
164 |
--------------------------------------------------------------------------------
/pathway-browser/pathway-browser.dockerfile:
--------------------------------------------------------------------------------
1 | ARG RELEASE_VERSION=Release77
2 | FROM maven:3.6.3-jdk-8 AS builder
3 | ENV PATHWAY_BROWSER_VERSION=master
4 | RUN mkdir -p /gitroot && \
5 | mkdir -p /webapps
6 | WORKDIR /gitroot
7 | ENV ANALYSIS_SERVICE_VERSION=master
8 | ENV ANALYSIS_REPORT_VERSION=master
9 | ARG NEO4J_USER=neo4j
10 | ARG NEO4J_PASSWORD=neo4j-password
11 | ENV NEO4J_USER ${NEO4J_USER}
12 | ENV NEO4J_PASSWORD ${NEO4J_PASSWORD}
13 | ENV NEO4J_AUTH="${NEO4J_USER}/${NEO4J_PASSWORD}"
14 | ENV MVN_CMD="mvn --no-transfer-progress --global-settings /maven-settings.xml -Dmaven.repo.local=/mvn/alt-m2/ -DskipTests"
15 | COPY ./analysis-service-maven-settings.xml /maven-settings.xml
16 | # Now build the PathwayBrowser
17 | WORKDIR /gitroot
18 | ENV PATHWAY_BROWSER_VERSION=master
19 |
20 | # Build PathwayBrowser. Use sed to get rid of the "Downloads" tab.
21 | RUN git clone https://github.com/reactome-pwp/browser.git \
22 | && cd /gitroot/browser \
23 | && git checkout $PATHWAY_BROWSER_VERSION \
24 | && cd /gitroot/browser \
25 | && sed -i 's/\(DownloadsTab\.Display downloads = new\)/\/\/ \1/g' ./src/main/java/org/reactome/web/pwp/client/AppController.java \
26 | && sed -i 's/\(new DownloadsTabPresenter(this\.eventBus, downloads);\)/\/\/ \1/g' ./src/main/java/org/reactome/web/pwp/client/AppController.java \
27 | && sed -i 's/\(DETAILS_TABS\.add(downloads);\)/\/\/ \1/g' ./src/main/java/org/reactome/web/pwp/client/AppController.java \
28 | && sed -i 's/https:\/\/127.0.0.1/http:\/\/localhost:8080/g' ./src/main/java/org/reactome/web/pwp/client/tools/analysis/tissues/TissueDistribution.java \
29 | && sed -i 's/
.*<\/neo4j\.password>/'${NEO4J_PASSWORD}'<\/neo4j.password>/g' /maven-settings.xml \
30 | && $MVN_CMD gwt:import-sources compile package \
31 | && mv /gitroot/browser/target/PathwayBrowser*.war /webapps/PathwayBrowser.war
32 |
33 | # You will need to generate a Personal Access Token to access the Reacfoam repo. Save it in a file "github.token"
34 | # Make sure you give the token the permissions: repo (repo:status, repo_deployment, public_repo, repo:invite, security_events) and read:repo_hook
35 | # use "--build-arg GITHUB_TOKEN=$(cat github.token)" when you build this image.
36 | ARG GITHUB_TOKEN
37 | RUN cd /webapps && git clone https://${GITHUB_TOKEN}:x-oauth-basic@github.com/reactome-pwp/reacfoam.git && cd reacfoam && git checkout demo-version && rm -rf .git
38 |
39 | RUN git clone https://github.com/reactome/experiment-digester.git
40 |
41 | RUN cd /gitroot/experiment-digester \
42 | && $MVN_CMD -P Experiment-Digester-Local package -DskipTests \
43 | && ls -lht /gitroot/experiment-digester/target
44 |
45 | # Generate the experiments.bin file
46 | RUN cd /gitroot/experiment-digester && \
47 | java -jar target/digester-importer-jar-with-dependencies.jar \
48 | -o /experiments.bin \
49 | -e https://www.ebi.ac.uk/gxa/experiments-content/E-PROT-3/resources/ExperimentDownloadSupplier.Proteomics/tsv && \
50 | ls -lht /experiments.bin
51 |
52 | RUN cp /gitroot/experiment-digester/target/ExperimentDigester.war /webapps/
53 | RUN cp /experiments.bin /webapps/experiments.bin
54 |
55 | FROM reactome/analysis-core:${RELEASE_VERSION} AS analysiscorebuilder
56 | FROM reactome/stand-alone-analysis-service:${RELEASE_VERSION} AS analysisservice
57 | # Use content-service as the final base-layer because
58 | # it already contains Tomcat, ContentService, MySQL, Neo4j, Solr,
59 | # Fireworks, and Diagrams
60 | FROM reactome/stand-alone-content-service:${RELEASE_VERSION}
61 |
62 | ENV EXTENSION_SCRIPT=/data/neo4j-init.sh
63 | ENV NEO4J_EDITION=community
64 | ARG NEO4J_USER=neo4j
65 | ARG NEO4J_PASSWORD=neo4j-password
66 | ENV NEO4J_USER ${NEO4J_USER}
67 | ENV NEO4J_PASSWORD ${NEO4J_PASSWORD}
68 | ENV NEO4J_AUTH="${NEO4J_USER}/${NEO4J_PASSWORD}"
69 | EXPOSE 8080
70 |
71 | # Paths for content service
72 | RUN mkdir -p /usr/local/diagram/static && \
73 | mkdir -p /usr/local/diagram/exporter && \
74 | mkdir -p /var/www/html/download/current/ehld && \
75 | mkdir -p /usr/local/interactors/tuple
76 |
77 | COPY ./entrypoint.sh /entrypoint.sh
78 | RUN mkdir -p /usr/local/AnalysisService/analysis-results \
79 | && chmod a+x /entrypoint.sh
80 |
81 | RUN mkdir -p /usr/local/tomcat/webapps/download/current/
82 |
83 | COPY --from=analysiscorebuilder /output/analysis.bin /analysis.bin
84 | # Copy the web applications created in the builder stage.
85 | COPY --from=builder /webapps/ /usr/local/tomcat/webapps/
86 | COPY --from=builder /webapps/experiments.bin /experiments.bin
87 | COPY --from=analysisservice /usr/local/tomcat/webapps/AnalysisService.war /usr/local/tomcat/webapps/AnalysisService.war
88 | COPY ./wait-for.sh /wait-for.sh
89 |
90 | # Set up links to fireworks files for reacfoam
91 | RUN cd /usr/local/tomcat/webapps/reacfoam/resources/dataset/fireworks \
92 | && rm -rf * \
93 | && for f in $(ls /usr/local/tomcat/webapps/download/current/fireworks) ; do ln /usr/local/tomcat/webapps/download/current/fireworks/$f ./$f ; done
94 |
95 | # Files needed for the PathwayBrowser
96 | ADD https://reactome.org/download/current/ehlds.tgz /usr/local/tomcat/webapps/download/current/ehld.tgz
97 | RUN cd /usr/local/tomcat/webapps/download/current && tar -zxf ehld.tgz && rm ehld.tgz
98 | ADD https://reactome.org/download/current/ehld/svgsummary.txt /usr/local/tomcat/webapps/download/current/ehld/svgsummary.txt
99 | RUN chmod a+r /usr/local/tomcat/webapps/download/current/ehld/svgsummary.txt
100 | RUN chown -R www-data:www-data /usr/local/diagram/static/* && ln -s /usr/local/diagram/static /usr/local/tomcat/webapps/download/current/diagram && chown -R www-data:www-data /usr/local/tomcat/webapps/download/current/diagram
101 | # Allow symlinks for the JSON files in /usr/local/tomcat/webapps/download/current/diagram , othwerwise, certain PwB features may not work.
102 | RUN mkdir -p /usr/local/tomcat/webapps/download/META-INF/ && \
103 | echo "\n" > /usr/local/tomcat/webapps/download/META-INF/context.xml
104 | # load and set entrypoint
105 | CMD ["/entrypoint.sh"]
106 |
107 | # Run this as: docker run --name reactome-analysis-service -p 8080:8080 reactome/stand-alone-analysis-service:Release71
108 |
--------------------------------------------------------------------------------
/tomcat/tomcat.dockerfile:
--------------------------------------------------------------------------------
1 | # name a whole bunch of base layers that contain pre-built components (applications and content/data files)
2 | FROM reactome/reactomerestfulapi as restfulapi
3 | FROM reactome/analysisservice as analysisservice
4 | FROM reactome/contentservice as contentservice
5 | FROM reactome/datacontent as datacontent
6 | FROM reactome/pathwaybrowser as pathwaybrowser
7 | FROM reactome/diagramjs as diagramjs
8 | FROM reactome/fireworksjs as fireworksjs
9 | FROM reactome/analysis-core as analysiscore
10 | FROM reactome/fireworks-generator as fireworks
11 | FROM reactome/diagram-generator:latest as diagramfiles
12 | FROM reactome/experiments-digester as experimentsdigester
13 |
14 | # Final layer is Tomcat.
15 | FROM tomcat:8.5.35-jre8
16 | # Copy in all the components that we need.
17 | COPY --from=restfulapi /webapps/*.war /usr/local/tomcat/webapps/
18 | COPY --from=analysisservice /webapps/*.war /usr/local/tomcat/webapps/
19 | COPY --from=contentservice /webapps/*.war /usr/local/tomcat/webapps/
20 | COPY --from=datacontent /webapps/*.war /usr/local/tomcat/webapps/
21 | COPY --from=pathwaybrowser /webapps/*.war /usr/local/tomcat/webapps/
22 | COPY --from=diagramjs /webapps/*.war /usr/local/tomcat/webapps/
23 | COPY --from=fireworksjs /webapps/*.war /usr/local/tomcat/webapps/
24 | # Don't forget to copy non-WAR files: analysis.bin, diagram JSON files, and Fireworks JSON files.
25 | COPY --from=analysiscore /output/analysis.bin /analysis.bin
26 | COPY --from=fireworks /fireworks-json-files /usr/local/tomcat/webapps/download/current/fireworks
27 | COPY --from=diagramfiles /diagrams /usr/local/tomcat/webapps/download/current/diagram
28 | COPY --from=experimentsdigester /webapps/experiments.bin /experiments.bin
29 | COPY --from=experimentsdigester /webapps/*.war /usr/local/tomcat/webapps/
30 |
31 | # The DiagramJs and FireworksJs WAR files will have version numbers in their names, so
32 | # we'll just symlink them to the names that are needed.
33 | RUN ln -s /usr/local/tomcat/webapps/diagram*.war /usr/local/tomcat/webapps/DiagramJs.war \
34 | && ln -s /usr/local/tomcat/webapps/fireworks*.war /usr/local/tomcat/webapps/FireworksJs.war \
35 | && mkdir -p /usr/local/interactors/tuple && mkdir -p /var/www/html/download/current/
36 | # RUN ls -lht /usr/local/tomcat/webapps/
37 | # RUN mkdir -p /usr/local/interactors/tuple && mkdir -p /var/www/html/download/current/
38 | RUN apt-get update && apt-get install -y netcat zip && rm -rf /var/lib/apt/lists/*
39 |
40 | # WORKDIR /usr/local/tomcat/webapps/download/
41 | ADD https://reactome.org/download/current/ehlds.tgz /usr/local/tomcat/webapps/download/current/ehld.tgz
42 | RUN cd /usr/local/tomcat/webapps/download/current && tar -zxf ehld.tgz && rm ehld.tgz
43 | ADD https://reactome.org/download/current/ehld/svgsummary.txt /usr/local/tomcat/webapps/download/current/ehld/svgsummary.txt
44 | RUN chmod a+r /usr/local/tomcat/webapps/download/current/ehld/svgsummary.txt
45 | # RUN mkdir -p /var/www/html/ehld-icons
46 | # ADD https://reactome.org/ehld-icons/icon-lib-svg.tgz /var/www/html/ehld-icons/icon-lib-svg.tgz
47 | # RUN cd /var/www/html/ehld-icons/ && tar -zxf icon-lib-svg.tgz
48 | # ADD https://reactome.org/ehld-icons/icon-lib-emf.tgz /var/www/html/ehld-icons/icon-lib-emf.tgz
49 | # RUN cd /var/www/html/ehld-icons/ && tar -zxf icon-lib-emf.tgz
50 | # ADD https://reactome.org/ehld-icons/icon-lib-png.tgz /var/www/html/ehld-icons/icon-lib-png.tgz
51 | # RUN cd /var/www/html/ehld-icons/ && tar -zxf icon-lib-png.tgz
52 |
53 | # Now,update the properties files in the applications.
54 | WORKDIR /usr/local/tomcat/webapps/
55 |
56 | COPY ./properties/content-service.ogm.properties /usr/local/tomcat/webapps/WEB-INF/classes/ogm.properties
57 | # This looks a little weird, so here's what's happening. We want to update the WAR files with custom properties files. This is done inseveral steps:
58 | # 1) touch the properties file to ensure it has a newer timestamp than that of the corresponding properties file inside the zip file.
59 | # 2) zip -u - this will UPDATE the WAR file with the properties file on the same path.
60 | # 3) capture the output of this operation. if `zip -u` returns a return-code of 12, it means that zip didn't need to do anything. Sometimes this
61 | # is ok and it should NOT break the build. So if we get a 12, then exit this step with a '0'. Otherwise, return whatever other return code came back from zip.
62 | RUN { touch WEB-INF/classes/ogm.properties; zip -u ContentService.war WEB-INF/classes/ogm.properties; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
63 | COPY ./properties/content-service.service.properties /usr/local/tomcat/webapps/WEB-INF/classes/service.properties
64 | COPY ./properties/data-content.ogm.properties /usr/local/tomcat/webapps/WEB-INF/classes/ogm.properties
65 | COPY ./properties/data-content.service.properties /usr/local/tomcat/webapps/WEB-INF/classes/core.properties
66 | COPY ./properties/analysis-service.service.properties /usr/local/tomcat/webapps/WEB-INF/classes/analysis.properties
67 | COPY ./properties/RESTfulAPI_application-context.xml /usr/local/tomcat/webapps/WEB-INF/applicationContext.xml
68 |
69 | RUN { touch WEB-INF/classes/service.properties; zip -u ContentService.war WEB-INF/classes/service.properties; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
70 | RUN { touch WEB-INF/classes/ogm.properties; zip -u content.war WEB-INF/classes/ogm.properties; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
71 | RUN { touch WEB-INF/classes/core.properties; zip -u content.war WEB-INF/classes/core.properties; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
72 | RUN { touch WEB-INF/classes/analysis.properties; zip -u AnalysisService.war WEB-INF/classes/analysis.properties; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
73 |
74 | # For some reason, the ReactomeRESTfulAPI WAR sometimes makes zip complain about possible file errors, so run zip -F before trying to update the files inside it.
75 | RUN touch /usr/local/tomcat/webapps/WEB-INF/applicationContext.xml && \
76 | zip -F ReactomeRESTfulAPI.war --out ReactomeRESTfulAPI_fixed.war && mv ReactomeRESTfulAPI_fixed.war ReactomeRESTfulAPI.war
77 | RUN { zip -u ReactomeRESTfulAPI.war WEB-INF/applicationContext.xml; rc=$?; echo $rc; if [ $rc -eq 12 ]; then exit 0; fi; exit $rc; }
78 |
79 | RUN mkdir -p /ContentService/custom && mkdir -p /AnalysisService/tokens
80 |
--------------------------------------------------------------------------------
/all-services.jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline
2 | {
3 | agent any
4 | environment
5 | {
6 | // NOTE: this file must be executed in a directory whose name is a numeric sequence, and whose parent is named "Releases".
7 | // This is how other Jenkinsfiles in the Release process determine the current release number.
8 | RELEASE_VERSION = getReleaseVersionTag();
9 | }
10 |
11 | stages
12 | {
13 | // End of probably removable code
14 | stage('Download graphdb')
15 | {
16 | steps
17 | {
18 | dir("neo4j")
19 | {
20 | script
21 | {
22 | if (!fileExists('reactome-${env.RELEASE_VERSION}.graphdb.tgz'))
23 | {
24 | fileOperations([fileDownloadOperation(password: '', proxyHost: '', proxyPort: '', targetFileName: "reactome-${env.RELEASE_VERSION}.graphdb.tgz", targetLocation: './', url: 'https://reactome.org/download/current/reactome.graphdb.tgz', userName: '')])
25 | }
26 | sh "ls -lht"
27 | }
28 | }
29 | }
30 | }
31 | stage("Build graphdb")
32 | {
33 | steps
34 | {
35 | dir("neo4j")
36 | {
37 | script
38 | {
39 | sh "ls -lht"
40 | docker.build("reactome/graphdb:${env.RELEASE_VERSION} --build-arg GRAPHDB_LOCATION=reactome-${env.RELEASE_VERSION}.graphdb.tgz --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f ./neo4j_stand-alone.dockerfile")
41 | }
42 | }
43 | }
44 | }
45 | stage("analysis-core")
46 | {
47 | steps
48 | {
49 | dir("analysis-core")
50 | {
51 | script
52 | {
53 | docker.build("reactome/analysis-core:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f analysis-core.dockerfile")
54 | }
55 | }
56 | }
57 | }
58 | stage("fireworks-generator")
59 | {
60 | steps
61 | {
62 | dir("fireworks-generator")
63 | {
64 | script
65 | {
66 | docker.build("reactome/fireworks-generator:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f fireworks-generator.dockerfile")
67 | }
68 | }
69 | }
70 | }
71 | stage("mysql database and diagram files")
72 | {
73 | steps
74 | {
75 | dir("mysql")
76 | {
77 | script
78 | {
79 | docker.build("reactome/reactome-mysql:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f mysql.dockerfile")
80 | }
81 | }
82 | dir("diagram-generator")
83 | {
84 | script
85 | {
86 | docker.build("reactome/diagram-generator:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f diagram-generator.dockerfile")
87 | }
88 | }
89 | }
90 | }
91 | stage("solr-index")
92 | {
93 | steps
94 | {
95 | dir("solr")
96 | {
97 | script
98 | {
99 | docker.build("reactome/solr:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f index-builder.dockerfile")
100 | }
101 | }
102 | }
103 | }
104 | stage ("Build web applications")
105 | {
106 | parallel
107 | {
108 | stage("Analysis Service image")
109 | {
110 | steps
111 | {
112 | dir("stand-alone-analysis-service")
113 | {
114 | script
115 | {
116 | docker.build("reactome/stand-alone-analysis-service:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f analysis-service.dockerfile")
117 | }
118 | }
119 | }
120 | }
121 | stage("Content Service image")
122 | {
123 | steps
124 | {
125 | dir("stand-alone-content-service")
126 | {
127 | script
128 | {
129 | docker.build("reactome/stand-alone-content-service:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f content-service.dockerfile")
130 | }
131 | }
132 | }
133 | }
134 | }
135 | }
136 | stage("Pathway Browser image")
137 | {
138 | steps
139 | {
140 | dir("pathway-browser")
141 | {
142 | script
143 | {
144 | // Make sure you set up the github Personal Access Token before this step runs.
145 | // you can (re-)generate your github token in Github by going to Settings -> Developer Settings -> Personal Access Token
146 | docker.build("reactome/analysis-service-and-pwb:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} --build-arg GITHUB_TOKEN=${env.GITHUB_TOKEN} -f pathway-browser.dockerfile")
147 | }
148 | }
149 | }
150 | }
151 | }
152 | }
153 |
154 | // Gets release number from URL of job. The expectation, as mentioned above, is that the URL will have a format of 'Releases/XX', where XX is the release number.
155 | def getReleaseVersionTag()
156 | {
157 | return "Release" + (pwd() =~ /Releases\/(\d+)\//)[0][1];
158 | }
159 |
--------------------------------------------------------------------------------
/analysis-service.jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline
2 | {
3 | agent any
4 | environment
5 | {
6 | // NOTE: this file must be executed in a directory whose name is a numeric sequence, and whose parent is named "Releases".
7 | // This is how other Jenkinsfiles in the Release process determine the current release number.
8 | RELEASE_VERSION = getReleaseVersionTag();
9 | PERSONAL_ACCESS_TOKEN = credentials('PERSONAL_ACCESS_TOKEN')
10 | }
11 |
12 | stages
13 | {
14 | // End of probably removable code
15 | stage('Download graphdb')
16 | {
17 | steps
18 | {
19 | dir("neo4j")
20 | {
21 | script
22 | {
23 | if (!fileExists('reactome-${env.RELEASE_VERSION}.graphdb.tgz'))
24 | {
25 | fileOperations([fileDownloadOperation(password: '', proxyHost: '', proxyPort: '', targetFileName: "reactome-${env.RELEASE_VERSION}.graphdb.tgz", targetLocation: './', url: 'https://reactome.org/download/current/reactome.graphdb.tgz', userName: '')])
26 | }
27 | sh "ls -lht"
28 | }
29 | }
30 | }
31 | }
32 | stage("Build graphdb")
33 | {
34 | steps
35 | {
36 | dir("neo4j")
37 | {
38 | script
39 | {
40 | sh "ls -lht"
41 | docker.build("reactome/graphdb:${env.RELEASE_VERSION} --no-cache --build-arg GRAPHDB_LOCATION=reactome-${env.RELEASE_VERSION}.graphdb.tgz --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f ./neo4j_stand-alone.dockerfile")
42 | }
43 | }
44 | }
45 | }
46 | stage("analysis-core")
47 | {
48 | steps
49 | {
50 | dir("analysis-core")
51 | {
52 | script
53 | {
54 | docker.build("reactome/analysis-core:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f analysis-core.dockerfile")
55 | }
56 | }
57 | }
58 | }
59 | stage("fireworks-generator")
60 | {
61 | steps
62 | {
63 | dir("fireworks-generator")
64 | {
65 | script
66 | {
67 | docker.build("reactome/fireworks-generator:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f fireworks-generator.dockerfile")
68 | }
69 | }
70 | }
71 | }
72 | stage("mysql database and diagram files")
73 | {
74 | steps
75 | {
76 | dir("mysql")
77 | {
78 | script
79 | {
80 | docker.build("reactome/reactome-mysql:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f mysql.dockerfile")
81 | }
82 | }
83 | dir("diagram-generator")
84 | {
85 | script
86 | {
87 | docker.build("reactome/diagram-generator:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f diagram-generator.dockerfile")
88 | }
89 | }
90 | }
91 | }
92 | stage("solr-index")
93 | {
94 | steps
95 | {
96 | dir("solr")
97 | {
98 | script
99 | {
100 | docker.build("reactome/solr:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f index-builder.dockerfile")
101 | }
102 | }
103 | }
104 | }
105 | stage ("Build web applications")
106 | {
107 | parallel
108 | {
109 | stage("Analysis Service image")
110 | {
111 | steps
112 | {
113 | dir("stand-alone-analysis-service")
114 | {
115 | script
116 | {
117 | docker.build("reactome/stand-alone-analysis-service:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f analysis-service.dockerfile")
118 | }
119 | }
120 | }
121 | }
122 | stage("Content Service image")
123 | {
124 | steps
125 | {
126 | dir("stand-alone-content-service")
127 | {
128 | script
129 | {
130 | docker.build("reactome/stand-alone-content-service:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} -f content-service.dockerfile")
131 | }
132 | }
133 | }
134 | }
135 | }
136 | }
137 | stage("Pathway Browser image")
138 | {
139 | steps
140 | {
141 | dir("pathway-browser")
142 | {
143 | script
144 | {
145 | // Make sure you set up the github Personal Access Token as a Secret Text credential in Jenkins with ID 'PERSONAL_ACCESS_TOKEN' before this step runs.
146 | docker.build("reactome/analysis-service-and-pwb:${env.RELEASE_VERSION} --build-arg RELEASE_VERSION=${env.RELEASE_VERSION} --build-arg GITHUB_TOKEN=${env.PERSONAL_ACCESS_TOKEN} -f pathway-browser.dockerfile")
147 | }
148 | }
149 | }
150 | }
151 | }
152 | }
153 |
154 | // Gets release number from URL of job. The expectation, as mentioned above, is that the URL will have a format of 'Releases/XX', where XX is the release number.
155 | def getReleaseVersionTag()
156 | {
157 | return "Release" + (pwd() =~ /Releases\/(\d+)\//)[0][1];
158 | }
159 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Reactome Container
2 |
3 | ## Table of Contents
4 |
5 | - [Overview](#overview)
6 | - [docker-compose](#docker-compose)
7 | - [Stand-alone images](#Stand-alone-images)
8 | - [Scripts](#scripts)
9 | - [Jenkinsfiles](#jenkinsfiles)
10 |
11 | ## Overview
12 |
13 | [Reactome](http://reactome.org/) is a free, open-source, curated and peer reviewed pathway database. It is an online bioinformatics database of human biology described in molecular terms. It is an on-line encyclopedia of core human pathways. [Reactome Wiki](http://wiki.reactome.org/index.php/Main_Page) provides more details about reactome.
14 |
15 | There are two ways to use the contents of this repository. The first is to run a set of docker containers connected to each other with docker-compose. This is intended to replicate the Reactome production environment as closely as possible.
16 |
17 | The second way is to build and run a set of stand-alone containers that only provide a single, independent service.
18 |
19 | Be aware that building these images can be a resource-intensive process. You will want to ensure you have about 30 GB free to build the largest images. The final images are not that big, but docker will use up more disk space while its building. Some image-builds may also require > 10 GB of RAM while building (Note: these numbers are estimates, based on observations made while building on one specific machine - resource usage might be different with different OS/hardware configurations).
20 |
21 | ### docker-compose
22 |
23 | This option will create and run the following containers:
24 |
25 | - mysql-for-tomcat - This contains the Reactome's biological pathways, as a relational database.
26 | - mysql-for-joomla - THis contains Reactome's CMS (Joomla) content.
27 | - neo4j-db - This contains the Reactome's biological pathways, as a graph database.
28 | - solr - This contains Reactome's solr index.
29 | - tomcat - This contains Tomcat, and all of the Reactome web applications.
30 | - joomla-sites - This contains the Reactome CMS (Reactome uses Joomla).
31 |
32 | You can build these containers with a docker-compose command:
33 | ```bash
34 | $ docker-compose build
35 | ```
36 |
37 | You can run them with a run command (include the `-d` option if you want them to run in the background):
38 | ```bash
39 | $ docker-compose up
40 | ```
41 |
42 | **NOTE** At the time of writing (2021-07-08), the docker-compose setup is not actively used and some parts of it may be out-of-date.
43 |
44 | ### Stand-alone images
45 |
46 | This option will help you build a series of stand-alone images that contain just enough to run a single Reactome service. The images are:
47 |
48 | - graphdb - This will create a docker image that contains Neo4j and the Reactome graph database.
49 | - stand-alone-content-service - This will create a docker image that contains the ContentService web application, and any supporting components (Neo4j, MySQL, Tomcat, Solr)
50 | - stand-alone-analysis-service - This will create a docker image that contains the AnalysisService web application, and any supporting components (Neo4j, Tomcat)
51 | - analysis-service-and-pwb - This will create a docker image that contains the PathwayBrowser and AnalysisService web applications, and any supporting components (Neo4j, MySQL, Tomcat, Solr, ContentService)
52 |
53 | #### graphdb
54 | In the [neo4j](./neo4j) directory, there are two dockerfiles: `neo4j_generated_from_mysql.dockerfile` & `neo4j_stand-alone.dockerfile`. `neo4j_generated_from_mysql.dockerfile` will build the Reactome graphdb docker image from the MySQL database using the [graph-importer](https://github.com/reactome/graph-importer). `neo4j_stand-alone.dockerfile` will build the docker image by downloading a pre-existing graph database from the Reactome [download page](https://reactome.org/download-data).
55 |
56 | #### stand-alone-content-service
57 | In the [stand-alone-content-service](./stand-alone-content-service) directory, there is a docker file named `content-service.dockerfile` that can be used to build a docker image that contains the ContentService, and all supporting components.
58 |
59 | #### stand-alone-analysis-service
60 | In the [stand-alone-analysis-service](./stand-alone-analysis-service) directory, there is a docker file named `analysis-service.dockerfile`. This will let you build a docker image that contains the AnalysisService and all supporting components.
61 |
62 | #### analysis-service-and-pathwaybrowser
63 | In the [pathway-browser](./pathway-browser) directory, there is a dockerfile named `pathway-browser.dockerfile`. This file will let you build a docker image that contains the PathwayBrowser & the Analysis Service and all supporting components.
64 |
65 | ### Scripts
66 | There are a few convenience script to help build the stand-alone docker images.
67 |
68 | - build_all.sh
69 | - build_browser_and_analysisservice.sh
70 | - build_standalone_analysisservice.sh
71 | - build_standalone_content_service.sh
72 |
73 | #### build_all.sh
74 | This script builds all of the images needed to run the docker-compose setup. Be aware that the docker-compose setup is not actively used at the moment (2021-07-08) so this script might be out of date.
75 |
76 | #### build_browser_and_analysisservice.sh
77 | This script will build all of the images neede to build the final `stand-alone-analysis-service` image. It does not take any arguments. Be sure to update the value for `$RELEASE_VERSION` when you are running it for a new release.
78 |
79 | #### build_standalone_analysisservice.sh
80 | This script will build all of the images neede to build the final `stand-alone-analysis-service` image. It does not take any arguments. Be sure to update the value for `$RELEASE_VERSION` when you are running it for a new release.
81 |
82 | #### build_standalone_contentservice.sh
83 | This script will build all of the images neede to build the final `stand-alone-content-service` image. It does not take any arguments. Be sure to update the value for `$RELEASE_VERSION` when you are running it for a new release.
84 |
85 | ### Jenkinsfiles
86 | There are a few Jenkinsfiles that can be used to build the docker images from Jenkins.
87 |
88 | - all-services.jenkinsfile - This file will build docker images for `stand-alone-analysis-service`, `stand-alone-analysis-service`, `stand-alone-analysis-service`, and `graphdb`.
89 | - analysis-service.jenkinsfile - This file will build docker images for `stand-alone-analysis-service`. NOTE: `all-services.jenkinsfile` is what's currently used in the Jenkins setup, so `stand-alone-analysis-service` might not be up to date.
90 | - content-service.jenkinsfile - This file will build docker images for `stand-alone-content-service`. NOTE: `all-services.jenkinsfile` is what's currently used in the Jenkins setup, so `stand-alone-content-service` might not be up to date.
91 |
--------------------------------------------------------------------------------
/stand-alone-content-service/content-service.dockerfile:
--------------------------------------------------------------------------------
1 | ARG RELEASE_VERSION=Release77
2 | FROM maven:3.6.3-jdk-8 AS builder
3 |
4 | RUN mkdir -p /gitroot
5 | WORKDIR /gitroot
6 | LABEL maintainer="solomon.shorser@oicr.on.ca"
7 |
8 | # Build the ContentService application
9 | ENV CONTENT_SERVICE_VERSION=master
10 |
11 | # Build the content service
12 | COPY ./content-service-maven-settings.xml /mvn-settings.xml
13 | ARG NEO4J_USER=neo4j
14 | ARG NEO4J_PASSWORD=neo4j-password
15 | ENV NEO4J_USER ${NEO4J_USER}
16 | ENV NEO4J_PASSWORD ${NEO4J_PASSWORD}
17 | ENV NEO4J_AUTH="${NEO4J_USER}/${NEO4J_PASSWORD}"
18 | ENV MVN_CMD "mvn -DskipTests --no-transfer-progress --global-settings /mvn-settings.xml"
19 | RUN cd /gitroot/ && git clone https://github.com/reactome/content-service.git && \
20 | cd /gitroot/content-service && \
21 | git checkout $CONTENT_SERVICE_VERSION && \
22 | cd /gitroot/content-service/src/main/resources && \
23 | # Set logging levels to WARN - otherwise there is a lot of noise on the console.
24 | echo "log4j.logger.httpclient.wire.header=WARN" >> log4j.properties && echo "log4j.logger.httpclient.wire.content=WARN" >> log4j.properties && echo "log4j.logger.org.apache.commons.httpclient=WARN" >> log4j.properties && \
25 | sed -i -e 's/<\/configuration>/<\/configuration>/g' logback.xml && \
26 | # an empty header/footer is probably OK. The files just need to be present.
27 | cd /gitroot/content-service/src/main/webapp/WEB-INF/pages/ && touch header.jsp && touch footer.jsp && \
28 | mkdir /webapps && \
29 | sed -i -e 's/.*<\/neo4j\.password>/${NEO4J_PASSWORD}<\/neo4j\.password>/g' /mvn-settings.xml && \
30 | sed -i -e 's/.*<\/neo4j\.user>/${NEO4J_USER}<\/neo4j\.user>/g' /mvn-settings.xml && \
31 | # Build the applications
32 | cd /gitroot/content-service && ${MVN_CMD} package -P ContentService-Local && \
33 | cp /gitroot/content-service/target/ContentService*.war /webapps/ContentService.war && rm -rf ~/.m2
34 |
35 | # Get graph database from existing image.
36 | FROM reactome/graphdb:${RELEASE_VERSION} AS graphdb
37 | # Get solr index
38 | FROM reactome/solr:${RELEASE_VERSION} as solr
39 | # Get diagram files.
40 | FROM reactome/diagram-generator:${RELEASE_VERSION} as diagrams
41 | # Get Fireworks files
42 | FROM reactome/fireworks-generator:${RELEASE_VERSION} as fireworks
43 | # Need relational database for SBML export
44 | FROM reactome/reactome-mysql:${RELEASE_VERSION} as relationaldb
45 | # Final re-base will be Tomcat
46 | FROM tomcat:8.5.35-jre8
47 |
48 | ENV EXTENSION_SCRIPT=/data/neo4j-init.sh
49 | ENV NEO4J_EDITION=community
50 | # We'll need a neo4j and solr user
51 | RUN useradd neo4j
52 | RUN useradd solr
53 |
54 | EXPOSE 8080
55 |
56 | # Paths for content service
57 | RUN mkdir -p /usr/local/diagram/static && \
58 | mkdir -p /usr/local/diagram/exporter && \
59 | mkdir -p /var/www/html/download/current/ehld && \
60 | mkdir -p /usr/local/interactors/tuple && \
61 | apt-get update && apt-get install lsb-release -y && \
62 | apt-get install netcat gosu procps mlocate -y && \
63 | apt-get autoremove && ln -s $(which gosu) /bin/su-exec
64 |
65 | RUN wget --progress=bar:force https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.33-1ubuntu18.04_amd64.deb-bundle.tar && \
66 | apt-get update && apt-get install libaio1 libc6 libmecab2 libnuma1 perl -y && \
67 | # MySQL requires newer version of libc6 than what is already in this docker image
68 | tar -xf mysql-server_5.7.33-1ubuntu18.04_amd64.deb-bundle.tar && ls -lht *.deb && \
69 | wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc6_2.27-3ubuntu1_amd64.deb && \
70 | dpkg -i libc6_2.27-3ubuntu1_amd64.deb && \
71 | # OBVIOUSLY don't expose this container to the outside world! Or change the password here *AND* in the application config.
72 | echo 'mysql-community-server-5.7.33 mysql-community-server/root_password password root' | debconf-set-selections && \
73 | echo 'mysql-community-server mysql-community-server/root_password password root' | debconf-set-selections && \
74 | dpkg -i mysql-common_5.7.33-1ubuntu18.04_amd64.deb && \
75 | dpkg -i mysql-community-client_5.7.33-1ubuntu18.04_amd64.deb && \
76 | dpkg -i mysql-client_5.7.33-1ubuntu18.04_amd64.deb && \
77 | dpkg -i mysql-community-server_5.7.33-1ubuntu18.04_amd64.deb && \
78 | rm -rf *.deb mysql-server_5.7.33-1ubuntu18.04_amd64.deb-bundle.tar
79 |
80 | # OR maybe just install MySQL from https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.34-linux-glibc2.12-i686.tar.gz
81 | # load and set entrypoint
82 | COPY ./wait-for.sh /wait-for.sh
83 | COPY ./entrypoint.sh /content-service-entrypoint.sh
84 | ARG NEO4J_USER=neo4j
85 | ARG NEO4J_PASSWORD=neo4j-password
86 | ENV NEO4J_USER ${NEO4J_USER}
87 | ENV NEO4J_PASSWORD ${NEO4J_PASSWORD}
88 | ENV NEO4J_AUTH="${NEO4J_USER}/${NEO4J_PASSWORD}"
89 |
90 | # Copy the web applications created in the builder stage.
91 | COPY --from=builder /webapps/ /usr/local/tomcat/webapps/
92 | # Copy the MySQL database
93 | COPY --from=relationaldb /data/mysql /var/lib/mysql
94 | # Copy graph database
95 | COPY --from=graphdb /var/lib/neo4j /var/lib/neo4j
96 | COPY --from=graphdb /var/lib/neo4j/logs /var/lib/neo4j/logs
97 | COPY --from=graphdb /logs /var/lib/neo4j/logs
98 | COPY --from=graphdb /var/lib/neo4j/bin/neo4j-admin /var/lib/neo4j/bin/neo4j-admin
99 | COPY --from=graphdb /data/neo4j-init.sh /data/neo4j-init.sh
100 | COPY --from=graphdb /var/lib/neo4j/conf/neo4j.conf /var/lib/neo4j/conf/neo4j.conf
101 | COPY --from=graphdb /docker-entrypoint.sh /neo4j-entrypoint.sh
102 | COPY --from=graphdb /data /var/lib/neo4j/data
103 | COPY --from=solr /opt/docker-solr /opt/docker-solr
104 | COPY --from=solr /opt/mysolrhome /opt/mysolrhome
105 | COPY --from=solr /opt/solr /opt/solr
106 | COPY --from=solr /custom-solr-conf /custom-solr-conf
107 | COPY --from=solr /docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
108 | COPY --from=diagrams /diagrams /usr/local/diagram/static
109 | COPY --from=fireworks /fireworks-json-files /usr/local/tomcat/webapps/download/current/fireworks
110 | RUN chmod a+x /content-service-entrypoint.sh
111 | CMD ["/content-service-entrypoint.sh"]
112 |
113 | # Run this as: docker run --name reactome-content-service -p 8888:8080 reactome/stand-alone-content-service:R71
114 | # Access in you browser: http://localhost:8888/ContentService - this will let you see the various services.
115 | # To use from the command-line:
116 | # curl -X GET "http://localhost:8888/ContentService/data/complex/R-HSA-5674003/subunits?excludeStructures=false" -H "accept: application/json"
117 | # For exporter endpoints the return PDF files or images, be sure to use "--output FILE" with curl. For example:
118 | # curl --output R-HSA-177929_event.PDF -X GET "http://localhost:8888/ContentService/exporter/document/event/R-HSA-177929.pdf?level%20%5B0%20-%201%5D=1&diagramProfile=Modern&resource=total&analysisProfile=Standard" -H "accept: application/pdf"
119 |
--------------------------------------------------------------------------------
/stand-alone-content-service/content-service-maven-settings.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | ContentService-Local
8 |
9 |
10 | localhost
11 | 7474
12 | neo4j
13 | neo4j-password
14 |
15 | http://localhost:8983/solr/
16 | solr
17 | solr
18 | reactome
19 |
20 | /interactors.db
21 |
22 | /usr/local/search/log/content-service
23 | ${logging.dir}/search.db
24 | WARN
25 |
26 |
27 | localhost
28 | 8081
29 | username
30 | password
31 | false
32 | helpdesk@mycompany.co.uk
33 | helpdesk@mycompany.co.uk
34 | helpdesk@mycompany.co.uk
35 |
36 | https://joomla-sites/
37 |
38 | /usr/local/interactors/tuple
39 |
45 | 0 */59 * * * *
46 |
47 | /usr/local/diagram/static
48 | /usr/local/diagram/exporter
49 |
50 | false
51 | /var/www/html/download/current/ehld
52 | /var/www/html/download/current/ehld/svgsummary.txt
53 | https://localhost/
54 | false
55 | /usr/local/tomcat/webapps/download/current/fireworks
56 | report_user
57 | report_user
58 |
59 | localhost
60 | 3306
61 | root
62 | root
63 | current
64 |
65 |
66 |
67 |
68 | central
69 | Maven Repository Switchboard
70 | default
71 | https://repo1.maven.org/maven2
72 |
73 | false
74 |
75 |
76 |
77 | central-bck
78 | Maven Repository Switchboard
79 | default
80 | https://repo1.maven.org/maven/
81 |
82 | false
83 |
84 |
85 |
86 |
87 | nexus-ebi-repo
88 | The EBI internal repository
89 | http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/
90 |
91 | true
92 |
93 |
94 | false
95 |
96 |
97 |
98 |
99 | nexus-ebi-snapshot-repo
100 | The EBI internal snapshot repository
101 | http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-snapshots/
102 |
103 | false
104 |
105 |
106 | true
107 |
108 |
109 |
110 | com.springsource.repository.bundles.release
111 | EBR Spring Release Repository
112 | http://repository.springsource.com/maven/bundles/release
113 |
114 |
115 | com.springsource.repository.bundles.external
116 | EBR External Release Repository
117 | http://repository.springsource.com/maven/bundles/external
118 |
119 |
120 | JBoss 3rd party
121 | JBoss 3rd party
122 | https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/
123 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------