Skip to content

Commit

Permalink
Merge branch 'release/1.13.5' into feature/archive
Browse files Browse the repository at this point in the history
# Conflicts:
#	app_api_template.coffee
#	app_template.coffee
#	modules/CmpdReg/src/server/routes/CmpdRegRoutes.coffee
#	modules/CmpdRegBulkLoader/src/server/routes/CmpdRegBulkLoaderRoutes.coffee
#	package.json
  • Loading branch information
brianbolt committed Dec 6, 2020
2 parents 7f9ce9a + 6662c78 commit a948afd
Show file tree
Hide file tree
Showing 250 changed files with 24,201 additions and 6,484 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ACAS_TAG=latest
ACAS_TAG=latest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ Dockerfile*
docker-compose*.yml
build
licenses
venv
#this is for the soft link in .dockerfile (git ignore .git by default)
.git
chemaxon
42 changes: 29 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
FROM centos:centos6
FROM centos:centos8
# Update
RUN \
yum update -y && \
yum upgrade -y && \
dnf update -y && \
dnf upgrade -y && \
# tar for pulling down node
# git required for some npm packages
yum install -y tar git && \
yum clean all
dnf install -y tar git && \
dnf install -y fontconfig urw-fonts && \
dnf clean all

# node
RUN set -ex \
&& for key in \
9554F04D7259F04124DE6B476D5A82AC7E37093B \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
56730D5401028683275BD23C23EFEFE93C4CFFFE \
77984A986EBC2AA786BC0F66B01FBB92821C587A \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
; do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "$key" || \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 "$key" || \
gpg --keyserver pgp.mit.edu "$key"; \
done

ENV NPM_CONFIG_LOGLEVEL warn
Expand All @@ -42,14 +49,14 @@ ENV ACAS_BASE /home/runner/acas
ENV ACAS_CUSTOM /home/runner/acas_custom
ENV ACAS_SHARED /home/runner/acas_shared
ENV APACHE Redhat
RUN npm install -g gulpjs/gulp.git#4.0 forever nodemon mocha coffee-script
RUN npm install -g gulp@4.0.0 forever nodemon mocha coffeescript
COPY package.json $ACAS_BASE/package.json
RUN chown -R runner:runner $ACAS_BASE
USER runner
WORKDIR $ACAS_BASE
# This installs the modules but not acas, doing this makes subsequent builds much faster so that the container isn't invalidated on a small code change
RUN npm install --ignore-scripts --loglevel warn
COPY . $ACAS_BASE
COPY --chown=runner:runner . $ACAS_BASE
USER root
RUN chown -R runner:runner $ACAS_BASE
USER runner
Expand All @@ -66,8 +73,17 @@ ENV PREPARE_MODULE_CONF_JSON=true
ENV PREPARE_CONFIG_FILES=true
ENV RUN_SYSTEM_TEST=true
ENV ACAS_HOME=$BUILD_PATH
RUN gulp execute:prepare_config_files

EXPOSE 3000
EXPOSE 3001
#Install python dependencies
USER root
RUN dnf install -y python36 python3-pip
RUN alternatives --set python /usr/bin/python3
RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN pip install argparse requests psycopg2-binary
RUN dnf install -y initscripts

USER runner

EXPOSE 3000
CMD ["/bin/sh","bin/acas.sh", "run"]
2 changes: 1 addition & 1 deletion Dockerfile-rservices
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcneilco/racas-oss:${ACAS_TAG}
FROM mcneilco/racas-oss:develop

# RSTUDIO INSTALL
USER root
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cd acas-cmpdreg-roo-server
* Login and/or Sign-Up
* Click Download > JChem Suite > JChem
* Scroll down to Archives and select 16.4.25.0, click Get Archive
* Download jchem-merged-lib-16.4.25.0.zip
* Download [jchem-merged-lib-16.4.25.0.zip](https://chemaxon.com/download?dl=%2Fdata%2Fdownload%2Fjchem%2F16.4.25.0%2Fjchem-merged-lib-16.4.25.0.zip)
* Unzip it and rename jchem.jar to jchem-16.4.25.0.jar

##### Add chemaxon jar file to a lib folder in the checkout
Expand Down Expand Up @@ -157,17 +157,31 @@ docker-compose up -d
```

#### Login

Visit `http://localhost:3000` in your browser to login. You will need to create a user in order to access the web app:

```bash
curl localhost:3001/api/systemTest/getOrCreateACASBob
curl localhost:3001/api/systemTest/getOrCreateGlobalProject
curl localhost:3001/api/systemTest/getOrCreateGlobalProjectRole
curl localhost:3001/api/systemTest/giveBobRoles
curl localhost:3001/api/systemTest/getOrCreateCmpdRegBob
curl localhost:3001/api/systemTest/syncRoles
```
http://localhost:3000
```
Optionally you could run the shell script `docker_bob_setup.sh` in this repository instead of manually `curl`ing each endpoint.

This will create a user "bob" with password "secret".

#### Viewing logs

```
docker-compose logs --tail=20 -f <service>
```

e.g. for all containers

```
docker-compose logs --tail=20 -f
docker-compose logs -f
```

e.g. for only tomcat
Expand All @@ -176,6 +190,12 @@ e.g. for only tomcat
docker-compose logs --tail=20 -f tomcat
```

Stop the web stack

```bash
docker-compose down
```

#### Troubleshooting

* There is a known timing issue where tomcat may try to connect to the database before the database is accepting connections. If this happens, try restarting tomcat.
Expand Down
3 changes: 3 additions & 0 deletions app_api_template.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ startApp = ->

http.createServer(app).listen(app.get('port'), ->
console.log("ACAS API server listening on port " + app.get('port'))
bootstrap = require "./src/javascripts/ServerAPI/Bootstrap.js"
if bootstrap.main?
bootstrap.main()
)

csUtilities.logUsage("ACAS API server started", "started", "")
Expand Down
4 changes: 2 additions & 2 deletions app_template.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ startApp = ->
# index routes
indexRoutes = require './routes/index.js'
indexRoutes.setupRoutes(app, loginRoutes)
###TO_BE_REPLACED_BY_PREPAREMODULEINCLUDES###


if not config.all.client.use.ssl
http.createServer(app).listen(app.get('port'), ->
Expand Down Expand Up @@ -150,7 +150,7 @@ startApp = ->
csUtilities.logUsage("ACAS Node server started", "started", "")

if config.all.server.systemTest?.runOnStart? && config.all.server.systemTest.runOnStart
systemTest.runSystemTestInternal false, (status, output) ->
systemTest.runSystemTestInternal true, [], (status, output) ->
console.log "system test completed"

startApp()
25 changes: 17 additions & 8 deletions bin/acas.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: acas
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop the acas app.js, server.js and apache instance
# Description: start and stop the acas app.js, server.js and apache instance
### END INIT INFO
# chkconfig: 2345 64 02
# description: start and stop the acas app.js, server.js and apache instance
# processname: acas
Expand Down Expand Up @@ -98,7 +107,7 @@ export LANG
running() {
runningCommand="export FOREVER_ROOT=$ACAS_HOME/bin && forever list 2>/dev/null | grep $ACAS_HOME/app.js 2>&1 >/dev/null"
if [ $(whoami) != "$ACAS_USER" ]; then
runningCommand="su - $ACAS_USER $suAdd -c \"($runningCommand)\""
runningCommand="su -p - $ACAS_USER $suAdd -c \"($runningCommand)\""
fi
eval $runningCommand
return $?
Expand All @@ -107,7 +116,7 @@ running() {
start_server() {
startCommand="export FOREVER_ROOT=$ACAS_HOME/bin && forever start --killSignal=SIGTERM --workingDir --append -l $logname -o $logout -e $logerr $ACAS_HOME/app.js 2>&1 >/dev/null"
if [ $(whoami) != "$ACAS_USER" ]; then
startCommand="su - $ACAS_USER $suAdd -c \"(cd `dirname $ACAS_HOME/app.js` && $startCommand)\""
startCommand="su -p - $ACAS_USER $suAdd -c \"(cd `dirname $ACAS_HOME/app.js` && $startCommand)\""
fi
eval $startCommand
return $?
Expand All @@ -121,7 +130,7 @@ run_server() {
fi
echo "runCommand: $runCommand"
if [ $(whoami) != "$ACAS_USER" ]; then
startCommand="su - $ACAS_USER $suAdd -c \"(cd `dirname $ACAS_HOME/app.js` && $startCommand)\""
startCommand="su -p - $ACAS_USER $suAdd -c \"(cd `dirname $ACAS_HOME/app.js` && $startCommand)\""
fi
eval "($runCommand)" &
return $?
Expand All @@ -130,7 +139,7 @@ run_server() {
stop_server() {
stopCommand="export FOREVER_ROOT=$ACAS_HOME/bin && forever stop $ACAS_HOME/app.js 2>&1 >/dev/null"
if [ $(whoami) != "$ACAS_USER" ]; then
stopCommand="su - $ACAS_USER $suAdd -c \"($stopCommand)\""
stopCommand="su -p - $ACAS_USER $suAdd -c \"($stopCommand)\""
fi
eval $stopCommand

Expand All @@ -147,7 +156,7 @@ start_apache() {
remove_apache_pid
startCommand=" $apacheCMD -f $ACAS_HOME/conf/compiled/apache.conf -k start 2>&1 >/dev/null"
if [ $(whoami) != "$RAPACHE_START_ACAS_USER" ]; then
startCommand="su - $RAPACHE_START_ACAS_USER $suAdd -c \"($startCommand)\""
startCommand="su -p - $RAPACHE_START_ACAS_USER $suAdd -c \"($startCommand)\""
fi
eval $startCommand
return $?
Expand All @@ -158,7 +167,7 @@ run_apache() {
sed -i 's/^ErrorLog.*/ErrorLog "|cat"/' /tmp/apache.conf
startCommand=" $apacheCMD -f /tmp/apache.conf -k start -DFOREGROUND"
if [ $(whoami) != "$RAPACHE_START_ACAS_USER" ]; then
startCommand="su - $RAPACHE_START_ACAS_USER $suAdd -c \"($startCommand)\""
startCommand="su -p - $RAPACHE_START_ACAS_USER $suAdd -c \"($startCommand)\""
fi
eval "($startCommand) $1"
return $?
Expand All @@ -167,7 +176,7 @@ run_apache() {
stop_apache() {
stopCommand="$apacheCMD -f $ACAS_HOME/conf/compiled/apache.conf -k stop 2>&1 >/dev/null"
if [ $(whoami) != "$RAPACHE_START_ACAS_USER" ]; then
stopCommand="su - $RAPACHE_START_ACAS_USER $suAdd -c \"($stopCommand)\""
stopCommand="su -p - $RAPACHE_START_ACAS_USER $suAdd -c \"($stopCommand)\""
fi
eval $stopCommand
return $?
Expand All @@ -176,7 +185,7 @@ stop_apache() {
apache_reload() {
reloadCommand="$apacheCMD -f $ACAS_HOME/conf/compiled/apache.conf -k graceful 2>&1 >/dev/null"
if [ $(whoami) != "$RAPACHE_START_ACAS_USER" ]; then
reloadCommand="su - $RAPACHE_START_ACAS_USER $suAdd -c \"($reloadCommand)\""
reloadCommand="su -p - $RAPACHE_START_ACAS_USER $suAdd -c \"($reloadCommand)\""
fi
eval $reloadCommand
return $?
Expand Down
3 changes: 2 additions & 1 deletion bin/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Example:
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
if [ -e "/opt/rh/rh-python36/enable" ]; then source /opt/rh/rh-python36/enable; fi;
65 changes: 47 additions & 18 deletions conf/ConfiguredEntityTypes.coffee
Original file line number Diff line number Diff line change
@@ -1,76 +1,105 @@
exports.entityTypes =
'Corporate Parent ID':
exports.entityTypes = [
code: 'Corporate Parent ID'
type: 'compound'
kind: 'parent name'
codeOrigin: 'ACAS CmpdReg'
displayName: 'Corporate Parent ID'
sourceExternal: true
parent: true

'Corporate Batch ID':
isTestedEntity: false
,
code: 'Corporate Batch ID'
type: 'compound'
kind: 'batch name'
codeOrigin: 'ACAS CmpdReg'
displayName: 'Corporate Batch ID'
sourceExternal: true
parent: false

'Protein Parent':
isTestedEntity: true
,
code: 'Protein Parent'
type: 'parent'
kind: 'protein'
codeOrigin: 'ACAS LsThing'
displayName: 'Protein Parent'
sourceExternal: false
parent: true

'Protein Batch':
isTestedEntity: false
,
code: 'Protein Batch'
type: 'batch'
kind: 'protein'
codeOrigin: 'ACAS LsThing'
displayName: 'Protein Batch'
sourceExternal: false
parent: false

'Gene ID':
isTestedEntity: false
,
code: 'Gene ID'
type: 'gene'
kind: 'entrez gene'
codeOrigin: 'ACAS LsThing'
displayName: 'Gene ID'
sourceExternal: false
parent: false

'Container Plate':
isTestedEntity: false
,
code: 'Container Plate'
type: 'container'
kind: 'plate'
codeOrigin: 'ACAS LsContainer'
displayName: 'Plate'
sourceExternal: false
parent: false
model: require("../routes/ServerUtilityFunctions.js").ContainerPlate

'Container Tube':
isTestedEntity: false
,
code: 'Container Tube'
type: 'container'
kind: 'tube'
codeOrigin: 'ACAS LsContainer'
displayName: 'Tube'
sourceExternal: false
parent: false
model: require("../routes/ServerUtilityFunctions.js").ContainerTube

'Definition Container Plate':
isTestedEntity: false
,
code: 'Definition Container Plate'
type: 'definition container'
kind: 'plate'
codeOrigin: 'ACAS LsContainer'
displayName: 'Definition Plate'
sourceExternal: false
parent: false
model: require("../routes/ServerUtilityFunctions.js").DefinitionContainerPlate

'Definition Container Tube':
isTestedEntity: false
,
code: 'Definition Container Tube'
type: 'definition container'
kind: 'tube'
codeOrigin: 'ACAS LsContainer'
displayName: 'Definition Tube'
sourceExternal: false
parent: false
model: require("../routes/ServerUtilityFunctions.js").DefinitionContainerTube
isTestedEntity: false
,
code: 'Solution Container Tube'
type: 'container'
kind: 'tube'
codeOrigin: 'ACAS LsContainer'
displayName: 'Solution Aliquot'
sourceExternal: false
parent: false
isTestedEntity: false
,
code: 'Location Container'
type: 'location'
kind: 'default'
codeOrigin: 'ACAS LsContainer'
displayName: 'Location'
sourceExternal: false
parent: false
model: require("../routes/ServerUtilityFunctions.js").LocationContainer
isTestedEntity: false
]
Loading

0 comments on commit a948afd

Please sign in to comment.