Skip to content

Commit

Permalink
4431 bug extracted values (#4510)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgauldie authored Aug 20, 2024
1 parent 664b3c0 commit 475450e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 33 deletions.
19 changes: 16 additions & 3 deletions packages/gollm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get install -y --no-install-recommends \

Check failure on line 13 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
python3.10 \
software-properties-common \
python3.11 \
python3.11-venv \
python3.11-dev \
wget \
python3-pip && \
rm -rf /var/lib/apt/lists/*

# Set the default Python version to 3.11
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \
update-alternatives --set python /usr/bin/python3.11

RUN python -m ensurepip --upgrade

# Verify the installation
RUN python --version

Check failure on line 29 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
RUN pip3 --version

Check failure on line 30 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

# Install gollm
COPY ./packages/gollm/gollm-version.txt /gollmVersion.txt
RUN COMMIT_SHA="$(cat /gollmVersion.txt)" && \
Expand All @@ -25,7 +38,7 @@ RUN COMMIT_SHA="$(cat /gollmVersion.txt)" && \
rm gollm.tar.gz && \
mv GoLLM-* GoLLM
WORKDIR /GoLLM
RUN pip install --no-cache-dir .
RUN pip3 install --no-cache-dir .

#^^^^^^^^^^^^^^^^^^^^
######################
Expand All @@ -41,7 +54,7 @@ WORKDIR /
# ------------------------------------------------------------------------------

# Set up the Python image with JRE
FROM python:3.10-slim
FROM python:3.11-slim

WORKDIR /

Expand Down
6 changes: 3 additions & 3 deletions packages/gollm/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# ensure the volume mounted python code is using editable mode
echo "Installing python tasks"
cd /gollm_task
pip install -e .
pip3 install -e .

# run it
echo "Running taskrunner"
cd /taskrunner
pip install -e .
pip3 install -e .

BUILD_DIR=/taskrunner-build-mira
BUILD_DIR=/taskrunner-build-gollm
mkdir -p $BUILD_DIR
./gradlew --project-cache-dir /tmp/.gradle/$$ -PcustomBuildDir=$BUILD_DIR bootRun
2 changes: 1 addition & 1 deletion packages/gollm/gollm-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d9b8b5a61dc09c34e17d2172752b2441391cbfab
073170a166ce947479d1b29dc884df7a549d2afa
2 changes: 1 addition & 1 deletion packages/gollm/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"gollm_task:generate_summary=tasks.generate_summary:main",
],
},
python_requires=">=3.8",
python_requires=">=3.11",
)
2 changes: 1 addition & 1 deletion packages/mira/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ echo "Running taskrunner"
cd /taskrunner
pip install -e .

BUILD_DIR=/taskrunner-build-gollm
BUILD_DIR=/taskrunner-build-mira
mkdir -p $BUILD_DIR
./gradlew --project-cache-dir /tmp/.gradle/$$ -PcustomBuildDir=$BUILD_DIR bootRun
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
import java.util.UUID;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import software.uncharted.terarium.hmiserver.models.dataservice.model.Model;
import software.uncharted.terarium.hmiserver.models.dataservice.model.configurations.ModelConfiguration;
import software.uncharted.terarium.hmiserver.models.dataservice.modelparts.ModelParameter;
import software.uncharted.terarium.hmiserver.models.dataservice.modelparts.semantics.Initial;
import software.uncharted.terarium.hmiserver.models.dataservice.provenance.Provenance;
import software.uncharted.terarium.hmiserver.models.dataservice.provenance.ProvenanceRelationType;
import software.uncharted.terarium.hmiserver.models.dataservice.provenance.ProvenanceType;
import software.uncharted.terarium.hmiserver.models.task.TaskResponse;
import software.uncharted.terarium.hmiserver.service.data.ModelConfigurationService;
import software.uncharted.terarium.hmiserver.service.data.ModelService;
import software.uncharted.terarium.hmiserver.service.data.ProvenanceService;
import software.uncharted.terarium.hmiserver.service.gollm.ScenarioExtraction;

@Component
@RequiredArgsConstructor
Expand Down Expand Up @@ -76,26 +72,7 @@ public TaskResponse onSuccess(final TaskResponse resp) {

// For each configuration, create a new model configuration with parameters set
for (final JsonNode condition : configurations.response.get("conditions")) {
final Model modelCopy = model.clone();
modelCopy.setId(model.getId());
ScenarioExtraction.setNullDefaultModelInitials(modelCopy);
ScenarioExtraction.setNullDefaultModelParameters(modelCopy);
// Map the parameters values to the model
if (condition.has("parameters")) {
ScenarioExtraction.getModelParameters(condition.get("parameters"), modelCopy);
}

// Map the initials values to the model
if (condition.has("initials")) {
ScenarioExtraction.getModelInitials(condition.get("initials"), modelCopy);
}

// Create the new configuration
final ModelConfiguration configuration = ModelConfigurationService.modelConfigurationFromAMR(
modelCopy,
condition.get("name").asText(),
condition.get("description").asText()
);
final ModelConfiguration configuration = objectMapper.treeToValue(condition, ModelConfiguration.class);

final ModelConfiguration newConfig = modelConfigurationService.createAsset(
configuration,
Expand Down

0 comments on commit 475450e

Please sign in to comment.