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

Recursive dependency linking #1073

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1afdb18
Some Syntax refactoring with minimal impact except for readability
CodeByDrescher Dec 5, 2023
3f8936d
Finished prototype fix; need to test (and add unit tests)
CodeByDrescher Dec 5, 2023
c4961af
Fixing bugs; but getting nullptrexception
CodeByDrescher Dec 6, 2023
f16cea6
Added extra parsing
CodeByDrescher Dec 7, 2023
6a83283
Fixed bug where wrong link name was provided when providing an altern…
CodeByDrescher Dec 7, 2023
f6ab53b
removed old, broken method
CodeByDrescher Dec 7, 2023
f61e415
Small changes to remove all warnings.
CodeByDrescher Dec 7, 2023
04a1e73
Merge branch 'master' into RecursiveDependencyLinking
CodeByDrescher Dec 7, 2023
b22fdb0
Merge remote-tracking branch 'origin/master' into RecursiveDependency…
CodeByDrescher Dec 21, 2023
aa5e090
Refactor of Simulation-esk classes to new subfolder; No significant c…
CodeByDrescher Dec 22, 2023
dd63161
Updated Git Ignore
CodeByDrescher Jan 30, 2024
15e9169
Added null check to omex handler
CodeByDrescher Jan 30, 2024
db698d1
Upgraded solver version
CodeByDrescher Jan 30, 2024
5d6150c
Merge branch 'master' into RecursiveDependencyLinking
CodeByDrescher Jan 30, 2024
de6d02c
Removed deleted class' old import
CodeByDrescher Jan 30, 2024
a963852
Update ci_cd.yml to use 22.04
CodeByDrescher Jan 30, 2024
abb2549
Enforce docker container using Ubuntu 22.04
CodeByDrescher Jan 30, 2024
7f25fb6
Added min call to prevent StringIndexOutOfBoundsError
CodeByDrescher Jan 30, 2024
21562cc
switched os to ubuntu from debian
CodeByDrescher Jan 31, 2024
cbe3f29
Merge branch 'master' into RecursiveDependencyLinking
CodeByDrescher Jan 31, 2024
d4dd0a1
Added infrastructure to pipe error code to output
CodeByDrescher Feb 1, 2024
08d3eea
Revert "Added infrastructure to pipe error code to output"
CodeByDrescher Feb 1, 2024
5447d89
Merged in master changes
CodeByDrescher Feb 1, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
CI-Build:
name: CI-build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
if: ${{ failure() }}

CI-Test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
test-group: [Fast, MathGen_IT, SBML_IT, SEDML_SBML_IT, SEDML_VCML_IT, BSTS_IT]
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:

CD:
name: CD
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'release' }}

steps:
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17 as jre-build
FROM eclipse-temurin:17-jammy as jre-build

# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink \
Expand All @@ -10,13 +10,12 @@ RUN $JAVA_HOME/bin/jlink \
--output /javaruntime

# Define base image and copy in jlink created minimal Java 17 environment
FROM python:3.9.7-slim
FROM ubuntu:jammy
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

ARG SIMULATOR_VERSION="7.5.0.11"
ARG MAX_JAVA_MEM=0
# Make sure you don't sap all of docker's memory when you set this.
Expand Down Expand Up @@ -47,8 +46,11 @@ LABEL \
about.tags="rule-based modeling,kinetic modeling,dynamical simulation,systems biology,BNGL,SED-ML,COMBINE,OMEX" \
maintainer="BioSimulators Team <[email protected]>"

RUN apt-get -y update
RUN apt-get install -y --no-install-recommends curl dnsutils apt-utils libfreetype6 fontconfig fonts-dejavu
ENV DEBIAN_FRONTEND noninteractive
RUN apt -y update && apt install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa -y
RUN apt install -y --no-install-recommends curl python3.9-full python3-pip build-essential dnsutils \
apt-utils libfreetype6 fontconfig fonts-dejavu

RUN mkdir -p /usr/local/app/vcell/lib && \
mkdir -p /usr/local/app/vcell/simulation && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import cbit.vcell.server.SimulationJobStatusPersistent;
import cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus;
import cbit.vcell.server.SimulationStatusPersistent;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
import org.vcell.db.ConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
import cbit.vcell.modeldb.DatabaseServerImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.db.ConnectionFactory;
import org.vcell.util.DataAccessException;
import org.vcell.util.document.ExternalDataIdentifier;
import org.vcell.util.document.KeyValue;
import org.vcell.util.document.User;
import org.vcell.util.document.UserInfo;

import cbit.vcell.resource.PropertyLoader;
import cbit.vcell.solver.SimulationInfo;
import cbit.vcell.solver.simulation.SimulationInfo;
import cbit.vcell.util.AmplistorUtils;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import cbit.vcell.mapping.SimulationContext.MathMappingCallback;
import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements;
import cbit.vcell.mapping.SpeciesContextSpec;
import cbit.vcell.messaging.server.SimulationTask;
import cbit.vcell.messaging.server.StandardSimulationTask;
import cbit.vcell.modeldb.DatabasePolicySQL;
import cbit.vcell.modeldb.DatabaseServerImpl;
import cbit.vcell.modeldb.ServerDocumentManager;
Expand All @@ -24,6 +24,8 @@
import cbit.vcell.solver.ode.ODESimData;
import cbit.vcell.solver.server.Solver;
import cbit.vcell.solver.server.SolverStatus;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.simulation.SimulationJob;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
import cbit.vcell.xml.XmlParseException;
Expand Down Expand Up @@ -266,7 +268,7 @@ private static void runsolver(Simulation newSimulation, File baseDirectory, int
versSimulation = new TempSimulation(newSimulation, false);
// printout(ruleBasedTestDir.getAbsolutePath());
destDir = new File(baseDirectory,timeSeriesMultitrialData.datasetName);
SimulationTask simTask = new SimulationTask(new SimulationJob(versSimulation, 0, null),0);
StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(versSimulation, 0, null),0);
Solver solver = ClientSimManager.createQuickRunSolver(destDir, simTask);
solver.startSolver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements;
import cbit.vcell.mapping.SpeciesContextSpec;
import cbit.vcell.mathmodel.MathModel;
import cbit.vcell.messaging.server.SimulationTask;
import cbit.vcell.messaging.server.StandardSimulationTask;
import cbit.vcell.modeldb.VCDatabaseScanner;
import cbit.vcell.modeldb.VCDatabaseVisitor;
import cbit.vcell.simdata.ODEDataBlock;
Expand All @@ -18,6 +18,8 @@
import cbit.vcell.solver.ode.ODESimData;
import cbit.vcell.solver.server.Solver;
import cbit.vcell.solver.server.SolverStatus;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.simulation.SimulationJob;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
import com.google.gson.Gson;
Expand Down Expand Up @@ -128,7 +130,7 @@ private static void checkNonspatialStochasticSimContext(SimulationContext srcSim
srcSimContext.refreshMathDescription(new MathMappingCallbackTaskAdapter(null),networkGenerationRequirements);

//Create non-spatialStoch, ODE and RuleBased sims
Simulation nonspatialStochAppNewSim =
Simulation nonspatialStochAppNewSim =
srcSimContext.addNewSimulation(STOCH_SIM_NAME/*SimulationOwner.DEFAULT_SIM_NAME_PREFIX*/,new MathMappingCallbackTaskAdapter(null),networkGenerationRequirements);

Simulation newODEAppNewSim =
Expand Down Expand Up @@ -284,7 +286,7 @@ private static void runsolver(Simulation newSimulation, File baseDirectory, int
versSimulation = new TempSimulation(newSimulation, false);
// printout(ruleBasedTestDir.getAbsolutePath());
destDir = new File(baseDirectory,timeSeriesMultitrialData.datasetName);
SimulationTask simTask = new SimulationTask(new SimulationJob(versSimulation, 0, null),0);
StandardSimulationTask simTask = new StandardSimulationTask(new SimulationJob(versSimulation, 0, null),0);
Solver solver = ClientSimManager.createQuickRunSolver(destDir, simTask);
solver.startSolver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import cbit.vcell.simdata.ODEDataBlock;
import cbit.vcell.simdata.SimulationData;
import cbit.vcell.simdata.SimulationData.SimDataAmplistorInfo;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.SimulationInfo;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.simulation.SimulationInfo;
import cbit.vcell.solver.SolverDescription;
import cbit.vcell.solver.VCSimulationDataIdentifier;
import cbit.vcell.solver.VCSimulationIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import cbit.vcell.server.SimulationJobStatus;
import cbit.vcell.server.SimulationStatus;
import cbit.vcell.server.VCellConnection;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.VCSimulationIdentifier;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import cbit.vcell.simdata.DataSetMetadata;
import cbit.vcell.simdata.DataSetTimeSeries;
import cbit.vcell.solver.MathOverrides;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.VCSimulationDataIdentifier;
import cbit.vcell.solver.VCSimulationIdentifier;
import cbit.vcell.xml.XMLSource;
Expand All @@ -30,7 +30,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.restlet.representation.ByteArrayRepresentation;
import org.restlet.representation.FileRepresentation;
import org.vcell.rest.VCellApiApplication;
import org.vcell.rest.common.BiomodelOMEXResource;
import org.vcell.rest.common.OverrideRepresentation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import cbit.vcell.modeldb.SimContextRep;
import cbit.vcell.modeldb.SimulationRep;
import cbit.vcell.solver.MathOverrides;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
import freemarker.template.Configuration;
Expand Down
4 changes: 2 additions & 2 deletions vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void preprocessArchive() throws PythonStreamException, IOException {

// Unpack the Omex Archive
try { // It's unlikely, but if we get errors here they're fatal.
this.sedmlPath2d3d = Paths.get(outputDir, "temp");
this.omexHandler = new OmexHandler(inputFilePath, outputDir);
this.sedmlPath2d3d = Paths.get(outputDir, "temp");
this.omexHandler.extractOmex();
this.sedmlLocations = omexHandler.getSedmlLocationsAbsolute();
} catch (IOException e){
Expand All @@ -99,7 +99,7 @@ public void preprocessArchive() throws PythonStreamException, IOException {
logger.error(error);
throw new RuntimeException(error, e);
} catch (Exception e) {
omexHandler.deleteExtractedOmex();
if (omexHandler != null) omexHandler.deleteExtractedOmex();
String error = e.getMessage() + ", error for archive " + inputFilePath;
this.cliRecorder.writeErrorList(bioModelBaseName);
this.cliRecorder.writeDetailedResultList(bioModelBaseName + ", " + "unknown error with the archive file");
Expand Down
8 changes: 4 additions & 4 deletions vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cbit.vcell.parser.SymbolTable;
import cbit.vcell.simdata.*;
import cbit.vcell.solver.AnnotatedFunction;
import cbit.vcell.solver.SimulationJob;
import cbit.vcell.solver.simulation.SimulationJob;
import cbit.vcell.solver.VCSimulationDataIdentifier;
import cbit.vcell.solver.VCSimulationIdentifier;
import cbit.vcell.solver.ode.ODESolverResultSet;
Expand Down Expand Up @@ -166,7 +166,7 @@ public static void exportPDE2HDF5(SimulationJob vcellSimJob, File userDir, File
// A ton of initialization
int jobIndex = vcellSimJob.getJobIndex();
User user = new User(userDir.getName(), null);
cbit.vcell.solver.Simulation vcellSim = vcellSimJob.getSimulation();
cbit.vcell.solver.simulation.Simulation vcellSim = vcellSimJob.getSimulation();
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();

SimulationContext simContext = (SimulationContext)vcellSim.getSimulationOwner();
Expand Down Expand Up @@ -623,8 +623,8 @@ private static void exportDocument(ExportServiceImpl exportServiceImpl, DataServ
}

private static ExportSpecs getExportSpecs(OutputContext outputContext, User user, DataServerImpl dataServerImpl, VCSimulationDataIdentifier vcId,
DataSetControllerImpl dsControllerImpl, cbit.vcell.solver.Simulation vcellSim, int jobIndex,
VCSimulationIdentifier vcSimID, SimulationContext simContext) throws DataAccessException {
DataSetControllerImpl dsControllerImpl, cbit.vcell.solver.simulation.Simulation vcellSim, int jobIndex,
VCSimulationIdentifier vcSimID, SimulationContext simContext) throws DataAccessException {

PDEDataContext pdeDataContext = new ServerPDEDataContext(outputContext, user, dataServerImpl, vcId);
List<String> variableNames = RunUtils.getListOfVariableNames(pdeDataContext.getDataIdentifiers());
Expand Down
21 changes: 12 additions & 9 deletions vcell-cli/src/main/java/org/vcell/cli/run/SolverHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cbit.vcell.field.FieldDataIdentifierSpec;
import cbit.vcell.mapping.MathSymbolMapping;
import cbit.vcell.math.FunctionColumnDescription;
import cbit.vcell.messaging.server.SimulationTask;
import cbit.vcell.messaging.server.StandardSimulationTask;
import cbit.vcell.parser.Expression;
import cbit.vcell.parser.ExpressionException;
import cbit.vcell.parser.ExpressionMathMLParser;
Expand All @@ -17,6 +17,9 @@
import cbit.vcell.solver.server.Solver;
import cbit.vcell.solver.server.SolverFactory;
import cbit.vcell.solver.server.SolverStatus;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.solver.simulation.SimulationJob;
import cbit.vcell.solver.simulation.SimulationOwner;
import cbit.vcell.solver.stoch.GibsonSolver;
import cbit.vcell.solver.stoch.HybridSolver;
import cbit.vcell.solvers.AbstractCompiledSolver;
Expand Down Expand Up @@ -396,15 +399,15 @@ public void simulateAllTasks(ExternalDocInfo externalDocInfo, SedML sedml, CLIRe

AbstractTask task = tempSimulationToTaskMap.get(tempSimulationJob.getTempSimulation());

SimulationTask simTask;
String kisao = "null";
ODESolverResultSet odeSolverResultSet = null;
SolverTaskDescription std = null;
SolverDescription sd = null;
int solverStatus = SolverStatus.SOLVER_READY;
StandardSimulationTask simTask;
String kisao = "null";
ODESolverResultSet odeSolverResultSet = null;
SolverTaskDescription std = null;
SolverDescription sd = null;
int solverStatus = SolverStatus.SOLVER_READY;

Simulation sim = tempSimulationJob.getSimulation();
simTask = new SimulationTask(tempSimulationJob, 0);
Simulation sim = tempSimulationJob.getSimulation();
simTask = new StandardSimulationTask(tempSimulationJob, 0);
Span sim_span = null;
try {
sim_span = Tracer.startSpan(Span.ContextType.SIMULATION_RUN, sim.getName(), Map.of("simName", sim.getName()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.vcell.cli.run.hdf5;

import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.parser.ExpressionException;
import cbit.vcell.solver.TempSimulation;
import ncsa.hdf.hdf5lib.exceptions.HDF5Exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.vcell.cli.run.hdf5;

import cbit.vcell.modelopt.MathSystemHash;
import cbit.vcell.solver.Simulation;
import cbit.vcell.parser.ExpressionException;
import cbit.vcell.solver.TempSimulation;
import ncsa.hdf.hdf5lib.exceptions.HDF5Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import cbit.util.xml.VCLoggerException;
import cbit.util.xml.XmlUtil;
import cbit.vcell.biomodel.BioModel;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import cbit.vcell.xml.XmlHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cbit.vcell.mapping.SimulationContext;
import cbit.vcell.math.MathCompareResults;
import cbit.vcell.math.MathDescription;
import cbit.vcell.solver.SimulationSymbolTable;
import cbit.vcell.solver.simulation.SimulationSymbolTable;
import cbit.vcell.xml.XMLSource;
import cbit.vcell.xml.XmlHelper;
import org.apache.logging.log4j.LogManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ public void testBiosimulationsProject(String testCaseProjectID) throws Exception
computedH5File.toAbsolutePath().toString()
});
command.start(new int[] { 0, 1 });
assertFalse(command.getStdoutString().contains("position"), "H5 files have significant differences: " +
command.getStdoutString().substring(0, 300));
String stdOutString = command.getStdoutString();
assertFalse(stdOutString.contains("position"), "H5 files have significant differences: " +
stdOutString.substring(0, Math.min(300, stdOutString.length())));

} catch (Exception | AssertionError e){
FAULT fault = this.determineFault(e);
Expand Down
12 changes: 1 addition & 11 deletions vcell-client/src/main/java/cbit/plot/gui/Plot2DDataPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,27 @@
*/

package cbit.plot.gui;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.ListIterator;
import java.util.Vector;

import javax.swing.ButtonGroup;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButton;
import javax.swing.KeyStroke;
import javax.swing.table.DefaultTableModel;

import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.util.UtilCancelException;
import org.vcell.util.gui.DialogUtils;
import org.vcell.util.gui.NonEditableDefaultTableModel;
import org.vcell.util.gui.ScrollTable;
import org.vcell.util.gui.SimpleUserMessage;
import org.vcell.util.gui.SpecialtyTableRenderer;

import com.google.common.io.Files;
Expand All @@ -47,11 +39,9 @@
import cbit.vcell.desktop.VCellTransferable;
import cbit.vcell.math.ReservedVariable;
import cbit.vcell.parser.Expression;
import cbit.vcell.parser.SimpleSymbolTable;
import cbit.vcell.parser.SymbolTableEntry;
import cbit.vcell.simdata.Hdf5Utils;
import cbit.vcell.simdata.Hdf5Utils.HDF5WriteHelper;
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.simulation.Simulation;
import ncsa.hdf.hdf5lib.H5;
import ncsa.hdf.hdf5lib.HDF5Constants;
import javax.swing.JLabel;
Expand Down
Loading
Loading