Skip to content

Commit

Permalink
Merge pull request #1248 from virtualcell/alpha-to-vxrails-k8s
Browse files Browse the repository at this point in the history
Github CD action to deploy vcell alpha to kubernetes
  • Loading branch information
jcschaff authored May 16, 2024
2 parents f710641 + 4b4cbfa commit c870030
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 200 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/site_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ on:
vcell_build:
description: 'build number'
required: true
default: '23'
default: '148'
vcell_site:
description: 'rel or alpha or test'
description: 'rel or alpha or test (note rel is Swarm, alpha and test are Kubernetes)'
required: true
default: 'alpha'
server_only:
description: 'Deploy only the server components?'
required: true
default: 'false'
deployment_type:
description: 'swarm or kubernetes (choose kubernetes for vcell_site="test")'
required: true
default: 'swarm'
jobs:
build:
name: Build client installers
Expand All @@ -48,7 +44,7 @@ jobs:
echo "VCELL_MANAGER_NODE=vcellapi.cam.uchc.edu" >> $GITHUB_ENV;\
echo "VCELL_INSTALLER_REMOTE_DIR="/share/apps/vcell3/apache_webroot/htdocs/webstart/Rel"" >> $GITHUB_ENV;\
else if [ "${{ github.event.inputs.vcell_site }}" == "alpha" ]; then\
echo "VCELL_MANAGER_NODE=vcellapi-beta.cam.uchc.edu" >> $GITHUB_ENV;\
echo "VCELL_MANAGER_NODE=vcellapi.cam.uchc.edu" >> $GITHUB_ENV;\
echo "VCELL_INSTALLER_REMOTE_DIR="/share/apps/vcell3/apache_webroot/htdocs/webstart/Alpha"" >> $GITHUB_ENV;\
else if [ "${{ github.event.inputs.vcell_site }}" == "test" ]; then\
echo "VCELL_MANAGER_NODE=vcellapi.cam.uchc.edu" >> $GITHUB_ENV;\
Expand Down Expand Up @@ -212,7 +208,7 @@ jobs:
set -ux
mvn clean install -DskipTests
- name: deploy installers and singularity to kubernetes site and web help to vcell.org
if: ${{ github.event.inputs.deployment_type == 'kubernetes' }}
if: ${{ github.event.inputs.vcell_site != 'rel' }}
run: |
set -ux
cd docker/swarm
Expand All @@ -237,7 +233,7 @@ jobs:
./deploy-action-kubernetes.sh \
--ssh-user ${{ secrets.CD_FULL_USER }} \
--install-singularity \
${VCELL_MANAGER_NODE} \
${VCELL_MANAGER_NODE} \
./${VCELL_CONFIG_FILE_NAME}
fi
- name: Capitalize first character of site name
Expand All @@ -246,13 +242,16 @@ jobs:
SITE="${{ github.event.inputs.vcell_site }}"
SITE_CAPITALIZED="$(tr '[:lower:]' '[:upper:]' <<< ${SITE:0:1})${SITE:1}"
VCELL_SWVERSION="${SITE_CAPITALIZED}_Version_${{ github.event.inputs.vcell_version }}_build_${{ github.event.inputs.vcell_build}}"
KUSTOMIZE_OVERLAY="stage"
KUSTOMIZE_OVERLAY='not-specified'
if [ "${{ github.event.inputs.vcell_site }}" == "rel" ]; then KUSTOMIZE_OVERLAY="prod"; fi
if [ "${{ github.event.inputs.vcell_site }}" == "alpha" ]; then KUSTOMIZE_OVERLAY="dev"; fi
if [ "${{ github.event.inputs.vcell_site }}" == "test" ]; then KUSTOMIZE_OVERLAY="stage"; fi
CONTAINER_IMAGE_TAG="${{ github.event.inputs.vcell_version }}.${{ github.event.inputs.vcell_build}}"
echo "VCELL_SWVERSION=${VCELL_SWVERSION}" >> $GITHUB_ENV
echo "KUSTOMIZE_OVERLAY=${KUSTOMIZE_OVERLAY}" >> $GITHUB_ENV
echo "CONTAINER_IMAGE_TAG=${CONTAINER_IMAGE_TAG}" >> $GITHUB_ENV
- name: Call webhook to deploy to kubernetes cluster (overlay 'stage')
if: ${{ github.event.inputs.deployment_type == 'kubernetes' }}
- name: Call webhook to deploy to kubernetes cluster (overlay 'prod', 'dev' or 'stage')
if: ${{ github.event.inputs.vcell_site != 'rel' }}
run: |
git_sha=$(git rev-parse --short "$GITHUB_SHA")
echo '{"ref": "main","inputs":{"overlay": "'${KUSTOMIZE_OVERLAY}'","tag":"'${CONTAINER_IMAGE_TAG}'","swversion": "'${VCELL_SWVERSION}'"}}' >body
Expand All @@ -261,7 +260,7 @@ jobs:
-H 'Content-Type: application/json' \
--data "@body"
- name: deploy to swarm site
if: ${{ github.event.inputs.deployment_type == 'swarm' }}
if: ${{ github.event.inputs.vcell_site == 'rel' }}
run: |
set -ux
cd docker/swarm
Expand Down
8 changes: 4 additions & 4 deletions docker/swarm/deploy-action-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
set -ux

show_help() {
echo "Deploys or updates a deployment of VCell on remote Kubernetes cluster"
echo "Deploys vcell client installers, webhelp and singularity images for a Kubernetes deploy"
echo ""
echo "usage: deploy-action-kubernetes.sh [OPTIONS] REQUIRED-ARGUMENTS"
echo ""
echo " REQUIRED-ARGUMENTS"
echo " manager-node any node for ssh access ( vcellapi-test.cam.uchc.edu )"
echo " manager-node any node for ssh access (e.g. vcellapi.cam.uchc.edu)"
echo ""
echo " local-config-file local config file for setting environment"
echo ""
Expand Down Expand Up @@ -38,10 +38,10 @@ show_help() {
echo "deploy-action-kubernetes.sh \\"
echo " --ssh-user vcell \\"
echo " --install_singularity \\"
echo " --build_installers --installer_deploy_dir /share/apps/vcell3/apache_webroot/htdocs/webstart/Test \\"
echo " --build_installers --installer_deploy_dir /share/apps/vcell3/apache_webroot/htdocs/webstart/Alpha \\"
echo " --webhelp_local_dir ../../vcell-client/target/classes/vcellDoc \\"
echo " --webhelp_deploy_dir /share/apps/vcell3/apache_webroot/htdocs/webstart/VCell_Tutorials/VCell_Help \\"
echo " vcellapi-test.cam.uchc.edu \\"
echo " vcellapi.cam.uchc.edu \\"
echo " ./server.config"
exit 1
}
Expand Down
68 changes: 6 additions & 62 deletions docker/swarm/serverconfig-uch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,76 +43,27 @@ case $VCELL_SITE in
VCELL_API_PORT_EXTERNAL=443
VCELL_API_PREFIX_V0=""
VCELL_API_PREFIX_V1=""
VCELL_DEBUG_PORT_BASE=5000
_applicationId="1471-8022-1038-5553"
;;
BETA)
_site_port_offset=1
VCELL_API_HOST_EXTERNAL=vcellapi.cam.uchc.edu
VCELL_S3_EXPORT_BASEURL=https://vcellapi.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=443
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5010
_applicationId="1471-8022-1038-5552"
;;
ALPHA)
_site_port_offset=2
VCELL_API_HOST_EXTERNAL=vcellapi-beta.cam.uchc.edu
VCELL_S3_EXPORT_BASEURL=https://vcellapi-beta.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=8080
VCELL_API_HOST_EXTERNAL=vcell-dev.cam.uchc.edu
VCELL_S3_EXPORT_BASEURL=https://vcell-dev.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=443
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5020
_applicationId="1471-8022-1038-5554"
;;
TEST)
_site_port_offset=3
# VCELL_API_PORT_EXTERNAL=8081
VCELL_API_HOST_EXTERNAL=vcellapi-test.cam.uchc.edu
VCELL_S3_EXPORT_BASEURL=https://vcellapi-test.cam.uchc.edu
VCELL_API_HOST_EXTERNAL=vcell-stage.cam.uchc.edu
VCELL_S3_EXPORT_BASEURL=https://vcell-stage.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=443
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5030
_applicationId="1471-8022-1038-5555"
;;
TEST2)
_site_port_offset=4
VCELL_API_HOST_EXTERNAL=vcellapi-beta.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=8082
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5040
_applicationId="1471-8022-1038-5556"
;;
TEST3)
_site_port_offset=5
VCELL_API_HOST_EXTERNAL=vcellapi-beta.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=8083
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5050
_applicationId="1471-8022-1038-5557"
;;
TEST4)
_site_port_offset=6
VCELL_API_HOST_EXTERNAL=vcellapi-beta.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=8084
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5060
_applicationId="1471-8022-1038-5558"
;;
TEST5)
_site_port_offset=7
VCELL_API_HOST_EXTERNAL=vcellapi-beta.cam.uchc.edu
VCELL_API_PORT_EXTERNAL=8085
VCELL_API_PREFIX_V0="/api/v0"
VCELL_API_PREFIX_V1="/api/v1"
VCELL_DEBUG_PORT_BASE=5070
_applicationId="1471-8022-1038-5559"
;;
*)
printf 'ERROR: Unknown site: %s\n' "$1" >&2
;;
Expand Down Expand Up @@ -141,13 +92,6 @@ VCELL_SLURM_LOCAL_SINGULARITY_DIR=/local/singularityImages
VCELL_SLURM_CENTRAL_SINGULARITY_DIR=/share/apps/vcell3/singularityImages
VCELL_SLURM_SINGULARITY_MODULE_NAME=singularity/vcell-3.10.0

#
# VCELL_API_PORT_EXTERNAL uses 443 for Beta and Rel (but on different machines/swarm clusters)
# ALPHA, TEST, TEST2, TEST3, etc. uses ports starting with 8080
# Note: port 8080 is currently needed by vcell.org website.
#


VCELL_JMS_SIM_PORT_EXTERNAL=$((61616 + _site_port_offset))
VCELL_JMS_SIM_RESTPORT_EXTERNAL=$((8161 + _site_port_offset))
VCELL_MONGO_PORT_EXTERNAL=$((27017 + _site_port_offset))
Expand All @@ -173,7 +117,7 @@ VCELL_SSH_CMD_RESTORE_TIMEOUT=5
#
# write out the environment file to be for:
# 1. deployment actions (e.g. deploy-action-swarm.sh or deploy-action-kubernetes.sh)
# 2. runtime environment for the docker stack run command
# 2. runtime environment for the docker stack run command (Docker swarm mode only, kubernetes uses ConfigMaps in vcell-fluxcd repo)
#
cat <<EOF >"$_outputfile"
VCELL_API_HOST_EXTERNAL=$VCELL_API_HOST_EXTERNAL
Expand Down
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
<activemq-client.version>5.18.3</activemq-client.version>
<axis.version>1.4</axis.version>
<axis-wsdl4j.version>1.2</axis-wsdl4j.version>
<bcprov-jdk15on.version>1.70</bcprov-jdk15on.version>
<bcpkix-jdk15on.version>1.70</bcpkix-jdk15on.version>
<bio-formats.version>6.7.0</bio-formats.version>
<bio-formats_plugins.version>${bio-formats.version}</bio-formats_plugins.version>
<biojava.version>6.0.4</biojava.version>
Expand All @@ -123,6 +125,7 @@
<imagej2.version>2.3.0</imagej2.version>
<imagej.version>${imagej2.version}</imagej.version>
<itext.version>2.1.7</itext.version>
<quarkus-itext.version>3.0.5</quarkus-itext.version>
<jackson-annotations.version>2.15.2</jackson-annotations.version>
<jackson-core.version>2.15.2</jackson-core.version>
<jackson-databind.version>2.15.2</jackson-databind.version>
Expand Down Expand Up @@ -172,7 +175,7 @@
<sesame-rio-rdfxml.version>2.9.0</sesame-rio-rdfxml.version>
<sesame-rio-n3.version>2.9.0</sesame-rio-n3.version>
<slf4j-api.version>2.0.9</slf4j-api.version>
<sshj.version>0.38.0</sshj.version>
<sshj.version>0.35.0</sshj.version>
<xercesImpl.version>2.8.0</xercesImpl.version>
<xstream.version>1.4.20</xstream.version>
<xom.version>1.2.5</xom.version>
Expand Down
27 changes: 27 additions & 0 deletions vcell-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,34 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>${itext.version}</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bctsp-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov-jdk15on.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bcpkix-jdk15on.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,40 +141,40 @@ void testquery(){
}

private double[] getDoubleArray(String... names){
MovingBoundardyVH5TypedPath<double[]> dpath = new MovingBoundardyVH5TypedPath<double[]>(root, double[].class, names);
MovingBoundaryVH5TypedPath<double[]> dpath = new MovingBoundaryVH5TypedPath<double[]>(root, double[].class, names);
return dpath.get();
}

private double singleDouble(String... names){
double[] a = getDoubleArray(names);
if(a.length != 1){
throw new MovingBoundaryResultException(MovingBoundardyVH5Path.concat(names) + " is not single element array");
throw new MovingBoundaryResultException(MovingBoundaryVH5Path.concat(names) + " is not single element array");
}
return a[0];
}

private long[] getLongArray(String... names){
MovingBoundardyVH5TypedPath<long[]> dpath = new MovingBoundardyVH5TypedPath<long[]>(root, long[].class, names);
MovingBoundaryVH5TypedPath<long[]> dpath = new MovingBoundaryVH5TypedPath<long[]>(root, long[].class, names);
return dpath.get();
}

private long singleLong(String... names){
long[] a = getLongArray(names);
if(a.length != 1){
throw new MovingBoundaryResultException(MovingBoundardyVH5Path.concat(names) + " is not single element array");
throw new MovingBoundaryResultException(MovingBoundaryVH5Path.concat(names) + " is not single element array");
}
return a[0];
}

private int[] getIntArray(String... names){
MovingBoundardyVH5TypedPath<int[]> dpath = new MovingBoundardyVH5TypedPath<int[]>(root, int[].class, names);
MovingBoundaryVH5TypedPath<int[]> dpath = new MovingBoundaryVH5TypedPath<int[]>(root, int[].class, names);
return dpath.get();
}

private int singleInt(String... names){
int[] a = getIntArray(names);
if(a.length != 1){
throw new MovingBoundaryResultException(MovingBoundardyVH5Path.concat(names) + " is not single element array");
throw new MovingBoundaryResultException(MovingBoundaryVH5Path.concat(names) + " is not single element array");
}
return a[0];
}
Expand Down Expand Up @@ -400,10 +400,10 @@ private class PlaneNodes {
final H5CompoundDS species;

PlaneNodes() throws Exception{
MovingBoundardyVH5TypedPath<H5CompoundDS> dpath = new MovingBoundardyVH5TypedPath<H5CompoundDS>(root, H5CompoundDS.class, "elements");
MovingBoundaryVH5TypedPath<H5CompoundDS> dpath = new MovingBoundaryVH5TypedPath<H5CompoundDS>(root, H5CompoundDS.class, "elements");
elements = dpath.get();
elements.read();
dpath = new MovingBoundardyVH5TypedPath<H5CompoundDS>(root, H5CompoundDS.class, "species");
dpath = new MovingBoundaryVH5TypedPath<H5CompoundDS>(root, H5CompoundDS.class, "species");
species = dpath.get();
species.read();
}
Expand Down Expand Up @@ -441,7 +441,7 @@ public int[] getBoundaryIndexes(int timeIndex){

VCAssert.assertTrue(timeIndex >= 0, "negative time index");
validateTimeIndex(timeIndex);
MovingBoundardyVH5TypedPath<H5ScalarDS> path = new MovingBoundardyVH5TypedPath<>(root, H5ScalarDS.class, "boundaries");
MovingBoundaryVH5TypedPath<H5ScalarDS> path = new MovingBoundaryVH5TypedPath<>(root, H5ScalarDS.class, "boundaries");
H5ScalarDS hsd = path.get();
hsd.init();
long[] start = hsd.getStartDims();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
*
* @author GWeatherby
*/
public class MovingBoundardyVH5Path {
public class MovingBoundaryVH5Path {

protected Object target;
protected Exception exc;
protected static final Logger lg = LogManager.getLogger(MovingBoundardyVH5Path.class);
protected static final Logger lg = LogManager.getLogger(MovingBoundaryVH5Path.class);


/**
* @param g staring point, not null
* @param names path to search
*/
public MovingBoundardyVH5Path(Group g, String... names){
public MovingBoundaryVH5Path(Group g, String... names){
target = null;
exc = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* @param <T> type of returned data. primitives not supported, autoboxing not supported
* @author GWeatherby
*/
public class MovingBoundardyVH5TypedPath<T> extends MovingBoundardyVH5Path {
public class MovingBoundaryVH5TypedPath<T> extends MovingBoundaryVH5Path {

public MovingBoundardyVH5TypedPath(Group g, Class<T> clzz, String... names){
public MovingBoundaryVH5TypedPath(Group g, Class<T> clzz, String... names){
super(g, names);
Objects.requireNonNull(clzz);
if(clzz.isPrimitive()){
Expand Down
Loading

0 comments on commit c870030

Please sign in to comment.