Skip to content

Commit

Permalink
Add docker builds for importer and webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
mriffle committed Nov 8, 2021
1 parent 2472a4a commit c1ebc09
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docker/importer/BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## How to build the importer docker image

1. Build Limelight

```
# go to root directory of this repo
cd ../..
# use docker to build the project
sudo docker run --rm -it --user $(id -u):$(id -g) -v `pwd`:`pwd` -w `pwd` --env HOME=. --entrypoint ant mriffle/build-limelight -f ant__build_all_limelight.xml
```

See https://github.com/yeastrc/limelight-build-docker for more information.

2. Copy importer executable jars into this directory

```
cd docker/importer
cp ../../deploy/limelightImporter_XMLFile_ScanFiles.jar ./
cp ../../deploy/limelightRunImporter.jar ./
```

3. Build the Docker image

```
sudo docker image build -t mriffle/limelight-importer ./
```

Tag as desired.
8 changes: 8 additions & 0 deletions docker/importer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM amazoncorretto:11-alpine-jdk

COPY db_config_file.properties /usr/local/bin/
COPY run_importer_config_file.properties /usr/local/bin/
COPY importProxlXML.jar /usr/local/bin/
COPY runImportProxlXML.jar /usr/local/bin/

ENTRYPOINT ["java", "-jar", "/usr/local/bin/runImportProxlXML.jar", "-c", "/usr/local/bin/run_importer_config_file.properties"]
47 changes: 47 additions & 0 deletions docker/importer/db_config_file.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# db_config_file.properties

# Sample config file.

# Copy this file to the folder 'config_dir__do_not_check_contents_into_git'
# and configure it.

# Then build this Proxl Importer Jar

#username=
#password=
#dbHost=
#dbPort=


# override database names if changed from defaults

proxl.db.name=proxl

# nrseq.db.name=



###################

## Non-DB Configuration.

## !!! These Only read if the config file location is passed in on the command line, not embedded in the JAR.

###########

# Send Scan File location to Spectral Storage Service rather than the file contents

# spectral.storage.send.scan.file.location=

spectral.storage.send.scan.file.location=true

###

# Only send if scan file path start with this string.
# (Set to match configuration in spectral storage accept value of: submitted.scan.file.path.restrictions=)

spectral.storage.send.scan.file.location.if.path.starts.with=/data/proxl_upload/

###########

53 changes: 53 additions & 0 deletions docker/importer/run_importer_config_file.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# run_importer_config_file.properties

# Sample config file.


# Wait time until next check for an import to process, in seconds. Defaults to 5 seconds in the program

wait.time.for.next.check.for.import.to.process=60


# The path including the program for the Java executable.

# This is required if the java program is not on the PATH for the user that will be running this program.
# If java was installed using an installer or package manager, this probably is not required.
# If running "java -version" on the command line fails or is the wrong version,

#java.executable.with.path=

# importer jar with path

importer.jar.with.path=/usr/local/bin/importProxlXML.jar


# optional importer config file with path if a db_config_file.properties hasn't been rolled into the importer jar
# This string is passed to the importer with the "-c" command line parameter

importer.db.config.file.with.path=/usr/local/bin/db_config_file.properties

# Optional PID file to track run Importer.
# If used, must match filename/path in scripts:
# z_run__runImportProxlXML.jar_StartBackground_ForRestartIfNotRunningScript.sh
# z_restart_runImportProxlXML.jar_if_not_running.sh
#importer.pid.file.with.path=


# Example for web app on same machine at TOMCAT HTTP port
# proxl.web.app.base.url=http://localhost:8080/proxl/

proxl.web.app.base.url=http://proxl:8080/proxl/

#username=
#password=
#dbHost=
#dbPort=


# override database names if changed from defaults

proxl.db.name=proxl

# nrseq.db.name=

28 changes: 28 additions & 0 deletions docker/webapp/BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## How to build the importer docker image

1. Build Limelight

```
# go to root directory of this repo
cd ../..
# use docker to build the project
sudo docker run --rm -it --user $(id -u):$(id -g) -v `pwd`:`pwd` -w `pwd` --env HOME=. --entrypoint ant mriffle/build-limelight -f ant__build_all_limelight.xml
```

See https://github.com/yeastrc/limelight-build-docker for more information.

2. Copy war file into this directory

```
cd docker/webapp
cp ../../deploy/limelight.war ./
```

3. Build the Docker image

```
sudo docker image build -t mriffle/limelight-webapp ./
```

Tag as desired.
8 changes: 8 additions & 0 deletions docker/webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM tomcat:9-jdk11-corretto
MAINTAINER Michael Riffle <mriffle@uw.edu>

COPY mysql-connector-java-8.0.26.jar /usr/local/tomcat/lib
COPY context.xml /usr/local/tomcat/conf
COPY setenv.sh /usr/local/tomcat/bin

COPY proxl.war /usr/local/tomcat/webapps
47 changes: 47 additions & 0 deletions docker/webapp/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/proxl"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp2.BasicDataSourceFactory"
maxTotal="300"
maxIdle="200"
minIdle="200"
maxWaitMillis="1000"

minEvictableIdleTimeMillis="21600000"
timeBetweenEvictionRunsMillis="30000"

validationQuery="select 1 from dual"
testOnBorrow="true"


username="${PROXL_MYSQL_USER}"
password="${PROXL_MYSQL_PASSWORD}"
driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://db:3306/${PROXL_DATABASE_NAME}?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;characterSetResults=UTF-8"
/>

</Context>
Binary file added docker/webapp/mysql-connector-java-8.0.26.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions docker/webapp/setenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
JAVA_OPTS="-server -DPROXL_MYSQL_USER=${PROXL_MYSQL_USER} -DPROXL_MYSQL_PASSWORD=${PROXL_MYSQL_PASSWORD} -DPROXL_DATABASE_NAME=${PROXL_DATABASE_NAME} "

CATALINA_OPTS="${WEBAPP_JAVA_OPTIONS}"

0 comments on commit c1ebc09

Please sign in to comment.