From d31840640210ab63ff2d42faa2c6314ea8b44222 Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Tue, 23 Apr 2024 11:35:01 -1000 Subject: [PATCH 1/4] Added support for multiple parameter dictionaries --- .../databases/AerieSequencing/tables/public_parcel.yaml | 5 +---- docker-compose.yml | 4 ++-- sequencing-server/sql/sequencing/tables/parcel.sql | 3 --- .../sql/sequencing/tables/parcel_to_parameter_dictionary.sql | 4 +++- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml index af862ade23..21dce10f25 100644 --- a/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml +++ b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml @@ -5,9 +5,6 @@ object_relationships: - name: command_dictionary using: foreign_key_constraint_on: command_dictionary_id - - name: parameter_dictionary - using: - foreign_key_constraint_on: parameter_dictionary_id - name: sequence_adaptation using: foreign_key_constraint_on: sequence_adaptation_id @@ -47,5 +44,5 @@ delete_permissions: update_permissions: - role: aerie_admin permission: - columns: [command_dictionary_id, name, parameter_dictionary_id, sequence_adaptation_id] + columns: [command_dictionary_id, name, sequence_adaptation_id] filter: {} diff --git a/docker-compose.yml b/docker-compose.yml index 9e1f6a80cc..b5d82eac2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: POSTGRES_PASSWORD: "${AERIE_PASSWORD}" POSTGRES_PORT: 5432 POSTGRES_USER: "${AERIE_USERNAME}" - image: "ghcr.io/nasa-ammos/aerie-gateway:develop" + image: "ghcr.io/nasa-ammos/aerie-gateway:v2.6.2" ports: ["9000:9000"] restart: always volumes: @@ -94,7 +94,7 @@ services: SEQUENCING_LOCAL_STORE: /usr/src/app/sequencing_file_store SEQUENCING_WORKER_NUM: 8 SEQUENCING_MAX_WORKER_HEAP_MB: 1000 - TRANSPILER_ENABLED : "true" + TRANSPILER_ENABLED: "true" image: aerie_sequencing ports: ["27184:27184"] restart: always diff --git a/sequencing-server/sql/sequencing/tables/parcel.sql b/sequencing-server/sql/sequencing/tables/parcel.sql index cfade91193..ae6ac655a1 100644 --- a/sequencing-server/sql/sequencing/tables/parcel.sql +++ b/sequencing-server/sql/sequencing/tables/parcel.sql @@ -4,7 +4,6 @@ create table parcel ( name text not null, command_dictionary_id integer not null, - parameter_dictionary_id integer not null, sequence_adaptation_id integer default null, created_at timestamptz not null default now(), @@ -16,8 +15,6 @@ create table parcel ( foreign key (command_dictionary_id) references command_dictionary (id), - foreign key (parameter_dictionary_id) - references parameter_dictionary (id), foreign key (sequence_adaptation_id) references sequence_adaptation (id) ); diff --git a/sequencing-server/sql/sequencing/tables/parcel_to_parameter_dictionary.sql b/sequencing-server/sql/sequencing/tables/parcel_to_parameter_dictionary.sql index 30c9891535..2c2c4ff343 100644 --- a/sequencing-server/sql/sequencing/tables/parcel_to_parameter_dictionary.sql +++ b/sequencing-server/sql/sequencing/tables/parcel_to_parameter_dictionary.sql @@ -1,9 +1,11 @@ create table parcel_to_parameter_dictionary ( + id integer generated always as identity, + parcel_id integer not null, parameter_dictionary_id integer not null, constraint parcel_to_parameter_dictionary_synthetic_key - primary key (parcel_id, parameter_dictionary_id), + primary key (id), foreign key (parcel_id) references parcel (id) From 5a8c2bd18ba5d1c4c804344cd1f92f0b3e6cc16d Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Thu, 25 Apr 2024 07:59:26 -1000 Subject: [PATCH 2/4] Added channel dictionary tables and hasura metadata --- .../tables/public_channel_dictionary.yaml | 28 +++++++++++++++++++ .../AerieSequencing/tables/public_parcel.yaml | 5 +++- .../AerieSequencing/tables/tables.yaml | 1 + sequencing-server/sql/sequencing/init.sql | 1 + .../sequencing/tables/channel_dictionary.sql | 27 ++++++++++++++++++ .../sql/sequencing/tables/parcel.sql | 3 ++ 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 deployment/hasura/metadata/databases/AerieSequencing/tables/public_channel_dictionary.yaml create mode 100644 sequencing-server/sql/sequencing/tables/channel_dictionary.sql diff --git a/deployment/hasura/metadata/databases/AerieSequencing/tables/public_channel_dictionary.yaml b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_channel_dictionary.yaml new file mode 100644 index 0000000000..976c759082 --- /dev/null +++ b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_channel_dictionary.yaml @@ -0,0 +1,28 @@ +table: + name: channel_dictionary + schema: public +insert_permissions: + - role: aerie_admin + permission: + columns: "*" + check: {} +select_permissions: + - role: aerie_admin + permission: + columns: "*" + filter: {} + allow_aggregations: true + - role: user + permission: + columns: "*" + filter: {} + allow_aggregations: true + - role: viewer + permission: + columns: "*" + filter: {} + allow_aggregations: true +delete_permissions: + - role: aerie_admin + permission: + filter: {} diff --git a/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml index 21dce10f25..8ed3d7c3ff 100644 --- a/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml +++ b/deployment/hasura/metadata/databases/AerieSequencing/tables/public_parcel.yaml @@ -2,6 +2,9 @@ table: name: parcel schema: public object_relationships: + - name: channel_dictionary + using: + foreign_key_constraint_on: channel_dictionary_id - name: command_dictionary using: foreign_key_constraint_on: command_dictionary_id @@ -44,5 +47,5 @@ delete_permissions: update_permissions: - role: aerie_admin permission: - columns: [command_dictionary_id, name, sequence_adaptation_id] + columns: [channel_dictionary_id, command_dictionary_id, name, sequence_adaptation_id] filter: {} diff --git a/deployment/hasura/metadata/databases/AerieSequencing/tables/tables.yaml b/deployment/hasura/metadata/databases/AerieSequencing/tables/tables.yaml index 83eae1c59c..54dec0a9ff 100644 --- a/deployment/hasura/metadata/databases/AerieSequencing/tables/tables.yaml +++ b/deployment/hasura/metadata/databases/AerieSequencing/tables/tables.yaml @@ -1,4 +1,5 @@ - "!include public_activity_instance_commands.yaml" +- "!include public_channel_dictionary.yaml" - "!include public_command_dictionary.yaml" - "!include public_expansion_rule.yaml" - "!include public_expansion_run.yaml" diff --git a/sequencing-server/sql/sequencing/init.sql b/sequencing-server/sql/sequencing/init.sql index cc39decde5..f847b1b878 100644 --- a/sequencing-server/sql/sequencing/init.sql +++ b/sequencing-server/sql/sequencing/init.sql @@ -9,6 +9,7 @@ begin; \ir applied_migrations.sql -- Command Expansion Tables. + \ir tables/channel_dictionary.sql \ir tables/command_dictionary.sql \ir tables/parameter_dictionary.sql \ir tables/sequence_adaptation.sql diff --git a/sequencing-server/sql/sequencing/tables/channel_dictionary.sql b/sequencing-server/sql/sequencing/tables/channel_dictionary.sql new file mode 100644 index 0000000000..4b8876e174 --- /dev/null +++ b/sequencing-server/sql/sequencing/tables/channel_dictionary.sql @@ -0,0 +1,27 @@ +create table channel_dictionary ( + id integer generated always as identity, + + mission text not null, + version text not null, + parsed_json jsonb not null default '{}', + + created_at timestamptz not null default now(), + + constraint channel_dictionary_synthetic_key + primary key (id), + constraint channel_dictionary_natural_key + unique (mission,version) +); + +comment on table channel_dictionary is e'' + 'A Channel Dictionary for a mission.'; +comment on column channel_dictionary.id is e'' + 'The synthetic identifier for this channel dictionary.'; +comment on column channel_dictionary.mission is e'' + 'A human-meaningful identifier for the mission described by the channel dictionary'; +comment on column channel_dictionary.version is e'' + 'A human-meaningful version qualifier.'; +comment on column channel_dictionary.parsed_json is e'' + 'The XML that has been parsed and converted to JSON'; +comment on constraint channel_dictionary_natural_key on channel_dictionary is e'' + 'There can only be one channel dictionary of a given version for a given mission.'; diff --git a/sequencing-server/sql/sequencing/tables/parcel.sql b/sequencing-server/sql/sequencing/tables/parcel.sql index ae6ac655a1..b6d72ea45f 100644 --- a/sequencing-server/sql/sequencing/tables/parcel.sql +++ b/sequencing-server/sql/sequencing/tables/parcel.sql @@ -3,6 +3,7 @@ create table parcel ( name text not null, + channel_dictionary_id integer not null, command_dictionary_id integer not null, sequence_adaptation_id integer default null, @@ -13,6 +14,8 @@ create table parcel ( constraint parcel_synthetic_key primary key (id), + foreign key (channel_dictionary_id) + references channel_dictionary (id), foreign key (command_dictionary_id) references command_dictionary (id), foreign key (sequence_adaptation_id) From 6f8ea0ab6c12a0fbbf9209595c66b945bab6fe95 Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Thu, 25 Apr 2024 11:15:16 -1000 Subject: [PATCH 3/4] Fixed command_types_typescript_path being removed while rebasing --- sequencing-server/sql/sequencing/tables/command_dictionary.sql | 3 +++ sequencing-server/sql/sequencing/tables/parcel.sql | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sequencing-server/sql/sequencing/tables/command_dictionary.sql b/sequencing-server/sql/sequencing/tables/command_dictionary.sql index 4c6d98b379..534b434788 100644 --- a/sequencing-server/sql/sequencing/tables/command_dictionary.sql +++ b/sequencing-server/sql/sequencing/tables/command_dictionary.sql @@ -1,6 +1,7 @@ create table command_dictionary ( id integer generated always as identity, + command_types_typescript_path text not null, mission text not null, version text not null, parsed_json jsonb not null default '{}', @@ -17,6 +18,8 @@ comment on table command_dictionary is e'' 'A Command Dictionary for a mission.'; comment on column command_dictionary.id is e'' 'The synthetic identifier for this command dictionary.'; +comment on column command_dictionary.command_types_typescript_path is e'' + 'The location of command dictionary types (.ts) on the filesystem'; comment on column command_dictionary.mission is e'' 'A human-meaningful identifier for the mission described by the command dictionary'; comment on column command_dictionary.version is e'' diff --git a/sequencing-server/sql/sequencing/tables/parcel.sql b/sequencing-server/sql/sequencing/tables/parcel.sql index b6d72ea45f..d838be5355 100644 --- a/sequencing-server/sql/sequencing/tables/parcel.sql +++ b/sequencing-server/sql/sequencing/tables/parcel.sql @@ -3,7 +3,7 @@ create table parcel ( name text not null, - channel_dictionary_id integer not null, + channel_dictionary_id integer default null, command_dictionary_id integer not null, sequence_adaptation_id integer default null, From 967da12ce92e02c88981d244183d424b04cfc7fa Mon Sep 17 00:00:00 2001 From: Chet Joswig Date: Fri, 26 Apr 2024 12:18:51 -0700 Subject: [PATCH 4/4] update aerie-ampcs to 1.0.5 --- sequencing-server/package-lock.json | 12 ++++++------ sequencing-server/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sequencing-server/package-lock.json b/sequencing-server/package-lock.json index 36991abba0..924d3905ae 100644 --- a/sequencing-server/package-lock.json +++ b/sequencing-server/package-lock.json @@ -1176,9 +1176,9 @@ "dev": true }, "node_modules/@nasa-jpl/aerie-ampcs": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@nasa-jpl/aerie-ampcs/-/aerie-ampcs-1.0.4.tgz", - "integrity": "sha512-Q+xAm8qYmnSC9VtBm+L+bTNOvSsq4g0Hd//QlB8rsRslU7Rc0xfV+ROeBcSOGalnnzyP1Dwo3PgqrXFB01gKNQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@nasa-jpl/aerie-ampcs/-/aerie-ampcs-1.0.5.tgz", + "integrity": "sha512-IBz57zw2HlTVJcPXPLq56OzMJ7LAK4uWPgrC5yh9+x4UM7WS46cW9AbdbiYWpIOMh8zW+/UWju7QqszowIKTTQ==", "dependencies": { "xml-js": "^1.6.11" } @@ -6652,9 +6652,9 @@ "dev": true }, "@nasa-jpl/aerie-ampcs": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@nasa-jpl/aerie-ampcs/-/aerie-ampcs-1.0.4.tgz", - "integrity": "sha512-Q+xAm8qYmnSC9VtBm+L+bTNOvSsq4g0Hd//QlB8rsRslU7Rc0xfV+ROeBcSOGalnnzyP1Dwo3PgqrXFB01gKNQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@nasa-jpl/aerie-ampcs/-/aerie-ampcs-1.0.5.tgz", + "integrity": "sha512-IBz57zw2HlTVJcPXPLq56OzMJ7LAK4uWPgrC5yh9+x4UM7WS46cW9AbdbiYWpIOMh8zW+/UWju7QqszowIKTTQ==", "requires": { "xml-js": "^1.6.11" } diff --git a/sequencing-server/package.json b/sequencing-server/package.json index 7498cdeb22..161591b663 100644 --- a/sequencing-server/package.json +++ b/sequencing-server/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@js-temporal/polyfill": "~0.4.3", - "@nasa-jpl/aerie-ampcs": "~1.0.4", + "@nasa-jpl/aerie-ampcs": "~1.0.5", "@nasa-jpl/aerie-ts-user-code-runner": "~0.6.0", "@nasa-jpl/seq-json-schema": "1.0.19", "body-parser": "~1.20.1",