Skip to content

Commit

Permalink
split VCellClientTest into admin and prod, set Guice DI on all services
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 26, 2023
1 parent 27fba4b commit 7b2559f
Show file tree
Hide file tree
Showing 52 changed files with 1,987 additions and 2,249 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
Expand Down Expand Up @@ -60,17 +60,7 @@ RUN python3 -m pip install poetry && poetry config cache-dir "/poetry/.cache"
ENV PATH="/root/.poetry/bin:/root/.local/bin:$PATH"

# Copy JAR files
COPY ./vcell-client/target/vcell-client-0.0.1-SNAPSHOT.jar \
./vcell-client/target/maven-jars/*.jar \
./vcell-core/target/vcell-core-0.0.1-SNAPSHOT.jar \
./vcell-core/target/maven-jars/*.jar \
./vcell-server/target/vcell-server-0.0.1-SNAPSHOT.jar \
./vcell-server/target/maven-jars/*.jar \
./vcell-vmicro/target/vcell-vmicro-0.0.1-SNAPSHOT.jar \
./vcell-vmicro/target/maven-jars/*.jar \
./vcell-admin/target/vcell-admin-0.0.1-SNAPSHOT.jar \
./vcell-admin/target/maven-jars/*.jar \
./vcell-cli/target/vcell-cli-0.0.1-SNAPSHOT.jar \
COPY ./vcell-cli/target/vcell-cli-0.0.1-SNAPSHOT.jar \
./vcell-cli/target/maven-jars/*.jar \
./non-maven-java-libs/org/sbml/libcombine/libCombineLinux64/0.2.7/libCombineLinux64-0.2.7.jar \
/usr/local/app/vcell/lib/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Requirements: Eclipse IDE for Java Developers and Java JDK 1.8 or later
* Name: VCellClient
* Main:
* Project: `vcell-client`
* Main Class: `cbit.vcell.client.test.VCellClientTest`
* Main Class: `cbit.vcell.client.test.VCellClientMain`
* Arguments:
* Program arguments: `vcellapi-beta.cam.uchc.edu:8080`
* VM arguments are:
Expand Down Expand Up @@ -111,7 +111,7 @@ VCell Server Installation General Requirements
### Other Details
1. Creating certs [details](README_certs.md)
1. Creating certs [details](docs-misc/README_certs.md)
1.1. (TLS/SSL website for (vcellapi.cam.uchc.edu,vcell-api.cam.uchc.edu)
1.2. Microsoft authenticode codesigning (to prevent install4j from being rejected on windows clients)
1.3. Apple codesigning for macos (prevents from mac refusing install4j install))
Expand All @@ -122,9 +122,9 @@ VCell Server Installation General Requirements
4. Building VCell Client/Server [Software detailed instructions](docker/build/README.md)
4.1. Github/Travis/Appveyor/Dockerhub [Instructions](README_git_trav_appv_dhub.md)
5. Deploying VCell Client/Server software [detailed instructions](docker/swarm/README.md)
5.1. VCell System [Flow-Control](README_flow_control.md)
5.1. VCell System [Flow-Control](docs-misc/README_flow_control.md)
6. Server Administration [detailed instructions](docker/swarm/README_admin.md) (.e.g restarting VCell services)
7. [Debugging detailed instructions](README_Debugging.md) (.e.g debug vcell client/server)
7. [Debugging detailed instructions](docs-misc/README_Debugging.md) (.e.g debug vcell client/server)
8. serverconfig.sh file must be customized for your configuration (see vcell/docker/swarm/serverconfig-uch.sh).
Expand Down
30 changes: 21 additions & 9 deletions docker/build/Dockerfile-api-dev
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
# java.beans.PropertyChangeEvent requires java.desktop
# org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry requires java.management (MBeanRegistrationException)
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.instrument,java.logging,java.management,java.desktop,java.naming,java.sql,java.xml,jdk.jdwp.agent,jdk.httpserver \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

# Define base image and copy in jlink created minimal Java 17 environment
FROM debian:buster-slim
FROM python:3.9.7-slim
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-build /javaruntime $JAVA_HOME

# now we have Java 17 and Python 3.9

RUN apt-get -y update && \
apt-get install -y curl dnsutils && \
apt-get install -y --no-install-recommends curl dnsutils && \
mkdir -p /usr/local/app/lib


RUN python3 -m pip install poetry && poetry config cache-dir "/poetry/.cache"
ENV PATH="/root/.poetry/bin:/root/.local/bin:$PATH"

WORKDIR /usr/local/app

COPY ./vcell-server/target/vcell-server-0.0.1-SNAPSHOT.jar \
./vcell-server/target/maven-jars/*.jar \
./vcell-api/target/vcell-api-0.0.1-SNAPSHOT.jar \
# Copy JAR files
COPY ./vcell-api/target/vcell-api-0.0.1-SNAPSHOT.jar \
./vcell-api/target/maven-jars/*.jar \
./lib/

# Copy and install vcell-cli-utils
COPY ./vcell-cli-utils/ /usr/local/app/python/vcell_cli_utils/
RUN cd /usr/local/app/python/vcell_cli_utils/ && \
poetry config cache-dir "/poetry/.cache" --local && \
chmod 755 poetry.toml && \
poetry install

# copy API resources
COPY ./vcell-api/docroot ./docroot
COPY ./vcell-api/webapp ./webapp
COPY ./vcell-api/keystore_macbook.jks .
Expand All @@ -53,6 +63,7 @@ ENV softwareVersion=SOFTWARE-VERSION-NOT-SET \
ssl_ignoreHostMismatch=true \
ssl_ignoreCertProblems=false \
submit_service_host="submit" \
workingDir="/usr/local/app" \
userTimezone="-05:00"

ENV dbpswdfile=/run/secrets/dbpswd \
Expand All @@ -71,6 +82,7 @@ ENTRYPOINT java \
-Dlog4j.configurationFile=/usr/local/app/vcell-api.log4j.xml \
-Dvcell.server.id="${serverid}" \
-Dvcell.installDir=/usr/local/app \
-Dcli.workingDir="${workingDir}" \
-Dvcell.server.dbConnectURL="${dburl}" \
-Dvcell.server.dbDriverName="${dbdriver}" \
-Dvcell.server.dbUserid="${dbuser}" \
Expand Down
21 changes: 20 additions & 1 deletion docker/build/Dockerfile-clientgen-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
FROM openjdk:17-jdk-slim
FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.instrument,java.logging,java.management,java.desktop,java.naming,java.transaction.xa,java.xml,jdk.jdwp.agent \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

# Define base image and copy in jlink created minimal Java 17 environment
FROM debian:buster-slim
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-build /javaruntime $JAVA_HOME

RUN mkdir -p /usr/local/app && \
apt-get -y update && \
apt-get -y install wget

RUN mkdir /installer && cd /installer && \
wget --quiet -O install4j_unix_10_0_4.tar.gz \
Expand Down
64 changes: 5 additions & 59 deletions docker/build/Dockerfile-data-dev
Original file line number Diff line number Diff line change
@@ -1,62 +1,8 @@
# VTK and OpenJDK n Alpine Linux
#FROM alpine:3.7
# Install some Alpine packages
#RUN apk add --no-cache \
# bash \
# build-base \
# cmake \
# wget \
# mesa-dev \
# mesa-osmesa \
# python2-dev
# Download and extract VTK source, then configure and build VTK
#RUN wget -nv -O- http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz | \
# tar xz && \
# cd VTK-7.1.0 && \
# cmake \
# -D CMAKE_BUILD_TYPE:STRING=Release \
# -D CMAKE_INSTALL_PREFIX:STRING=/usr \
# -D BUILD_DOCUMENTATION:BOOL=OFF \
# -D BUILD_EXAMPLES:BOOL=OFF \
# -D BUILD_TESTING:BOOL=OFF \
# -D BUILD_SHARED_LIBS:BOOL=ON \
# -D VTK_USE_X:BOOL=OFF \
# -D VTK_OPENGL_HAS_OSMESA:BOOL=ON \
# -D OSMESA_LIBRARY=/usr/lib/libOSMesa.so.8 \
# -D OSMESA_INCLUDE_DIR=/usr/include/GL/ \
# -D VTK_RENDERING_BACKEND:STRING=OpenGL \
# -D VTK_Group_MPI:BOOL=OFF \
# -D VTK_Group_StandAlone:BOOL=OFF \
# -D VTK_Group_Rendering:BOOL=ON \
# -D VTK_WRAP_PYTHON=ON \
# -D VTK_PYTHON_VERSION:STRING=2 \
# . && \
# make -j 2 && \
# make install && \
# cd .. && rm -rf VTK-7.1.0
# install thrift python package
#RUN wget https://bootstrap.pypa.io/get-pip.py \
# && python get-pip.py \
# && pip install thrift
#RUN apk update && apk upgrade && \
# apk add openjdk8 && \
# mkdir /tmp/tmprt && \
# cd /tmp/tmprt && \
# apk add zip && \
# unzip -q /usr/lib/jvm/default-jvm/jre/lib/rt.jar && \
# apk add zip && \
# zip -q -r /tmp/rt.zip . && \
# apk del zip && \
# cd /tmp && \
# mv rt.zip /usr/lib/jvm/default-jvm/jre/lib/rt.jar && \
# rm -rf /tmp/tmprt /var/cache/apk/* bin/jjs bin/keytool bin/orbd bin/pack200 bin/policytool \
# bin/rmid bin/rmiregistry bin/servertool bin/tnameserv bin/unpack200

FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.instrument,java.logging,java.management,java.desktop,java.naming,java.sql,java.xml,jdk.jdwp.agent \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
Expand All @@ -71,9 +17,9 @@ COPY --from=jre-build /javaruntime $JAVA_HOME

# now we have Java 17 and Python 3.9

RUN mkdir -p /usr/local/app && \
apt-get -y update && \
apt-get -y install openssh-client screen
RUN apt-get -y update && \
apt-get -y install openssh-client screen && \
mkdir -p /usr/local/app

RUN python3 -m pip install poetry && poetry config cache-dir "/poetry/.cache"
ENV PATH="/root/.poetry/bin:/root/.local/bin:$PATH"
Expand Down Expand Up @@ -157,5 +103,5 @@ ENTRYPOINT java \
-Dvcell.mongodb.port.internal=${mongodb_port_internal} \
-Dvcell.mongodb.database=${mongodb_database} \
-Dvcelldata.web.server.port=${webDataPort} \
-cp "./lib/*" cbit.vcell.message.server.data.SimDataServer \
-cp "./lib/*" cbit.vcell.message.server.data.SimDataServerMain \
"${servertype}"
2 changes: 1 addition & 1 deletion docker/build/Dockerfile-sched-dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.instrument,java.logging,java.management,java.desktop,java.naming,java.sql,java.transaction.xa,java.xml,jdk.jdwp.agent \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
Expand Down
2 changes: 1 addition & 1 deletion docker/build/Dockerfile-web-dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM eclipse-temurin:17 as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.instrument,java.logging,java.management,java.desktop,java.naming,java.sql,java.xml,jdk.jdwp.agent,jdk.httpserver \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
Expand Down
10 changes: 5 additions & 5 deletions docker/build/installers/VCell.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<launcher name="VCell-${compiler:Site}-MacOSX" id="102" icnsFile="${compiler:vcellIcnsFile}">
<executable name="VCell-${compiler:Site}" iconSet="true" failOnStderrOutput="false" executableMode="gui" checkConsoleParameter="true" dpiAware="false" />
<splashScreen show="true" bitmapFile="${compiler:vcell5SplashScreenPngFilePath}" textOverlay="true" />
<java mainClass="cbit.vcell.client.test.VCellClientTest" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<java mainClass="cbit.vcell.client.VCellClientMain" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<classPath>
<scanDirectory location="lib" failOnError="false" />
</classPath>
Expand Down Expand Up @@ -156,7 +156,7 @@
<launcher name="VCell-${compiler:Site}-Windows64" id="345" icnsFile="${compiler:vcellIcnsFile}">
<executable name="VCell-${compiler:Site}" iconSet="true" failOnStderrOutput="false" executableMode="gui" checkConsoleParameter="true" dpiAware="false" />
<splashScreen show="true" bitmapFile="${compiler:vcell5SplashScreenPngFilePath}" textOverlay="true" />
<java mainClass="cbit.vcell.client.test.VCellClientTest" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<java mainClass="cbit.vcell.client.test.VCellClientMain" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<classPath>
<scanDirectory location="lib" failOnError="false" />
</classPath>
Expand Down Expand Up @@ -186,7 +186,7 @@
<launcher name="VCell-${compiler:Site}-Windows32" id="447" icnsFile="${compiler:vcellIcnsFile}">
<executable name="VCell-${compiler:Site}" iconSet="true" failOnStderrOutput="false" executableMode="gui" checkConsoleParameter="true" dpiAware="false" />
<splashScreen show="true" bitmapFile="${compiler:vcell5SplashScreenPngFilePath}" textOverlay="true" />
<java mainClass="cbit.vcell.client.test.VCellClientTest" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<java mainClass="cbit.vcell.client.test.VCellClientMain" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<classPath>
<scanDirectory location="lib" failOnError="false" />
</classPath>
Expand Down Expand Up @@ -217,7 +217,7 @@
<launcher name="VCell-${compiler:Site}-Linux32" id="534" icnsFile="${compiler:vcellIcnsFile}">
<executable name="VCell-${compiler:Site}" failOnStderrOutput="false" executableMode="gui" checkConsoleParameter="true" dpiAware="false" />
<splashScreen bitmapFile="${compiler:vcell5SplashScreenPngFilePath}" />
<java mainClass="cbit.vcell.client.test.VCellClientTest" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<java mainClass="cbit.vcell.client.test.VCellClientMain" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<classPath>
<scanDirectory location="lib" failOnError="false" />
</classPath>
Expand All @@ -244,7 +244,7 @@
<launcher name="VCell-${compiler:Site}-Linux64" id="627" icnsFile="${compiler:vcellIcnsFile}">
<executable name="VCell-${compiler:Site}" failOnStderrOutput="false" executableMode="gui" checkConsoleParameter="true" dpiAware="false" />
<splashScreen bitmapFile="${compiler:vcell5SplashScreenPngFilePath}" />
<java mainClass="cbit.vcell.client.test.VCellClientTest" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<java mainClass="cbit.vcell.client.test.VCellClientMain" vmParameters="&quot;-Dvcell.installDir=${launcher:sys.launcherDirectory}&quot;">
<classPath>
<scanDirectory location="lib" failOnError="false" />
</classPath>
Expand Down
2 changes: 2 additions & 0 deletions docker/swarm/README_admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ sudo docker service update --force --detach=false vcellrel_data
sudo docker service update --force --detach=false vcellrel_sched
sudo docker service update --force --detach=false vcellrel_submit
sudo docker service update --force --detach=false vcellrel_api
sudo docker service update --force --detach=false vcellrel_web
(not used) sudo docker service update --force --detach=false vcellrel_opt

### Restart Alpha Site (from development swarm cluster, e.g. vcellapi-beta.cam.uchc.edu or vcell-node3 or vcell-node4)
Expand All @@ -20,4 +21,5 @@ sudo docker service update --force --detach=false vcellalpha_data
sudo docker service update --force --detach=false vcellalpha_sched
sudo docker service update --force --detach=false vcellalpha_submit
sudo docker service update --force --detach=false vcellalpha_api
sudo docker service update --force --detach=false vcellalpha_web
(not used) sudo docker service update --force --detach=false vcellalpha_opt
3 changes: 0 additions & 3 deletions docker/swarm/localconfig_realslurm_oracle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,10 @@ VCELL_SECRETS_DIR=${HOME}/vcellkeys_oracle
VCELL_SIMDATADIR_ARCHIVE_EXTERNAL=/share/apps/vcell12/users
VCELL_SIMDATADIR_ARCHIVE_INTERNAL=/share/apps/vcell12/users
VCELL_SIMDATADIR_ARCHIVE_HOST=/Volumes/vcell-1/users
VCELL_SIMDATADIR_ARCHIVE_HOST_ORIG=/Volumes/vcell-2/users
VCELL_SIMDATADIR_EXTERNAL=/share/apps/vcell3/users
VCELL_SIMDATADIR_HOST=/Volumes/vcell/users
VCELL_SIMDATADIR_SECONDARY_EXTERNAL=/share/apps/vcell3/users
VCELL_SIMDATADIR_SECONDARY_HOST=/Volumes/vcell/users
VCELL_SIMDATADIR_SECONDARY_EXTERNAL_ORIG=/share/apps/vcell7/users
VCELL_SIMDATADIR_SECONDARY_HOST_ORIG=/Volumes/vcell-1/users
VCELL_SIMDATADIR_PARALLEL_EXTERNAL=/share/apps/vcell3parallel
VCELL_SITE_CAMEL=${_site_camel}
VCELL_SITE=$VCELL_SITE
Expand Down
6 changes: 3 additions & 3 deletions docker/swarm/localconfig_realslurm_postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ VCELL_REPO_NAMESPACE=$VCELL_REPO_NAMESPACE
VCELL_SECRETS_DIR=${HOME}/vcellkeys_postgres
VCELL_SIMDATADIR_ARCHIVE_EXTERNAL=/share/apps/vcell12/users
VCELL_SIMDATADIR_ARCHIVE_INTERNAL=/share/apps/vcell12/users
VCELL_SIMDATADIR_ARCHIVE_HOST=/Volumes/vcell-2/users
VCELL_SIMDATADIR_ARCHIVE_HOST=/Volumes/vcell-1/users
VCELL_SIMDATADIR_EXTERNAL=/share/apps/vcell3/users
VCELL_SIMDATADIR_HOST=/Volumes/vcell/users
VCELL_SIMDATADIR_SECONDARY_EXTERNAL=/share/apps/vcell10/users
VCELL_SIMDATADIR_SECONDARY_HOST=/Volumes/vcell-1/users
VCELL_SIMDATADIR_SECONDARY_EXTERNAL=/share/apps/vcell3/users
VCELL_SIMDATADIR_SECONDARY_HOST=/Volumes/vcell/users
VCELL_SIMDATADIR_PARALLEL_EXTERNAL=/share/apps/vcell3parallel
VCELL_SITE_CAMEL=${_site_camel}
VCELL_SITE=$VCELL_SITE
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<imagej.version>${imagej2.version}</imagej.version>
<!-- JFreeChart - http://www.jfree.org/jfreechart/ -->
<jfreechart.version>1.5.0</jfreechart.version>
<picocli.version>4.6.3</picocli.version>

</properties>

Expand Down
2 changes: 1 addition & 1 deletion vcell-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.6.3</version>
<version>${picocli.version}</version>
</dependency>
</dependencies>

Expand Down
Loading

0 comments on commit 7b2559f

Please sign in to comment.