Skip to content

Commit

Permalink
fix(job/control): modify runner from template
Browse files Browse the repository at this point in the history
  • Loading branch information
soofstad committed Jan 10, 2024
1 parent 42f2673 commit a80060f
Show file tree
Hide file tree
Showing 17 changed files with 246 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "helloWorldLocalContainerRunner",
"type": "JOBCORE:LocalContainer",
"label": "Hello world",
"image": {
"type": "JOBCORE:ContainerImage",
"description": "Hello world test container",
"imageName": "hello-world",
"version": "latest",
"registryName": "library"
},
"network": "example_default",
"environmentVariables": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "reverseDescriptionRunner",
"type": "JOBCORE:ReverseDescription"
}
18 changes: 17 additions & 1 deletion example/app/data/DemoDataSource/recipes/job.recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,23 @@
"recipe": {
"name": "job-control",
"type": "CORE:UiRecipe",
"plugin": "@development-framework/dm-core-plugins/job/controls"
"plugin": "@development-framework/dm-core-plugins/job/controls",
"config": {
"type": "PLUGINS:dm-core-plugins/job/ControlConfig",
"recurring": false,
"runnerTemplates": [
{
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "dmss://DemoDataSource/plugins/job/helloWorldLocalContainerRunner",
"label": "Hello world"
},
{
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "dmss://DemoDataSource/plugins/job/reverseDescriptionRunner",
"label": "Reverse description"
}
]
}
}
},
"gridArea": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"type": "PLUGINS:dm-core-plugins/list/ListPluginConfig",
"templates": [
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._template_",
"label": "Template1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"type": "PLUGINS:dm-core-plugins/list/ListPluginConfig",
"templates": [
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[0]",
"label": "Template1"
},
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[1]",
"label": "Template2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@
"type": "PLUGINS:dm-core-plugins/table/TablePluginConfig",
"templates": [
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[0]",
"label": "Template1"
},
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[1]",
"label": "Template2"
},
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[2]",
"label": "Template3"
}
Expand Down Expand Up @@ -154,7 +154,7 @@
"type": "PLUGINS:dm-core-plugins/table/TablePluginConfig",
"templates": [
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[0]",
"label": "Template1"
}
Expand Down Expand Up @@ -219,7 +219,7 @@
"type": "PLUGINS:dm-core-plugins/table/TablePluginConfig",
"templates": [
{
"type": "PLUGINS:dm-core-plugins/table/Template",
"type": "PLUGINS:dm-core-plugins/common/Template",
"path": "~._templates_[0]",
"label": "Template1"
}
Expand Down
2 changes: 1 addition & 1 deletion example/app/data_sources/DemoDataSource.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "mongo-db",
"host": "db",
"port": 27017,
"username": "root",
"username": "maf",
"password": "xd7wCEhEx4kszsecYFfC",
"tls": false,
"database": "DemoDataSource",
Expand Down
2 changes: 1 addition & 1 deletion example/app/data_sources/ExtraDataSource.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "mongo-db",
"host": "db",
"port": 27017,
"username": "root",
"username": "maf",
"password": "xd7wCEhEx4kszsecYFfC",
"tls": false,
"database": "ExtraDataSource",
Expand Down
26 changes: 13 additions & 13 deletions example/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@ version: '3.4'

services:
dmss:
image: datamodelingtool.azurecr.io/dmss:v1.15.3
image: datamodelingtool.azurecr.io/dmss:v1.16.2
platform: linux/amd64
restart: unless-stopped
environment:
AUTH_ENABLED: 0
ENVIRONMENT: local
# RESET_DATA_SOURCE: off
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: xd7wCEhEx4kszsecYFfC
# RESET_DATA_SOURCE: off
MONGO_USERNAME: maf
MONGO_PASSWORD: xd7wCEhEx4kszsecYFfC
SECRET_KEY: sg9aeUM5i1JO4gNN8fQadokJa3_gXQMLBjSGGYcfscs= # Don't reuse this in production...
DATA_SOURCE_FILES: '{ "name": "system", "repositories": { "db": { "type": "mongo-db", "host": "db", "port": 27017, "username": "root", "password": "xd7wCEhEx4kszsecYFfC", "tls": false, "database": "DMSS-core", "collection": "DMSS-core" } }}'
# volumes:
# - ../../data-modelling-storage-service/src:/code/src
# volumes:
# - ../../data-modelling-storage-service/src:/code/src
ports:
- '5000:5000'
depends_on:
- db

db:
image: mongo:3.4
command: mongod --quiet
volumes:
- ./dmss-data/db:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_USERNAME: maf
MONGO_INITDB_ROOT_PASSWORD: xd7wCEhEx4kszsecYFfC
volumes:
- ./dmss-data/db:/data/db

job-api:
image: datamodelingtool.azurecr.io/dm-job:v1.4.2
image: datamodelingtool.azurecr.io/dm-job:v1.5.1
platform: linux/amd64
restart: unless-stopped
environment:
Expand All @@ -46,13 +44,15 @@ services:
AZURE_SP_SECRET: ${AZURE_SP_SECRET}
AZURE_JOB_TENANT_ID: 3aa4a235-b6e2-48d5-9195-7fcf05b459b0
AZURE_JOB_CLIENT_ID: 97a6b5bd-63fb-42c6-bb75-7e5de2394ba0
DATA_SOURCE_FILES: '{ "name": "WorkflowDS", "repositories": { "db": { "type": "mongo-db", "host": "db", "port": 27017, "username": "root", "password": "xd7wCEhEx4kszsecYFfC", "tls": false, "database": "workflowDS", "collection": "default", "data_types": [] } }}'
MONGO_PASSWORD: xd7wCEhEx4kszsecYFfC
#SIMA_LICENSE: |
depends_on:
- job-store
- db
volumes:
# - /var/run/docker.sock:/var/run/docker.sock # Needed for docker-in-docker jobs
- ./job_handlers:/code/src/job_handler_plugins
# - ../../dm-job/src/job_handler_plugins:/code/src/job_handler_plugins
ports:
- '5001:5000'

Expand Down
25 changes: 25 additions & 0 deletions packages/dm-core-plugins/blueprints/common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "common",
"type": "CORE:Package",
"isRoot": false,
"_meta_": {
"type": "CORE:Meta",
"version": "0.0.1",
"dependencies": [
{
"type": "CORE:Dependency",
"alias": "CORE",
"address": "system/SIMOS",
"version": "0.0.1",
"protocol": "dmss"
},
{
"type": "CORE:Dependency",
"alias": "PLUGINS",
"address": "system/Plugins",
"version": "0.0.1",
"protocol": "dmss"
}
]
}
}
25 changes: 25 additions & 0 deletions packages/dm-core-plugins/blueprints/job/ControlConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "ControlConfig",
"type": "CORE:Blueprint",
"description": "",
"attributes": [
{
"name": "type",
"type": "CORE:BlueprintAttribute",
"attributeType": "string"
},
{
"name": "recurring",
"type": "CORE:BlueprintAttribute",
"attributeType": "boolean",
"optional": true
},
{
"name": "runnerTemplates",
"type": "CORE:BlueprintAttribute",
"attributeType": "PLUGINS:dm-core-plugins/common/Template",
"optional": true,
"dimensions": "*"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"name": "templates",
"type": "CORE:BlueprintAttribute",
"description": "Attribute on parent (of same type as list) which should be used as template when instantiating new items. (e.g. 'template' will use the 'template' attribute on the parent.)",
"attributeType": "PLUGINS:dm-core-plugins/table/Template",
"attributeType": "PLUGINS:dm-core-plugins/common/Template",
"optional": true,
"dimensions": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"name": "templates",
"type": "CORE:BlueprintAttribute",
"description": "Attribute on parent (of same type as list) which should be used as template when instantiating new items. (e.g. 'template' will use the 'template' attribute on the parent.)",
"attributeType": "PLUGINS:dm-core-plugins/table/Template",
"attributeType": "PLUGINS:dm-core-plugins/common/Template",
"optional": true,
"dimensions": "*"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/dm-core-plugins/src/job/CronJob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export function ConfigureSchedule(props: {
<InputWrapper>
{showAdvanced ? (
<TextField
style={{ maxWidth: '400px' }}
unit='cron'
id='advanced-schedule-syntax'
type='text'
Expand All @@ -129,6 +130,7 @@ export function ConfigureSchedule(props: {
<Autocomplete
options={Object.values(EInterval)}
label={'Interval'}
style={{ maxWidth: '200px' }}
initialSelectedOptions={[interval]}
onInputChange={(label: string) => {
const chosenIntervalType = Object.entries(EInterval)
Expand All @@ -143,6 +145,7 @@ export function ConfigureSchedule(props: {
/>
{interval !== EInterval.HOURLY && (
<Autocomplete
style={{ maxWidth: '200px' }}
options={generateSelectableTimes().map(
(value: string) => value
)}
Expand All @@ -157,6 +160,7 @@ export function ConfigureSchedule(props: {
)}
{interval === EInterval.HOURLY && (
<Autocomplete
style={{ maxWidth: '200px' }}
options={[...Array(12).keys()].map((i) => i + 1)}
initialSelectedOptions={[Number(hourStep)]}
label={'Hour step'}
Expand Down
Loading

0 comments on commit a80060f

Please sign in to comment.