Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/DARPA-ASKEM/TERArium into T…
Browse files Browse the repository at this point in the history
…S/4840-project-download-upload-buttons
  • Loading branch information
Tom-Szendrey committed Sep 25, 2024
2 parents 28a91ea + 747f272 commit ba6ecb5
Show file tree
Hide file tree
Showing 65 changed files with 1,974 additions and 500 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/publish-text-extraction-taskrunner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
# Automatically build and publish the text-extraction-taskrunner to the container registry.
# This workflow is triggered on changes to the text-extraction-taskrunner directory.

name: Build and Publish text-extraction-taskrunner

# yamllint disable-line rule:truthy
on:
push:
paths:
- 'packages/taskrunner/**'
- 'packages/text_extraction/**'
branches:
- 'main'
tags:
- '*'

jobs:
image-tag:
name: Get tagged image name
uses: ./.github/workflows/image-tag.yml
with:
image-name: ghcr.io/darpa-askem/text-extraction-taskrunner

amd64:
runs-on: ubuntu-24.04
needs: image-tag
permissions:
contents: read
packages: write
steps:
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout the repository
uses: actions/checkout@v4

- name: Validate GradleW JAR
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java v17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle

- name: Create image and push
uses: docker/build-push-action@v5
with:
context: .
file: ./packages/text_extraction/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--amd64

arm64-emulation:
runs-on: ubuntu-24.04
needs: image-tag
permissions:
contents: read
packages: write
steps:
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Checkout the repository
uses: actions/checkout@v4

- name: Validate GradleW JAR
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java v17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle

- name: Create image and push
uses: docker/build-push-action@v5
with:
context: .
file: ./packages/text_extraction/Dockerfile
platforms: linux/arm64
push: true
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--arm64

merge-images:
name: Merge AMD64 and ARM64 images under one manifest
needs:
- image-tag
- amd64
- arm64-emulation
uses: ./.github/workflows/merge-images.yml
with:
name: ${{ needs.image-tag.outputs.tagged-image-name }}
23 changes: 23 additions & 0 deletions containers/scripts/docker-compose-taskrunner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,26 @@ services:
- ../../packages/equation_extraction:/equation_extraction_task
- ../../packages/taskrunner:/taskrunner
command: /equation_extraction_task/dev.sh

text_extraction-taskrunner:
build:
context: ../..
dockerfile: ./packages/text_extraction/Dockerfile
target: text_extraction_taskrunner_builder
container_name: text_extraction-taskrunner
networks:
- terarium
environment:
TERARIUM_MQ_ADDRESSES: "amqp://rabbitmq:5672"
TERARIUM_MQ_PASSWORD: "terarium123"
TERARIUM_MQ_USERNAME: "terarium"
TERARIUM_TASKRUNNER_REQUEST_TYPE: "text_extraction"
depends_on:
rabbitmq:
condition: service_healthy
extra_hosts:
- "${local_host_name}:host-gateway"
volumes:
- ../../packages/text_extraction:/text_extraction_task
- ../../packages/taskrunner:/taskrunner
command: /text_extraction_task/dev.sh
24 changes: 22 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function "check_suffix" {

# ---------------------------------
group "prod" {
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner"]
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner", "text-extraction-taskrunner", "equation-extraction-taskrunner"]
}

group "default" {
targets = ["hmi-client-base", "hmi-server-base", "gollm-taskrunner-base", "mira-taskrunner-base", "funman-taskrunner-base"]
targets = ["hmi-client-base", "hmi-server-base", "gollm-taskrunner-base", "mira-taskrunner-base", "funman-taskrunner-base", "text-extraction-taskrunner-base", "equation-extraction-taskrunner-base"]
}

# ---------------------------------
Expand Down Expand Up @@ -87,3 +87,23 @@ target "funman-taskrunner-base" {
target "funman-taskrunner" {
inherits = ["_platforms", "funman-taskrunner-base"]
}

target "equation-extraction-taskrunner-base" {
context = "." # root of the repo
dockerfile = "./packages/equation_extraction/Dockerfile"
tags = tag("equation-extraction-taskrunner", "", "")
}

target "equation-extraction-taskrunner" {
inherits = ["_platforms", "equation-extraction-taskrunner-base"]
}

target "text-extraction-taskrunner-base" {
context = "." # root of the repo
dockerfile = "./packages/text_extraction/Dockerfile"
tags = tag("text-extraction-taskrunner", "", "")
}

target "text-extraction-taskrunner" {
inherits = ["_platforms", "text-extraction-taskrunner-base"]
}
1 change: 1 addition & 0 deletions hmiServerDev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SECRET_FILES=()
SECRET_FILES+=("${SERVER_DIR}/src/main/resources/application-secrets.properties")
SECRET_FILES+=("containers/secrets.env")
VAULT_PASSWORD=""~/askem-vault-id.txt""
export COMPOSE_PROJECT_NAME="terarium"

function decrypt_secrets() {
echo "Decrypting local secrets vault"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@vue/eslint-config-airbnb-with-typescript": "7.0.1",
"eslint": "8.57.0",
"eslint": "8.57.1",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-vue": "9.27.0",
"husky": "8.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/graph-scaffolder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dagre": "0.8.5",
"esbuild": "0.23.1",
"esbuild-jest": "0.5.0",
"eslint": "8.57.0",
"eslint": "8.57.1",
"eslint-config-esnext": "4.1.0",
"eslint-plugin-import": "2.29.1",
"globby": "13.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/hmi-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"chroma-js": "2.4.2",
"d3": "7.8.5",
"dagre": "0.8.5",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-import-resolver-typescript": "3.6.3",
"event-source-polyfill": "1.0.31",
"extended-eventsource": "1.4.9",
"feather-icons": "4.29.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/client/hmi-client/src/assets/css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ a, div, em, figure, footer, form, h1, h2, h3, h4, h5, h6, header, img, li, ol, p
vertical-align: baseline;
}

/* Prevent font inheritance for KaTeX elements */
.katex * {
font-family: 'KaTeX_Main', 'Times New Roman', serif;
font-size: 1.1rem;
}

img {
display: block;
max-width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
/>
</template>
<template #footer>
<!--FIXME: This design is odd, since these buttons do the same thing-->
<Button label="OK" @click="emit('close-modal')" />
<Button severity="secondary" class="p-button-outlined" label="Cancel" @click="emit('close-modal')" />
</template>
</tera-modal>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
<br />
<template v-for="setting of selectedParameterSettings" :key="setting.id">
<vega-chart
v-if="preparedDistributionCharts[setting.selectedVariables[0]]"
expandable
:are-embed-actions-visible="true"
:visualization-spec="preparedDistributionCharts[setting.selectedVariables[0]].histogram"
Expand Down Expand Up @@ -734,16 +735,18 @@ const preparedCharts = computed(() => {
});
const preparedDistributionCharts = computed(() => {
if (!preparedChartInputs.value) return [];
if (!preparedChartInputs.value || _.isEmpty(pyciemssMap.value)) return {};
const { result } = preparedChartInputs.value;
// Note that we want to show the parameter distribution at the first timepoint only
const data = result.filter((d) => d.timepoint_id === 0);
const labelBefore = 'Before calibration';
const labelAfter = 'After calibration';
const charts = {};
selectedParameterSettings.value.forEach((setting) => {
const param = setting.selectedVariables[0];
const fieldName = pyciemssMap.value[param];
const beforeFieldName = `${fieldName}:pre`;
const histogram = createHistogramChart(result, {
const histogram = createHistogramChart(data, {
title: `${param}`,
width: chartSize.value.width,
height: chartSize.value.height,
Expand All @@ -758,10 +761,8 @@ const preparedDistributionCharts = computed(() => {
const toDisplayNumber = (num?: number) => (num ? displayNumber(num.toString()) : '');
const stat = {
header: [labelBefore, labelAfter],
mean: [mean(result, (d) => d[beforeFieldName]), mean(result, (d) => d[fieldName])].map(toDisplayNumber),
variance: [variance(result, (d) => d[beforeFieldName]), variance(result, (d) => d[fieldName])].map(
toDisplayNumber
)
mean: [mean(data, (d) => d[beforeFieldName]), mean(data, (d) => d[fieldName])].map(toDisplayNumber),
variance: [variance(data, (d) => d[beforeFieldName]), variance(data, (d) => d[fieldName])].map(toDisplayNumber)
};
charts[param] = { histogram, stat };
});
Expand Down
Loading

0 comments on commit ba6ecb5

Please sign in to comment.