Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publication edit form properly handle biomodel and mathmodel ref ids #1281

Merged
merged 15 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
types: [published]

env:
python-version: "3.9"
python-version: "3.10"

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get the VCell version from tags
Expand Down
2 changes: 1 addition & 1 deletion docker/build/Dockerfile-batch-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/virtualcell/vcell-solvers:v0.8.1.2
FROM ghcr.io/virtualcell/vcell-solvers:v0.8.1.3

RUN apt-get -y update && \
apt-get install -y curl && \
Expand Down
4 changes: 2 additions & 2 deletions docker/build/batch/JavaPostprocessor64
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jvmprop="${jvmprop} -Dvcell.mongodb.database=${mongodb_database}"
jvmprop="${jvmprop} -Dvcell.mongodb.host.internal=${mongodbhost_internal}"
jvmprop="${jvmprop} -Dvcell.mongodb.port.internal=${mongodbport_internal}"

jvmoptions="-XX:MaxRAMPercentage=100 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
#jvmoptions="-XX:MaxRAMPercentage=100 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
jvmoptions="-XX:MaxRAMPercentage=100 -Xms64M -Xmx${java_mem_Xmx}"

arguments=$*

echo "starting postprocessor"

echo "expecting jre 1.8_144 or later for memory options"
java -version

java ${jvmoptions} ${jvmprop} ${postprocessor_mainclass} ${arguments}
Expand Down
4 changes: 2 additions & 2 deletions docker/build/batch/JavaPreprocessor64
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jvmprop="${jvmprop} -Dvcell.mongodb.database=${mongodb_database}"
jvmprop="${jvmprop} -Dvcell.mongodb.host.internal=${mongodbhost_internal}"
jvmprop="${jvmprop} -Dvcell.mongodb.port.internal=${mongodbport_internal}"

jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
#jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx}"

arguments=$*

echo "starting preprocessor"

echo "expecting jre 1.8_144 or later for memory options"
java -version

java ${jvmoptions} ${jvmprop} ${preprocessor_mainclass} ${arguments}
Expand Down
4 changes: 2 additions & 2 deletions docker/build/batch/JavaSimExe64
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jvmprop="${jvmprop} -Dvcell.mongodb.database=${mongodb_database}"
jvmprop="${jvmprop} -Dvcell.mongodb.host.internal=${mongodbhost_internal}"
jvmprop="${jvmprop} -Dvcell.mongodb.port.internal=${mongodbport_internal}"

jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
#jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx} -XX:+PrintFlagsFinal -XshowSettings:vm"
jvmoptions="-XX:MaxRAMPercentage=80 -Xms64M -Xmx${java_mem_Xmx}"

echo "starting java solver"

echo "expecting jre 1.8_144 or later for memory options"
java -version

arguments=$*
Expand Down
108 changes: 10 additions & 98 deletions docker/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,19 @@ build_mongo() {
}

build_batch_singularity() {
# turn on logging of commands
set -x
if [ "$skip_singularity" == "false" ]; then
if [ -x "$(command -v singularity)" ]; then
build_batch_singularity_direct
if [[ $? -ne 0 ]]; then echo "failed to build singularity image using singularity commands"; exit 1; fi
else
if [ -x "$(command -v vagrant)" ]; then
build_batch_singularity_vagrant
if [[ $? -ne 0 ]]; then echo "failed to build singularity image using singularity vagrant box"; exit 1; fi
else
echo "found neither singularity nor vagrant, cannot build singularity image"
exit 1
fi
fi
echo "singularity not found, cannot build singularity image"
exit 1
fi
fi
# turn off logging of commands
set +x
}

build_batch_singularity_direct() {
Expand Down Expand Up @@ -301,103 +300,16 @@ EOF
cd ..
}

build_batch_singularity_vagrant() {
echo ""
cmd="cd singularity-vm"
cd singularity-vm
echo ""
echo "CURRENT DIRECTORY IS $PWD"

#
# prepare Vagrant Singularity box for building the singularity image (bring up, install cert)
#
echo ""
echo "generating singularity image for vcell-batch and uploading to remote server for HTC cluster"
cmd="sudo scp $ssh_key [email protected]:/usr/local/deploy/registry_certs/domain.cert ."
echo $cmd
($cmd) || (echo "failed to download cert from vcell-docker private Docker registry")

echo ""
echo "vagrant up"
vagrant up
if [[ $? -ne 0 ]]; then echo "failed to bring vagrant up"; fi

echo ""
remote_cmd="sudo cp /vagrant/domain.cert /usr/local/share/ca-certificates/vcell-docker.cam.uchc.edu.crt"
echo "vagrant ssh -c \"$remote_cmd\""
vagrant ssh -c "$remote_cmd"
if [[ $? -ne 0 ]]; then echo "failed to upload domain.cert to trust the private Docker registry" && exit 1; fi

echo ""
remote_cmd="sudo update-ca-certificates"
echo "vagrant ssh -c \"$remote_cmd\""
vagrant ssh -c "$remote_cmd"
if [[ $? -ne 0 ]]; then
echo "failed to update ca certificates in vagrant box" && exit 1
fi
#
# create temporary Singularity file which imports existing docker image from registry and adds a custom entrypoint
#
_vcell_batch_docker_name="${repo}/vcell-batch:${tag}"
_singularity_image_file="${_vcell_batch_docker_name//[\/:]/_}.img"
_singularity_file="Singularity_${_vcell_batch_docker_name//[\/:]/_}"

cat <<EOF >$_singularity_file
Bootstrap: docker
From: $_vcell_batch_docker_name

%runscript

exec /vcellscripts/entrypoint.sh "\$@"

%labels

AUTHOR jcschaff
EOF

echo ""
echo "wrote Singularity file $_singularity_file"
cat $_singularity_file

#
# build the singularity image and place in singularity-vm directory
#
echo ""
remote_cmd="sudo singularity build /vagrant/$_singularity_image_file /vagrant/$_singularity_file"
echo "vagrant ssh -c \"$remote_cmd\""
vagrant ssh -c "$remote_cmd"
if [[ $? -ne 0 ]]; then echo "failed to build singularity image from vagrant" && exit 1; fi

#
# bring down Vagrant Singularity box
#
echo ""
echo "vagrant halt"
vagrant halt
if [[ $? -ne 0 ]]; then echo "failed to stop vagrant box"; fi

echo ""
echo "created Singularity image for vcell-bash ./$local_singularity_image_name locally (in ./singularity-vm folder), can be pushed to remote server during deploy"
echo ""
echo "cd .."
cd ..
}

build_opt_singularity() {
if [ "$skip_singularity" == "false" ]; then
if [ -x "$(command -v singularity)" ]; then
build_opt_singularity_direct
if [[ $? -ne 0 ]]; then echo "failed to build opt singularity image using singularity commands"; exit 1; fi
else
# if [ -x "$(command -v vagrant)" ]; then
# build_opt_singularity_vagrant
# if [[ $? -ne 0 ]]; then echo "failed to build opt singularity image using singularity vagrant box"; exit 1; fi
# else
# echo "found neither singularity nor vagrant, cannot build opt singularity image"
echo "singularity not found, cannot build opt singularity image (vagrant build not implemented)"
exit 1
fi
# fi
echo "singularity not found, cannot build opt singularity image"
exit 1
fi
fi
}

Expand Down
2 changes: 1 addition & 1 deletion pythonCopasiOpt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim-buster
FROM python:3.10-slim-buster

RUN apt -y update && apt -y upgrade && \
apt-get install -y curl
Expand Down
12 changes: 8 additions & 4 deletions pythonCopasiOpt/vcell-opt/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pythonCopasiOpt/vcell-opt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Jim Schaff <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "3.9.*"
python = "^3.9"
copasi-basico = "0.40"
python-copasi = "4.37.264"
jupyter = "^1.0.0"
Expand Down
10 changes: 7 additions & 3 deletions pythonVtk/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pythonVtk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Jim Schaff <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "3.9.*"
python = "^3.9"
vtk = "^9.2.6"
thrift = "^0.16.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private int getSelectedParamScanJobIndex(){
}
int selectedJobIndex = -1;
try {
selectedJobIndex = BeanUtils.coordinateToIndex(indices, bounds);
selectedJobIndex = BeanUtils.parameterScanCoordinateToJobIndex(indices, bounds);
} catch (RuntimeException exc) {
exc.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,9 @@ private boolean isEqual(MiriamResource aThis, MiriamResource aThat) {
@SuppressWarnings("unchecked")
private void initializeComboBoxURI() {
// jComboBoxURI = getJComboBoxURI();
if (selectedObject == null && vcMetaData == null){
return;
}
Identifiable entity = getIdentifiable(selectedObject);
defaultComboBoxModelURI.removeAllElements();
List<String> tooltips = new ArrayList<> ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
import cbit.vcell.math.*;
import cbit.vcell.model.common.VCellErrorMessages;
import cbit.vcell.parser.*;
import jscl.math.function.Exp;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.util.*;
import org.vcell.util.Issue.IssueCategory;
import org.vcell.util.IssueContext.ContextType;

import java.util.*;
import java.util.function.BiPredicate;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -353,7 +351,7 @@ public Expression getActualExpression(String key, int index){
for(int i = 0; i < names.length; i++){
bounds[i] = getConstantArraySpec(names[i]).getNumValues() - 1;
}
int[] coordinates = BeanUtils.indexToCoordinate(index, bounds);
int[] coordinates = BeanUtils.jobIndexToScanParameterCoordinate(index, bounds);
int localIndex = coordinates[java.util.Arrays.binarySearch(names, key)];
return getConstantArraySpec(key).getConstants()[localIndex].getExpression();
}
Expand Down
Loading
Loading