diff --git a/dbrepo-metadata-db/setup-schema.sql b/dbrepo-metadata-db/setup-schema.sql index f3de67233f485a0c9689da14ef6a55559331f78d..ce9488685b8592ea9169c810b075087574fc2325 100644 --- a/dbrepo-metadata-db/setup-schema.sql +++ b/dbrepo-metadata-db/setup-schema.sql @@ -1,550 +1,550 @@ -BEGIN; - -CREATE TABLE IF NOT EXISTS `mdb_users` -( - id character varying(36) NOT NULL, - username character varying(255) NOT NULL, - firstname character varying(255), - lastname character varying(255), - email character varying(255) NOT NULL, - orcid character varying(255), - affiliation character varying(255), - mariadb_password character varying(255) NOT NULL, - theme_dark boolean, - PRIMARY KEY (id), - UNIQUE (username), - UNIQUE (email) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_images` -( - id bigint NOT NULL AUTO_INCREMENT, - name character varying(255) NOT NULL, - version character varying(255) NOT NULL, - default_port integer NOT NULL, - dialect character varying(255) NOT NULL, - driver_class character varying(255) NOT NULL, - jdbc_method character varying(255) NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - last_modified timestamp, - PRIMARY KEY (id), - UNIQUE (name, version) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_images_date` -( - id bigint NOT NULL AUTO_INCREMENT, - iid bigint NOT NULL, - database_format character varying(255) NOT NULL, - unix_format character varying(255) NOT NULL, - example character varying(255) NOT NULL, - has_time boolean NOT NULL, - created_at timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (id), - FOREIGN KEY (iid) REFERENCES mdb_images (id), - UNIQUE (database_format, unix_format, example) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_containers` -( - id bigint NOT NULL AUTO_INCREMENT, - internal_name character varying(255) NOT NULL, - name character varying(255) NOT NULL, - host character varying(255) NOT NULL, - port integer NOT NULL default 3306, - ui_host character varying(255) NOT NULL default host, - ui_port integer NOT NULL default port, - ui_additional_flags text, - sidecar_host character varying(255) NOT NULL, - sidecar_port integer NOT NULL default 3305, - image_id bigint NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - last_modified timestamp, - privileged_username character varying(255) NOT NULL, - privileged_password character varying(255) NOT NULL, - PRIMARY KEY (id), - FOREIGN KEY (image_id) REFERENCES mdb_images (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_data` -( - ID bigint NOT NULL AUTO_INCREMENT, - PROVENANCE text, - FileEncoding text, - FileType character varying(100), - Version text, - Seperator text, - PRIMARY KEY (ID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_licenses` -( - identifier character varying(255) NOT NULL, - uri text NOT NULL, - PRIMARY KEY (identifier), - UNIQUE (uri(200)) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_databases` -( - id bigint NOT NULL AUTO_INCREMENT, - cid bigint NOT NULL, - name character varying(255) NOT NULL, - internal_name character varying(255) NOT NULL, - exchange_name character varying(255) NOT NULL, - description text, - engine character varying(20), - is_public boolean NOT NULL DEFAULT TRUE, - image longblob, - created_by character varying(36), - owned_by character varying(36), - contact_person character varying(36), - created timestamp NOT NULL DEFAULT NOW(), - last_modified timestamp, - PRIMARY KEY (id), - FOREIGN KEY (cid) REFERENCES mdb_containers (id) /* currently we only support one-to-one */, - FOREIGN KEY (created_by) REFERENCES mdb_users (id), - FOREIGN KEY (owned_by) REFERENCES mdb_users (id), - FOREIGN KEY (contact_person) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_databases_subjects` -( - dbid BIGINT NOT NULL, - subjects character varying(255) NOT NULL, - PRIMARY KEY (dbid, subjects) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_tables` -( - ID bigint NOT NULL AUTO_INCREMENT, - tDBID bigint NOT NULL, - internal_name character varying(255) NOT NULL, - queue_name character varying(255) NOT NULL, - routing_key character varying(255) NOT NULL, - tName VARCHAR(50), - tDescription TEXT, - num_rows BIGINT, - data_length BIGINT, - max_data_length BIGINT, - avg_row_length BIGINT, - `separator` CHAR(1), - quote CHAR(1), - element_null VARCHAR(50), - skip_lines BIGINT, - element_true VARCHAR(50), - element_false VARCHAR(50), - Version TEXT, - created timestamp NOT NULL DEFAULT NOW(), - versioned boolean not null default true, - created_by character varying(36) NOT NULL, - owned_by character varying(36) NOT NULL, - last_modified timestamp, - PRIMARY KEY (ID), - FOREIGN KEY (tDBID) REFERENCES mdb_databases (id), - FOREIGN KEY (created_by) REFERENCES mdb_users (id), - FOREIGN KEY (owned_by) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns` -( - ID BIGINT NOT NULL AUTO_INCREMENT, - tID BIGINT NOT NULL, - dfID BIGINT, - cName VARCHAR(100), - internal_name VARCHAR(100) NOT NULL, - alias VARCHAR(100), - Datatype ENUM ('CHAR','VARCHAR','BINARY','VARBINARY','TINYBLOB','TINYTEXT','TEXT','BLOB','MEDIUMTEXT','MEDIUMBLOB','LONGTEXT','LONGBLOB','ENUM','SET','BIT','TINYINT','BOOL','SMALLINT','MEDIUMINT','INT','BIGINT','FLOAT','DOUBLE','DECIMAL','DATE','DATETIME','TIMESTAMP','TIME','YEAR'), - length BIGINT NULL, - ordinal_position INTEGER NOT NULL, - is_primary_key BOOLEAN NOT NULL, - index_length BIGINT NULL, - size BIGINT, - d BIGINT, - auto_generated BOOLEAN DEFAULT false, - is_null_allowed BOOLEAN NOT NULL DEFAULT true, - val_min NUMERIC NULL, - val_max NUMERIC NULL, - mean NUMERIC NULL, - median NUMERIC NULL, - std_dev Numeric NULL, - created timestamp NOT NULL DEFAULT NOW(), - last_modified timestamp, - FOREIGN KEY (tID) REFERENCES mdb_tables (ID) ON DELETE CASCADE, - PRIMARY KEY (ID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_enums` -( - id bigint NOT NULL AUTO_INCREMENT, - column_id bigint NOT NULL, - value CHARACTER VARYING(255) NOT NULL, - FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, - PRIMARY KEY (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_sets` -( - id bigint NOT NULL AUTO_INCREMENT, - column_id bigint NOT NULL, - value CHARACTER VARYING(255) NOT NULL, - FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, - PRIMARY KEY (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_nom` -( - tID bigint, - cID bigint, - maxlength INTEGER, - last_modified timestamp, - created timestamp NOT NULL DEFAULT NOW(), - FOREIGN KEY (tID, cID) REFERENCES mdb_columns (tID, ID), - PRIMARY KEY (tID, cID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_cat` -( - tID bigint, - cID bigint, - num_cat INTEGER, - -- cat_array TEXT[], - last_modified timestamp, - created timestamp NOT NULL DEFAULT NOW(), - FOREIGN KEY (tID, cID) REFERENCES mdb_columns (tID, ID), - PRIMARY KEY (tID, cID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_constraints_foreign_key` -( - fkid BIGINT NOT NULL AUTO_INCREMENT, - tid BIGINT NOT NULL, - rtid BIGINT NOT NULL, - on_update VARCHAR(50) NULL, - on_delete VARCHAR(50) NULL, - position INT NULL, - PRIMARY KEY (fkid), - FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE, - FOREIGN KEY (rtid) REFERENCES mdb_tables (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_constraints_foreign_key_reference` -( - id BIGINT NOT NULL AUTO_INCREMENT, - fkid BIGINT NOT NULL, - cid BIGINT NOT NULL, - rcid BIGINT NOT NULL, - PRIMARY KEY (id), - FOREIGN KEY (fkid) REFERENCES mdb_constraints_foreign_key (fkid) ON UPDATE CASCADE, - FOREIGN KEY (cid) REFERENCES mdb_columns (id), - FOREIGN KEY (rcid) REFERENCES mdb_columns (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_constraints_unique` -( - uid BIGINT NOT NULL AUTO_INCREMENT, - tid BIGINT NOT NULL, - position INT NULL, - PRIMARY KEY (uid), - FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE -); - -CREATE TABLE IF NOT EXISTS `mdb_constraints_unique_columns` -( - id BIGINT NOT NULL AUTO_INCREMENT, - uid BIGINT NOT NULL, - cid BIGINT NOT NULL, - PRIMARY KEY (id), - FOREIGN KEY (uid) REFERENCES mdb_constraints_unique (uid), - FOREIGN KEY (cid) REFERENCES mdb_columns (id) ON DELETE CASCADE -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_constraints_checks` -( - id BIGINT NOT NULL AUTO_INCREMENT, - tid BIGINT NOT NULL, - checks VARCHAR(255) NOT NULL, - PRIMARY KEY (id), - FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_concepts` -( - id bigint NOT NULL AUTO_INCREMENT, - uri text not null, - name VARCHAR(255) null, - description TEXT null, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (id), - UNIQUE (uri(200)) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_units` -( - id bigint NOT NULL AUTO_INCREMENT, - uri text not null, - name VARCHAR(255) null, - description TEXT null, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (id), - UNIQUE (uri(200)) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_concepts` -( - id bigint NOT NULL, - cID bigint NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (id, cid), - FOREIGN KEY (cID) REFERENCES mdb_columns (ID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_units` -( - id bigint NOT NULL, - cID bigint NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (id, cID), - FOREIGN KEY (cID) REFERENCES mdb_columns (ID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_view` -( - id bigint NOT NULL AUTO_INCREMENT, - vdbid bigint NOT NULL, - vName VARCHAR(255) NOT NULL, - internal_name VARCHAR(255) NOT NULL, - Query TEXT NOT NULL, - query_hash VARCHAR(255) NOT NULL, - Public BOOLEAN NOT NULL, - InitialView BOOLEAN NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - last_modified timestamp, - created_by character varying(36) NOT NULL, - PRIMARY KEY (id), - FOREIGN KEY (vdbid) REFERENCES mdb_databases (id), - FOREIGN KEY (created_by) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_banner_messages` -( - id bigint NOT NULL AUTO_INCREMENT, - type ENUM ('ERROR', 'WARNING', 'INFO') NOT NULL default 'INFO', - message TEXT NOT NULL, - link TEXT NULL, - link_text VARCHAR(255) NULL, - display_start timestamp NULL, - display_end timestamp NULL, - PRIMARY KEY (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_ontologies` -( - id bigint NOT NULL AUTO_INCREMENT, - prefix VARCHAR(8) NOT NULL, - uri TEXT NOT NULL, - uri_pattern TEXT, - sparql_endpoint TEXT NULL, - rdf_path TEXT NULL, - last_modified timestamp, - created timestamp NOT NULL DEFAULT NOW(), - UNIQUE (prefix), - UNIQUE (uri(200)), - PRIMARY KEY (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_view_columns` -( - id BIGINT NOT NULL AUTO_INCREMENT, - cid BIGINT NOT NULL, - vid BIGINT NOT NULL, - position INTEGER NULL, - PRIMARY KEY (id), - FOREIGN KEY (vid) REFERENCES mdb_view (id), - FOREIGN KEY (cid) REFERENCES mdb_columns (ID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifiers` -( - id BIGINT NOT NULL AUTO_INCREMENT, - dbid BIGINT, - qid BIGINT, - vid BIGINT, - tid BIGINT, - publisher VARCHAR(255) NOT NULL, - language VARCHAR(2), - publication_year INTEGER NOT NULL, - publication_month INTEGER, - publication_day INTEGER, - identifier_type ENUM ('DATABASE', 'SUBSET', 'VIEW', 'TABLE') NOT NULL, - query TEXT, - query_normalized TEXT, - query_hash VARCHAR(255), - execution TIMESTAMP, - result_hash VARCHAR(255), - result_number BIGINT, - doi VARCHAR(255), - created TIMESTAMP NOT NULL DEFAULT NOW(), - created_by VARCHAR(36) NOT NULL, - last_modified TIMESTAMP, - PRIMARY KEY (id), /* must be a single id from persistent identifier concept */ - FOREIGN KEY (dbid) REFERENCES mdb_databases (id), - FOREIGN KEY (created_by) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_licenses` -( - pid bigint NOT NULL, - license_id VARCHAR(255) NOT NULL, - PRIMARY KEY (pid, license_id), - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id), - FOREIGN KEY (license_id) REFERENCES mdb_licenses (identifier) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_titles` -( - id bigint NOT NULL AUTO_INCREMENT, - pid bigint NOT NULL, - title text NOT NULL, - title_type ENUM ('ALTERNATIVE_TITLE', 'SUBTITLE', 'TRANSLATED_TITLE', 'OTHER'), - language VARCHAR(2), - PRIMARY KEY (id), - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_funders` -( - id bigint NOT NULL AUTO_INCREMENT, - pid bigint NOT NULL, - funder_name VARCHAR(255) NOT NULL, - funder_identifier TEXT, - funder_identifier_type ENUM ('CROSSREF_FUNDER_ID', 'GRID', 'ISNI', 'ROR', 'OTHER'), - scheme_uri text, - award_number VARCHAR(255), - award_title text, - language VARCHAR(255), - PRIMARY KEY (id), - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_descriptions` -( - id bigint NOT NULL AUTO_INCREMENT, - pid bigint NOT NULL, - description text NOT NULL, - description_type ENUM ('ABSTRACT', 'METHODS', 'SERIES_INFORMATION', 'TABLE_OF_CONTENTS', 'TECHNICAL_INFO', 'OTHER'), - language VARCHAR(2), - PRIMARY KEY (id), - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_related_identifiers` -( - id bigint NOT NULL AUTO_INCREMENT, - pid bigint NOT NULL, - value varchar(255) NOT NULL, - type varchar(255), - relation varchar(255), - PRIMARY KEY (id), /* must be a single id from persistent identifier concept */ - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id), - UNIQUE (pid, value) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_creators` -( - id bigint NOT NULL AUTO_INCREMENT, - pid bigint NOT NULL, - given_names text, - family_name text, - creator_name VARCHAR(255) NOT NULL, - name_type ENUM ('PERSONAL', 'ORGANIZATIONAL') default 'PERSONAL', - name_identifier text, - name_identifier_scheme ENUM ('ROR', 'GRID', 'ISNI', 'ORCID'), - name_identifier_scheme_uri text, - affiliation VARCHAR(255), - affiliation_identifier text, - affiliation_identifier_scheme ENUM ('ROR', 'GRID', 'ISNI'), - affiliation_identifier_scheme_uri text, - PRIMARY KEY (id), - FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_feed` -( - fDBID bigint, - fID bigint, - fUserId character varying(36) not null, - fDataID bigint REFERENCES mdb_data (ID), - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (fDBID, fID, fUserId, fDataID), - FOREIGN KEY (fDBID, fID) REFERENCES mdb_tables (tDBID, ID), - FOREIGN KEY (fUserId) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_update` -( - uUserID character varying(255) NOT NULL, - uDBID bigint NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (uUserID, uDBID), - FOREIGN KEY (uDBID) REFERENCES mdb_databases (id) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_access` -( - aUserID character varying(255) NOT NULL, - aDBID bigint REFERENCES mdb_databases (id), - attime TIMESTAMP, - download BOOLEAN, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (aUserID, aDBID) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_have_access` -( - user_id character varying(36) NOT NULL, - database_id bigint REFERENCES mdb_databases (id), - access_type ENUM ('READ', 'WRITE_OWN', 'WRITE_ALL') NOT NULL, - created timestamp NOT NULL DEFAULT NOW(), - PRIMARY KEY (user_id, database_id), - FOREIGN KEY (user_id) REFERENCES mdb_users (id) -) WITH SYSTEM VERSIONING; - -COMMIT; -BEGIN; - -INSERT INTO `mdb_licenses` (identifier, uri) -VALUES ('MIT', 'https://opensource.org/licenses/MIT'), - ('GPL-3.0-only', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'), - ('BSD-3-Clause', 'https://opensource.org/licenses/BSD-3-Clause'), - ('BSD-4-Clause', 'http://directory.fsf.org/wiki/License:BSD_4Clause'), - ('Apache-2.0', 'https://opensource.org/licenses/Apache-2.0'), - ('CC0-1.0', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'), - ('CC-BY-4.0', 'https://creativecommons.org/licenses/by/4.0/legalcode'); - -INSERT INTO `mdb_images` (name, version, default_port, dialect, driver_class, jdbc_method) -VALUES ('mariadb', '11.1.3', 3306, 'org.hibernate.dialect.MariaDBDialect', 'org.mariadb.jdbc.Driver', 'mariadb'); - -INSERT INTO `mdb_images_date` (iid, database_format, unix_format, example, has_time) -VALUES (1, '%Y-%c-%d %H:%i:%S.%f', 'yyyy-MM-dd HH:mm:ss.SSSSSS', '2022-01-30 13:44:25.499', true), - (1, '%Y-%c-%d %H:%i:%S', 'yyyy-MM-dd HH:mm:ss', '2022-01-30 13:44:25', true), - (1, '%Y-%c-%d', 'yyyy-MM-dd', '2022-01-30', false), - (1, '%H:%i:%S', 'HH:mm:ss', '13:44:25', true); - -INSERT INTO `mdb_ontologies` (prefix, uri, uri_pattern, sparql_endpoint, rdf_path) -VALUES ('om', 'http://www.ontology-of-units-of-measure.org/resource/om-2/', - 'http://www.ontology-of-units-of-measure.org/resource/om-2/.*', null, 'rdf/om-2.0.rdf'), - ('wd', 'http://www.wikidata.org/', 'http://www.wikidata.org/entity/.*', 'https://query.wikidata.org/sparql', - null), - ('mo', 'http://purl.org/ontology/mo/', 'http://purl.org/ontology/mo/.*', null, null), - ('dc', 'http://purl.org/dc/elements/1.1/', null, null, null), - ('xsd', 'http://www.w3.org/2001/XMLSchema#', null, null, null), - ('tl', 'http://purl.org/NET/c4dm/timeline.owl#', null, null, null), - ('foaf', 'http://xmlns.com/foaf/0.1/', null, null, null), - ('schema', 'http://schema.org/', null, null, null), - ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', null, null, null), - ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#', null, null, null), - ('owl', 'http://www.w3.org/2002/07/owl#', null, null, null), - ('prov', 'http://www.w3.org/ns/prov#', null, null, null), - ('db', 'http://dbpedia.org', 'http://dbpedia.org/ontology/.*', 'http://dbpedia.org/sparql', null); -COMMIT; + BEGIN; + + CREATE TABLE IF NOT EXISTS `mdb_users` + ( + id character varying(36) NOT NULL, + username character varying(255) NOT NULL, + firstname character varying(255), + lastname character varying(255), + email character varying(255) NOT NULL, + orcid character varying(255), + affiliation character varying(255), + mariadb_password character varying(255) NOT NULL, + theme_dark boolean, + PRIMARY KEY (id), + UNIQUE (username), + UNIQUE (email) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_images` + ( + id bigint NOT NULL AUTO_INCREMENT, + name character varying(255) NOT NULL, + version character varying(255) NOT NULL, + default_port integer NOT NULL, + dialect character varying(255) NOT NULL, + driver_class character varying(255) NOT NULL, + jdbc_method character varying(255) NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + last_modified timestamp, + PRIMARY KEY (id), + UNIQUE (name, version) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_images_date` + ( + id bigint NOT NULL AUTO_INCREMENT, + iid bigint NOT NULL, + database_format character varying(255) NOT NULL, + unix_format character varying(255) NOT NULL, + example character varying(255) NOT NULL, + has_time boolean NOT NULL, + created_at timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (id), + FOREIGN KEY (iid) REFERENCES mdb_images (id), + UNIQUE (database_format, unix_format, example) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_containers` + ( + id bigint NOT NULL AUTO_INCREMENT, + internal_name character varying(255) NOT NULL, + name character varying(255) NOT NULL, + host character varying(255) NOT NULL, + port integer NOT NULL default 3306, + ui_host character varying(255) NOT NULL default host, + ui_port integer NOT NULL default port, + ui_additional_flags text, + sidecar_host character varying(255) NOT NULL, + sidecar_port integer NOT NULL default 3305, + image_id bigint NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + last_modified timestamp, + privileged_username character varying(255) NOT NULL, + privileged_password character varying(255) NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (image_id) REFERENCES mdb_images (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_data` + ( + ID bigint NOT NULL AUTO_INCREMENT, + PROVENANCE text, + FileEncoding text, + FileType character varying(100), + Version text, + Seperator text, + PRIMARY KEY (ID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_licenses` + ( + identifier character varying(255) NOT NULL, + uri text NOT NULL, + PRIMARY KEY (identifier), + UNIQUE (uri(200)) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_databases` + ( + id bigint NOT NULL AUTO_INCREMENT, + cid bigint NOT NULL, + name character varying(255) NOT NULL, + internal_name character varying(255) NOT NULL, + exchange_name character varying(255) NOT NULL, + description text, + engine character varying(20), + is_public boolean NOT NULL DEFAULT TRUE, + image longblob, + created_by character varying(36), + owned_by character varying(36), + contact_person character varying(36), + created timestamp NOT NULL DEFAULT NOW(), + last_modified timestamp, + PRIMARY KEY (id), + FOREIGN KEY (cid) REFERENCES mdb_containers (id) /* currently we only support one-to-one */, + FOREIGN KEY (created_by) REFERENCES mdb_users (id), + FOREIGN KEY (owned_by) REFERENCES mdb_users (id), + FOREIGN KEY (contact_person) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_databases_subjects` + ( + dbid BIGINT NOT NULL, + subjects character varying(255) NOT NULL, + PRIMARY KEY (dbid, subjects) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_tables` + ( + ID bigint NOT NULL AUTO_INCREMENT, + tDBID bigint NOT NULL, + internal_name character varying(255) NOT NULL, + queue_name character varying(255) NOT NULL, + routing_key character varying(255) NOT NULL, + tName VARCHAR(50), + tDescription TEXT, + num_rows BIGINT, + data_length BIGINT, + max_data_length BIGINT, + avg_row_length BIGINT, + `separator` CHAR(1), + quote CHAR(1), + element_null VARCHAR(50), + skip_lines BIGINT, + element_true VARCHAR(50), + element_false VARCHAR(50), + Version TEXT, + created timestamp NOT NULL DEFAULT NOW(), + versioned boolean not null default true, + created_by character varying(36) NOT NULL, + owned_by character varying(36) NOT NULL, + last_modified timestamp, + PRIMARY KEY (ID), + FOREIGN KEY (tDBID) REFERENCES mdb_databases (id), + FOREIGN KEY (created_by) REFERENCES mdb_users (id), + FOREIGN KEY (owned_by) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns` + ( + ID BIGINT NOT NULL AUTO_INCREMENT, + tID BIGINT NOT NULL, + dfID BIGINT, + cName VARCHAR(100), + internal_name VARCHAR(100) NOT NULL, + alias VARCHAR(100), + Datatype ENUM ('CHAR','VARCHAR','BINARY','VARBINARY','TINYBLOB','TINYTEXT','TEXT','BLOB','MEDIUMTEXT','MEDIUMBLOB','LONGTEXT','LONGBLOB','ENUM','SET','BIT','TINYINT','BOOL','SMALLINT','MEDIUMINT','INT','BIGINT','FLOAT','DOUBLE','DECIMAL','DATE','DATETIME','TIMESTAMP','TIME','YEAR'), + length BIGINT NULL, + ordinal_position INTEGER NOT NULL, + is_primary_key BOOLEAN NOT NULL, + index_length BIGINT NULL, + size BIGINT, + d BIGINT, + auto_generated BOOLEAN DEFAULT false, + is_null_allowed BOOLEAN NOT NULL DEFAULT true, + val_min NUMERIC NULL, + val_max NUMERIC NULL, + mean NUMERIC NULL, + median NUMERIC NULL, + std_dev Numeric NULL, + created timestamp NOT NULL DEFAULT NOW(), + last_modified timestamp, + FOREIGN KEY (tID) REFERENCES mdb_tables (ID) ON DELETE CASCADE, + PRIMARY KEY (ID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_enums` + ( + id bigint NOT NULL AUTO_INCREMENT, + column_id bigint NOT NULL, + value CHARACTER VARYING(255) NOT NULL, + FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, + PRIMARY KEY (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_sets` + ( + id bigint NOT NULL AUTO_INCREMENT, + column_id bigint NOT NULL, + value CHARACTER VARYING(255) NOT NULL, + FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, + PRIMARY KEY (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_nom` + ( + tID bigint, + cID bigint, + maxlength INTEGER, + last_modified timestamp, + created timestamp NOT NULL DEFAULT NOW(), + FOREIGN KEY (tID, cID) REFERENCES mdb_columns (tID, ID), + PRIMARY KEY (tID, cID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_cat` + ( + tID bigint, + cID bigint, + num_cat INTEGER, + -- cat_array TEXT[], + last_modified timestamp, + created timestamp NOT NULL DEFAULT NOW(), + FOREIGN KEY (tID, cID) REFERENCES mdb_columns (tID, ID), + PRIMARY KEY (tID, cID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_constraints_foreign_key` + ( + fkid BIGINT NOT NULL AUTO_INCREMENT, + tid BIGINT NOT NULL, + rtid BIGINT NOT NULL, + on_update VARCHAR(50) NULL, + on_delete VARCHAR(50) NULL, + position INT NULL, + PRIMARY KEY (fkid), + FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE, + FOREIGN KEY (rtid) REFERENCES mdb_tables (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_constraints_foreign_key_reference` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + fkid BIGINT NOT NULL, + cid BIGINT NOT NULL, + rcid BIGINT NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (fkid) REFERENCES mdb_constraints_foreign_key (fkid) ON UPDATE CASCADE, + FOREIGN KEY (cid) REFERENCES mdb_columns (id), + FOREIGN KEY (rcid) REFERENCES mdb_columns (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_constraints_unique` + ( + uid BIGINT NOT NULL AUTO_INCREMENT, + tid BIGINT NOT NULL, + position INT NULL, + PRIMARY KEY (uid), + FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE + ); + + CREATE TABLE IF NOT EXISTS `mdb_constraints_unique_columns` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + uid BIGINT NOT NULL, + cid BIGINT NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (uid) REFERENCES mdb_constraints_unique (uid), + FOREIGN KEY (cid) REFERENCES mdb_columns (id) ON DELETE CASCADE + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_constraints_checks` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + tid BIGINT NOT NULL, + checks VARCHAR(255) NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (tid) REFERENCES mdb_tables (id) ON DELETE CASCADE + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_concepts` + ( + id bigint NOT NULL AUTO_INCREMENT, + uri text not null, + name VARCHAR(255) null, + description TEXT null, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (id), + UNIQUE (uri(200)) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_units` + ( + id bigint NOT NULL AUTO_INCREMENT, + uri text not null, + name VARCHAR(255) null, + description TEXT null, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (id), + UNIQUE (uri(200)) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_concepts` + ( + id bigint NOT NULL, + cID bigint NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (id, cid), + FOREIGN KEY (cID) REFERENCES mdb_columns (ID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_columns_units` + ( + id bigint NOT NULL, + cID bigint NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (id, cID), + FOREIGN KEY (cID) REFERENCES mdb_columns (ID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_view` + ( + id bigint NOT NULL AUTO_INCREMENT, + vdbid bigint NOT NULL, + vName VARCHAR(255) NOT NULL, + internal_name VARCHAR(255) NOT NULL, + Query TEXT NOT NULL, + query_hash VARCHAR(255) NOT NULL, + Public BOOLEAN NOT NULL, + InitialView BOOLEAN NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + last_modified timestamp, + created_by character varying(36) NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (vdbid) REFERENCES mdb_databases (id), + FOREIGN KEY (created_by) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_banner_messages` + ( + id bigint NOT NULL AUTO_INCREMENT, + type ENUM ('ERROR', 'WARNING', 'INFO') NOT NULL default 'INFO', + message TEXT NOT NULL, + link TEXT NULL, + link_text VARCHAR(255) NULL, + display_start timestamp NULL, + display_end timestamp NULL, + PRIMARY KEY (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_ontologies` + ( + id bigint NOT NULL AUTO_INCREMENT, + prefix VARCHAR(8) NOT NULL, + uri TEXT NOT NULL, + uri_pattern TEXT, + sparql_endpoint TEXT NULL, + rdf_path TEXT NULL, + last_modified timestamp, + created timestamp NOT NULL DEFAULT NOW(), + UNIQUE (prefix), + UNIQUE (uri(200)), + PRIMARY KEY (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_view_columns` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + cid BIGINT NOT NULL, + vid BIGINT NOT NULL, + position INTEGER NULL, + PRIMARY KEY (id), + FOREIGN KEY (vid) REFERENCES mdb_view (id), + FOREIGN KEY (cid) REFERENCES mdb_columns (ID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifiers` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + dbid BIGINT, + qid BIGINT, + vid BIGINT, + tid BIGINT, + publisher VARCHAR(255) NOT NULL, + language VARCHAR(2), + publication_year INTEGER NOT NULL, + publication_month INTEGER, + publication_day INTEGER, + identifier_type ENUM ('DATABASE', 'SUBSET', 'VIEW', 'TABLE') NOT NULL, + query TEXT, + query_normalized TEXT, + query_hash VARCHAR(255), + execution TIMESTAMP, + result_hash VARCHAR(255), + result_number BIGINT, + doi VARCHAR(255), + created TIMESTAMP NOT NULL DEFAULT NOW(), + created_by VARCHAR(36) NOT NULL, + last_modified TIMESTAMP, + PRIMARY KEY (id), /* must be a single id from persistent identifier concept */ + FOREIGN KEY (dbid) REFERENCES mdb_databases (id), + FOREIGN KEY (created_by) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifier_licenses` + ( + pid bigint NOT NULL, + license_id VARCHAR(255) NOT NULL, + PRIMARY KEY (pid, license_id), + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id), + FOREIGN KEY (license_id) REFERENCES mdb_licenses (identifier) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifier_titles` + ( + id bigint NOT NULL AUTO_INCREMENT, + pid bigint NOT NULL, + title text NOT NULL, + title_type ENUM ('ALTERNATIVE_TITLE', 'SUBTITLE', 'TRANSLATED_TITLE', 'OTHER'), + language VARCHAR(2), + PRIMARY KEY (id), + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifier_funders` + ( + id bigint NOT NULL AUTO_INCREMENT, + pid bigint NOT NULL, + funder_name VARCHAR(255) NOT NULL, + funder_identifier TEXT, + funder_identifier_type ENUM ('CROSSREF_FUNDER_ID', 'GRID', 'ISNI', 'ROR', 'OTHER'), + scheme_uri text, + award_number VARCHAR(255), + award_title text, + language VARCHAR(255), + PRIMARY KEY (id), + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifier_descriptions` + ( + id bigint NOT NULL AUTO_INCREMENT, + pid bigint NOT NULL, + description text NOT NULL, + description_type ENUM ('ABSTRACT', 'METHODS', 'SERIES_INFORMATION', 'TABLE_OF_CONTENTS', 'TECHNICAL_INFO', 'OTHER'), + language VARCHAR(2), + PRIMARY KEY (id), + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_related_identifiers` + ( + id bigint NOT NULL AUTO_INCREMENT, + pid bigint NOT NULL, + value varchar(255) NOT NULL, + type varchar(255), + relation varchar(255), + PRIMARY KEY (id), /* must be a single id from persistent identifier concept */ + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id), + UNIQUE (pid, value) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifier_creators` + ( + id bigint NOT NULL AUTO_INCREMENT, + pid bigint NOT NULL, + given_names text, + family_name text, + creator_name VARCHAR(255) NOT NULL, + name_type ENUM ('PERSONAL', 'ORGANIZATIONAL') default 'PERSONAL', + name_identifier text, + name_identifier_scheme ENUM ('ROR', 'GRID', 'ISNI', 'ORCID'), + name_identifier_scheme_uri text, + affiliation VARCHAR(255), + affiliation_identifier text, + affiliation_identifier_scheme ENUM ('ROR', 'GRID', 'ISNI'), + affiliation_identifier_scheme_uri text, + PRIMARY KEY (id), + FOREIGN KEY (pid) REFERENCES mdb_identifiers (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_feed` + ( + fDBID bigint, + fID bigint, + fUserId character varying(36) not null, + fDataID bigint REFERENCES mdb_data (ID), + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (fDBID, fID, fUserId, fDataID), + FOREIGN KEY (fDBID, fID) REFERENCES mdb_tables (tDBID, ID), + FOREIGN KEY (fUserId) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_update` + ( + uUserID character varying(255) NOT NULL, + uDBID bigint NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (uUserID, uDBID), + FOREIGN KEY (uDBID) REFERENCES mdb_databases (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_access` + ( + aUserID character varying(255) NOT NULL, + aDBID bigint REFERENCES mdb_databases (id), + attime TIMESTAMP, + download BOOLEAN, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (aUserID, aDBID) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_have_access` + ( + user_id character varying(36) NOT NULL, + database_id bigint REFERENCES mdb_databases (id), + access_type ENUM ('READ', 'WRITE_OWN', 'WRITE_ALL') NOT NULL, + created timestamp NOT NULL DEFAULT NOW(), + PRIMARY KEY (user_id, database_id), + FOREIGN KEY (user_id) REFERENCES mdb_users (id) + ) WITH SYSTEM VERSIONING; + + COMMIT; + BEGIN; + + INSERT INTO `mdb_licenses` (identifier, uri) + VALUES ('MIT', 'https://opensource.org/licenses/MIT'), + ('GPL-3.0-only', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'), + ('BSD-3-Clause', 'https://opensource.org/licenses/BSD-3-Clause'), + ('BSD-4-Clause', 'http://directory.fsf.org/wiki/License:BSD_4Clause'), + ('Apache-2.0', 'https://opensource.org/licenses/Apache-2.0'), + ('CC0-1.0', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'), + ('CC-BY-4.0', 'https://creativecommons.org/licenses/by/4.0/legalcode'); + + INSERT INTO `mdb_images` (name, version, default_port, dialect, driver_class, jdbc_method) + VALUES ('mariadb', '11.1.3', 3306, 'org.hibernate.dialect.MariaDBDialect', 'org.mariadb.jdbc.Driver', 'mariadb'); + + INSERT INTO `mdb_images_date` (iid, database_format, unix_format, example, has_time) + VALUES (1, '%Y-%c-%d %H:%i:%S.%f', 'yyyy-MM-dd HH:mm:ss.SSSSSS', '2022-01-30 13:44:25.499', true), + (1, '%Y-%c-%d %H:%i:%S', 'yyyy-MM-dd HH:mm:ss', '2022-01-30 13:44:25', true), + (1, '%Y-%c-%d', 'yyyy-MM-dd', '2022-01-30', false), + (1, '%H:%i:%S', 'HH:mm:ss', '13:44:25', true); + + INSERT INTO `mdb_ontologies` (prefix, uri, uri_pattern, sparql_endpoint, rdf_path) + VALUES ('om', 'http://www.ontology-of-units-of-measure.org/resource/om-2/', + 'http://www.ontology-of-units-of-measure.org/resource/om-2/.*', null, 'rdf/om-2.0.rdf'), + ('wd', 'http://www.wikidata.org/', 'http://www.wikidata.org/entity/.*', 'https://query.wikidata.org/sparql', + null), + ('mo', 'http://purl.org/ontology/mo/', 'http://purl.org/ontology/mo/.*', null, null), + ('dc', 'http://purl.org/dc/elements/1.1/', null, null, null), + ('xsd', 'http://www.w3.org/2001/XMLSchema#', null, null, null), + ('tl', 'http://purl.org/NET/c4dm/timeline.owl#', null, null, null), + ('foaf', 'http://xmlns.com/foaf/0.1/', null, null, null), + ('schema', 'http://schema.org/', null, null, null), + ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', null, null, null), + ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#', null, null, null), + ('owl', 'http://www.w3.org/2002/07/owl#', null, null, null), + ('prov', 'http://www.w3.org/ns/prov#', null, null, null), + ('db', 'http://dbpedia.org', 'http://dbpedia.org/ontology/.*', 'http://dbpedia.org/sparql', null); + COMMIT; diff --git a/helm-charts/dbrepo/Chart.yaml b/helm-charts/dbrepo/Chart.yaml index 79a5fd1fa2cac445afa3c7d661a17589c7999129..59295782271c8f78c4796f8c32cd313807897e57 100644 --- a/helm-charts/dbrepo/Chart.yaml +++ b/helm-charts/dbrepo/Chart.yaml @@ -16,38 +16,38 @@ home: https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/ icon: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/.docs/images/signet_white.png dependencies: - name: opensearch - alias: searchDb + alias: search-db version: 2.15.0 # app version 2.10.0 repository: https://opensearch-project.github.io/helm-charts/ - name: opensearch-dashboards - alias: searchDbDashboard + alias: search-db-dashboard version: 2.13.0 # app version 2.10.0 repository: https://opensearch-project.github.io/helm-charts/ - name: keycloak - alias: authService + alias: auth-service version: 17.3.3 repository: https://charts.bitnami.com/bitnami - name: mariadb-galera - alias: dataDb + alias: data-db version: 11.0.1 repository: https://charts.bitnami.com/bitnami - name: mariadb-galera - alias: metadataDb + alias: metadata-db version: 11.0.1 repository: https://charts.bitnami.com/bitnami - name: postgresql-ha - alias: authDb + alias: auth-db version: 12.1.7 repository: https://charts.bitnami.com/bitnami - name: rabbitmq - alias: brokerService + alias: broker-service version: 12.5.1 repository: https://charts.bitnami.com/bitnami - name: fluent-bit - alias: logService + alias: log-service version: 0.40.0 repository: https://fluent.github.io/helm-charts - name: seaweedfs - alias: storageService + alias: storage-service version: 3.59.4 repository: https://seaweedfs.github.io/seaweedfs/helm diff --git a/helm-charts/dbrepo/README.md b/helm-charts/dbrepo/README.md index 6311b5e8b65a7b11a48c43481c432365b070b333..c57bd14e73dcda70b905eb978f93f1b926704064 100644 --- a/helm-charts/dbrepo/README.md +++ b/helm-charts/dbrepo/README.md @@ -58,30 +58,30 @@ The command removes all the Kubernetes components associated with the chart and The Metadata Database uses the [Bitnami MariaDB Galera](https://artifacthub.io/packages/helm/bitnami/mariadb-galera) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|----------------------------|-------------------------------------------|---------------| -| `metadataDb.host` | Hostname. | `metadata-db` | -| `metadataDb.jdbcExtraArgs` | Extra arguments for the JDBC connections. | `""` | +| Name | Description | Value | +|-----------------------------|-------------------------------------------|---------------| +| `metadata-db.host` | Hostname. | `metadata-db` | +| `metadata-db.jdbcExtraArgs` | Extra arguments for the JDBC connections. | `""` | ### Authentication Service The Auth Service uses the [Bitnami Keycloak](https://artifacthub.io/packages/helm/bitnami/keycloak) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|-----------------------------|-----------------------------------------------------------------|------------------------------------| -| `authService.client.id` | Client id. This value is publicly known. | `dbrepo-client` | -| `authService.client.secret` | Client secret. This value should never be known outside DBRepo. | `MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG` | +| Name | Description | Value | +|------------------------------|-----------------------------------------------------------------|------------------------------------| +| `auth-service.client.id` | Client id. This value is publicly known. | `dbrepo-client` | +| `auth-service.client.secret` | Client secret. This value should never be known outside DBRepo. | `MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG` | ### Auth Database The Auth Database uses the [Bitnami PostgreSQL HA](https://artifacthub.io/packages/helm/bitnami/postgresql-ha) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|---------------|--------------------------------------|------------------| -| `authDb.host` | Hostname. Needed for other services. | `auth-db-pgpool` | -| `authDB.port` | Port. Needed for other services. | `5432` | +| Name | Description | Value | +|----------------|--------------------------------------|------------------| +| `auth-db.host` | Hostname. Needed for other services. | `auth-db-pgpool` | +| `auth-db.port` | Port. Needed for other services. | `5432` | ### Data Database @@ -95,12 +95,12 @@ The Search Database uses the [OpenSearch](https://artifacthub.io/packages/helm/opensearch-project-helm-charts/opensearch) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|-------------------|--------------------------------------|-------------| -| `searchDb.host` | Hostname. Needed for other services. | `search-db` | -| `authDB.port` | Port. Needed for other services. | `9200` | -| `authDB.username` | Username. Needed for other services. | `admin` | -| `authDB.password` | Password. Needed for other services. | `admin` | +| Name | Description | Value | +|----------------------|--------------------------------------|-------------| +| `search-db.host` | Hostname. Needed for other services. | `search-db` | +| `search-db.port` | Port. Needed for other services. | `9200` | +| `search-db.username` | Username. Needed for other services. | `admin` | +| `search-db.password` | Password. Needed for other services. | `admin` | ### Search Database Dashboard @@ -110,29 +110,29 @@ chart. See their documentation for the remaining overridden values. ### Upload Service -| Name | Description | Value | -|----------------------------------|----------------------------------------|-------------------| -| `uploadService.enabled` | Enables/disabled the deployment. | `true` | -| `uploadService.image.registry` | Registry to pull the image | `docker.io` | -| `uploadService.image.repository` | Repository to pull the image | `tusproject/tusd` | -| `uploadService.image.tag` | Tag of the image. | `v1.12` | -| `uploadService.replicaCount` | Number of replicas for the deployment. | `2` | +| Name | Description | Value | +|-----------------------------------|----------------------------------------|-------------------| +| `upload-service.enabled` | Enables/disabled the deployment. | `true` | +| `upload-service.image.registry` | Registry to pull the image | `docker.io` | +| `upload-service.image.repository` | Repository to pull the image | `tusproject/tusd` | +| `upload-service.image.tag` | Tag of the image. | `v1.12` | +| `upload-service.replicaCount` | Number of replicas for the deployment. | `2` | ### Broker Service The Broker Service uses the [Bitnami RabbitMQ](https://artifacthub.io/packages/helm/bitnami/rabbitmq) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|-----------------------------------|-------------------------------------------------------------------------|-------------------------------| -| `brokerService.url` | Admin API endpoint. Needed for other services. | `http://broker-service:15672` | -| `brokerService.host` | Service hostname. Needed for other services. | `broker-service` | -| `brokerService.port` | Service port. Needed for other services. | `5672` | -| `brokerService.virtualHost` | Virtual host on RabbitMQ. Needed for other services. | `dbrepo` | -| `brokerService.queueName` | Queue name on RabbitMQ. Needed for other services. | `dbrepo` | -| `brokerService.exchangeName` | Exchange name on RabbitMQ. Needed for other services. | `dbrepo` | -| `brokerService.routingKey` | Route binding for queue to exchange defined. Needed for other services. | `dbrepo.#` | -| `brokerService.connectionTimeout` | Connection timeout. Needed for other services. | `60000` | +| Name | Description | Value | +|------------------------------------|-------------------------------------------------------------------------|-------------------------------| +| `broker-service.url` | Admin API endpoint. Needed for other services. | `http://broker-service:15672` | +| `broker-service.host` | Service hostname. Needed for other services. | `broker-service` | +| `broker-service.port` | Service port. Needed for other services. | `5672` | +| `broker-service.virtualHost` | Virtual host on RabbitMQ. Needed for other services. | `dbrepo` | +| `broker-service.queueName` | Queue name on RabbitMQ. Needed for other services. | `dbrepo` | +| `broker-service.exchangeName` | Exchange name on RabbitMQ. Needed for other services. | `dbrepo` | +| `broker-service.routingKey` | Route binding for queue to exchange defined. Needed for other services. | `dbrepo.#` | +| `broker-service.connectionTimeout` | Connection timeout. Needed for other services. | `60000` | ### Analyse Service @@ -173,19 +173,19 @@ Helm chart. See their documentation for the remaining overridden values. ### Data Service -| Name | Description | Value | -|-----------------------------------------|--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `metadataService.enabled` | Enables/disabled the deployment. | `true` | -| `metadataService.image.registry` | Registry to pull the image | `s210.dl.hpc.tuwien.ac.at` | -| `metadataService.image.repository` | Repository to pull the image | `dbrepo/data-service` | -| `metadataService.image.tag` | Tag of the image. | `1.4.1` | -| `metadataService.image.pullPolicy` | Image pull policy on deployments | `Always` | -| `metadataService.image.debug` | Enables/disabled the debug logging. | `false` | -| `metadataService.jwt.pubkey` | The JWT pubkey to verify JWT signature. | `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB` | -| `metadataService.consumerConcurrentMin` | The number of concurrent consumers (minimum). | `1` | -| `metadataService.consumerConcurrentMax` | The number of concurrent consumers (maximum). | `5` | -| `metadataService.requeueRejected` | Requeue rejected tuples into the Broker Service. | `false` | -| `metadataService.replicaCount` | Number of replicas for the deployment. | `2` | +| Name | Description | Value | +|-------------------------------------|--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `dataService.enabled` | Enables/disabled the deployment. | `true` | +| `dataService.image.registry` | Registry to pull the image | `s210.dl.hpc.tuwien.ac.at` | +| `dataService.image.repository` | Repository to pull the image | `dbrepo/data-service` | +| `dataService.image.tag` | Tag of the image. | `1.4.1` | +| `dataService.image.pullPolicy` | Image pull policy on deployments | `Always` | +| `dataService.image.debug` | Enables/disabled the debug logging. | `false` | +| `dataService.jwt.pubkey` | The JWT pubkey to verify JWT signature. | `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB` | +| `dataService.consumerConcurrentMin` | The number of concurrent consumers (minimum). | `1` | +| `dataService.consumerConcurrentMax` | The number of concurrent consumers (maximum). | `5` | +| `dataService.requeueRejected` | Requeue rejected tuples into the Broker Service. | `false` | +| `dataService.replicaCount` | Number of replicas for the deployment. | `2` | ### Search Service @@ -204,10 +204,10 @@ Helm chart. See their documentation for the remaining overridden values. The Storage Service uses the [SeaweedFS](https://artifacthub.io/packages/helm/seaweedfs/seaweedfs) Helm chart. See their documentation for the remaining overridden values. -| Name | Description | Value | -|-----------------|---------------------------------------------|------------------| -| `auth.username` | Username for S3. Needed for other services. | `seaweedfsadmin` | -| `auth.password` | Password for S3. Needed for other services. | `seaweedfsadmin` | +| Name | Description | Value | +|---------------------------------|---------------------------------------------|------------------| +| `storage-service.auth.username` | Username for S3. Needed for other services. | `seaweedfsadmin` | +| `storage-service.auth.password` | Password for S3. Needed for other services. | `seaweedfsadmin` | ### User Interface diff --git a/helm-charts/dbrepo/templates/auth-service/env-configmap.yaml b/helm-charts/dbrepo/templates/auth-service/env-configmap.yaml index 9de9a96419b24e91e219f5f131b14f610135a823..391c7475dfccd91a5469bb8fbfeea8f96946b3bc 100644 --- a/helm-charts/dbrepo/templates/auth-service/env-configmap.yaml +++ b/helm-charts/dbrepo/templates/auth-service/env-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: auth-service-config - namespace: {{ $.Values.namespace }} + namespace: {{ .Values.namespace }} data: KC_HOSTNAME_PATH: "/api/auth" KC_HOSTNAME_ADMIN_URL: "https://{{ .Values.hostname }}/api/auth" \ No newline at end of file diff --git a/helm-charts/dbrepo/templates/auth-service/secret.yaml b/helm-charts/dbrepo/templates/auth-service/secret.yaml index bae6e2036a7375bb1af928a1521b8022a801cd63..c6cc5911d9418808623fdce9608181fcecbece2a 100644 --- a/helm-charts/dbrepo/templates/auth-service/secret.yaml +++ b/helm-charts/dbrepo/templates/auth-service/secret.yaml @@ -4,8 +4,8 @@ metadata: name: auth-service-secret namespace: {{ .Values.namespace }} stringData: - db-host: "{{ .Values.authDb.host }}" - db-port: "{{ .Values.authDb.port }}" - db-name: "{{ .Values.authDb.postgresql.database }}" - db-username: "{{ .Values.authDb.postgresql.username }}" - db-password: "{{ .Values.authDb.postgresql.password }}" + db-host: "{{ index .Values "auth-db" "host" }}" + db-port: "{{ index .Values "auth-db" "port" }}" + db-name: "{{ index .Values "auth-db" "postgresql" "database" }}" + db-username: "{{ index .Values "auth-db" "postgresql" "username" }}" + db-password: "{{ index .Values "auth-db" "postgresql" "password" }}" diff --git a/helm-charts/dbrepo/templates/data-db/pvc.yaml b/helm-charts/dbrepo/templates/data-db/pvc.yaml index 0d5c5c49af15f9603f2869a31387f94c174e8203..0e55aa4a0a1d9fa1f69706aadae269d985401bdd 100644 --- a/helm-charts/dbrepo/templates/data-db/pvc.yaml +++ b/helm-charts/dbrepo/templates/data-db/pvc.yaml @@ -3,7 +3,7 @@ kind: PersistentVolumeClaim metadata: name: data-db-shared spec: - storageClassName: {{ .Values.dataDb.persistence.sharedStorageClass }} + storageClassName: {{ index .Values "data-db" "persistence" "sharedStorageClass" }} accessModes: - ReadWriteMany resources: diff --git a/helm-charts/dbrepo/templates/data-service/secret.yaml b/helm-charts/dbrepo/templates/data-service/secret.yaml index 3386171d49f7e942130842cbfdb1864125fe6c27..52fbb2e3a9f70ab51a89be64639e8eb3c79fac94 100644 --- a/helm-charts/dbrepo/templates/data-service/secret.yaml +++ b/helm-charts/dbrepo/templates/data-service/secret.yaml @@ -7,25 +7,25 @@ metadata: name: data-service-secret namespace: {{ .Values.namespace }} stringData: - metadata-db: "{{ .Values.metadataDb.db.name }}" - metadata-host: "{{ .Values.metadataDb.host }}" - metadata-username: "{{ .Values.metadataDb.rootUser.user }}" - metadata-password: "{{ .Values.metadataDb.rootUser.password }}" - metadata-jdbc-extra-args: "{{ .Values.metadataDb.jdbcExtraArgs }}" - search-username: "{{ .Values.searchDb.username }}" - search-password: "{{ .Values.searchDb.password }}" + metadata-db: "{{ index .Values "metadata-db" "db" "name" }}" + metadata-host: "{{ index .Values "metadata-db" "host" }}" + metadata-username: "{{ index .Values "metadata-db" "rootUser" "user" }}" + metadata-password: "{{ index .Values "metadata-db" "rootUser" "password" }}" + metadata-jdbc-extra-args: "{{ index .Values "metadata-db" "jdbcExtraArgs" }}" + search-username: "{{ index .Values "search-db" "username" }}" + search-password: "{{ index .Values "search-db" "password" }}" jwt-issuer: "{{ $jwtIssuer }}" jwt-pubkey: "{{ .Values.dataService.jwt.pubkey }}" - broker-username: "{{ .Values.brokerService.auth.username }}" - broker-password: "{{ .Values.brokerService.auth.password }}" + broker-username: "{{ index .Values "broker-service" "auth" "username" }}" + broker-password: "{{ index .Values "broker-service" "auth" "password" }}" min-concurrent-consumers: "{{ .Values.dataService.consumerConcurrentMin }}" max-concurrent-consumers: "{{ .Values.dataService.consumerConcurrentMax }}" requeue-rejected: "{{ .Values.dataService.requeueRejected }}" log-level: "{{ ternary "debug" "info" .Values.dataService.image.debug }}" - broker-host: "{{ .Values.brokerService.host }}" - broker-port: "{{ .Values.brokerService.port }}" - broker-virtualhost: "{{ .Values.brokerService.virtualHost }}" - queue-name: "{{ .Values.brokerService.queueName }}" - exchange-name: "{{ .Values.brokerService.exchangeName }}" - routing-key: "{{ .Values.brokerService.routingKey }}" - connection-timeout: "{{ .Values.brokerService.connectionTimeout }}" \ No newline at end of file + broker-host: "{{ index .Values "broker-service" "host" }}" + broker-port: "{{ index .Values "broker-service" "port" }}" + broker-virtualhost: "{{ index .Values "broker-service" "virtualHost" }}" + queue-name: "{{ index .Values "broker-service" "queueName" }}" + exchange-name: "{{ index .Values "broker-service" "exchangeName" }}" + routing-key: "{{ index .Values "broker-service" "routingKey" }}" + connection-timeout: "{{ index .Values "broker-service" "connectionTimeout" }}" \ No newline at end of file diff --git a/helm-charts/dbrepo/templates/data-service/service.yaml b/helm-charts/dbrepo/templates/data-service/service.yaml index 71a1f8f46fb98282fb06ae320ba645425e76bcff..9435198cf11da1622a51a3b6ea2c9f2597c77d1a 100644 --- a/helm-charts/dbrepo/templates/data-service/service.yaml +++ b/helm-charts/dbrepo/templates/data-service/service.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Service metadata: name: data-service - namespace: {{ $.Values.namespace }} + namespace: {{ .Values.namespace }} labels: service: data-service spec: diff --git a/helm-charts/dbrepo/templates/metadata-db/configmap.yaml b/helm-charts/dbrepo/templates/metadata-db/configmap.yaml index f6cf02b518d6b514be5c17ab4cdadfdfdd8cd562..7d5c1ef4eab5124c5c5a1fd20c9dc21a7175a2ac 100644 --- a/helm-charts/dbrepo/templates/metadata-db/configmap.yaml +++ b/helm-charts/dbrepo/templates/metadata-db/configmap.yaml @@ -108,6 +108,7 @@ data: description text, engine character varying(20), is_public boolean NOT NULL DEFAULT TRUE, + image longblob, created_by character varying(36), owned_by character varying(36), contact_person character varying(36), @@ -191,7 +192,7 @@ data: id bigint NOT NULL AUTO_INCREMENT, column_id bigint NOT NULL, value CHARACTER VARYING(255) NOT NULL, - FOREIGN KEY (column_id) REFERENCES mdb_columns (ID), + FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, PRIMARY KEY (id) ) WITH SYSTEM VERSIONING; @@ -200,7 +201,7 @@ data: id bigint NOT NULL AUTO_INCREMENT, column_id bigint NOT NULL, value CHARACTER VARYING(255) NOT NULL, - FOREIGN KEY (column_id) REFERENCES mdb_columns (ID), + FOREIGN KEY (column_id) REFERENCES mdb_columns (ID) ON DELETE CASCADE, PRIMARY KEY (id) ) WITH SYSTEM VERSIONING; diff --git a/helm-charts/dbrepo/templates/metadata-service/secret.yaml b/helm-charts/dbrepo/templates/metadata-service/secret.yaml index 3a139a74e8739d6669d04806f44b769f03113924..374381bab36c01217c0ae4add61307df53baff3d 100644 --- a/helm-charts/dbrepo/templates/metadata-service/secret.yaml +++ b/helm-charts/dbrepo/templates/metadata-service/secret.yaml @@ -9,25 +9,25 @@ metadata: stringData: admin-email: "{{ .Values.metadataService.adminEmail }}" base-url: "{{ .Values.hostname }}" - broker-endpoint: "{{ .Values.brokerService.url }}" - broker-host: "{{ .Values.brokerService.host }}" - broker-port: "{{ .Values.brokerService.port }}" + broker-endpoint: "{{ index .Values "broker-service" "url" }}" + broker-host: "{{ index .Values "broker-service" "host" }}" + broker-port: "{{ index .Values "broker-service" "port" }}" gateway-endpoint: "{{ .Values.hostname }}" website: "{{ .Values.metadataService.website }}" - search-username: "{{ .Values.searchDb.username }}" - search-password: "{{ .Values.searchDb.password }}" - broker-username: "{{ .Values.brokerService.auth.username }}" - broker-password: "{{ .Values.brokerService.auth.password }}" + search-username: "{{ index .Values "search-db" "username" }}" + search-password: "{{ index .Values "search-db" "password" }}" + broker-username: "{{ index .Values "broker-service" "auth" "username" }}" + broker-password: "{{ index .Values "broker-service" "auth" "password" }}" log-level: "{{ ternary "trace" "info" .Values.metadataService.image.debug }}" - metadata-db: "{{ .Values.metadataDb.db.name }}" - metadata-host: "{{ .Values.metadataDb.host }}" - metadata-username: "{{ .Values.metadataDb.rootUser.user }}" - metadata-password: "{{ .Values.metadataDb.rootUser.password }}" - metadata-jdbc-extra-args: "{{ .Values.metadataDb.jdbcExtraArgs }}" + metadata-db: "{{ index .Values "metadata-db" "db" "name" }}" + metadata-host: "{{ index .Values "metadata-db" "host" }}" + metadata-username: "{{ index .Values "metadata-db" "rootUser" "user" }}" + metadata-password: "{{ index .Values "metadata-db" "rootUser" "password" }}" + metadata-jdbc-extra-args: "{{ index .Values "metadata-db" "jdbcExtraArgs" }}" keycloak-host: "{{ .Values.metadataService.authService.url }}" - keycloak-admin: "{{ .Values.authService.auth.adminUser }}" - keycloak-admin-password: "{{ .Values.authService.auth.adminPassword }}" - keycloak-client-secret: "{{ .Values.authService.client.secret }}" + keycloak-admin: "{{ index .Values "auth-service" "auth" "adminUser" }}" + keycloak-admin-password: "{{ index .Values "auth-service" "auth" "adminPassword" }}" + keycloak-client-secret: "{{ index .Values "auth-service" "client" "secret" }}" datacite-url: "{{ .Values.metadataService.datacite.url }}" datacite-prefix: "{{ .Values.metadataService.datacite.prefix | toString }}" datacite-username: "{{ .Values.metadataService.datacite.username }}" @@ -35,17 +35,17 @@ stringData: repository-name: "{{ .Values.metadataService.repositoryName }}" pid-base: "{{ $pidBase }}" jwt-issuer: "{{ $jwtIssuer }}" - broker-virtualhost: "{{ .Values.brokerService.virtualHost }}" - queue-name: "{{ .Values.brokerService.queueName }}" - exchange-name: "{{ .Values.brokerService.exchangeName }}" - routing-key: "{{ .Values.brokerService.routingKey }}" - connection-timeout: "{{ .Values.brokerService.connectionTimeout }}" + broker-virtualhost: "{{ index .Values "broker-service" "virtualHost" }}" + queue-name: "{{ index .Values "broker-service" "queueName" }}" + exchange-name: "{{ index .Values "broker-service" "exchangeName" }}" + routing-key: "{{ index .Values "broker-service" "routingKey" }}" + connection-timeout: "{{ index .Values "broker-service" "connectionTimeout" }}" min-concurrent-consumers: "{{ .Values.dataService.consumerConcurrentMin }}" max-concurrent-consumers: "{{ .Values.dataService.consumerConcurrentMax }}" requeue-rejected: "{{ .Values.dataService.requeueRejected }}" s3-storage-endpoint: http://storage-service-s3:9000 - s3-access-key-id: "{{ .Values.storageService.s3.auth.username }}" - s3-secret-access-key: "{{ .Values.storageService.s3.auth.password }}" + s3-access-key-id: "{{ index .Values "storage-service" "s3" "auth" "username" }}" + s3-secret-access-key: "{{ index .Values "storage-service" "s3" "auth" "password" }}" s3-import-bucket: "dbrepo-upload" s3-export-bucket: "dbrepo-download" delete-stale-files-rate: {{ .Values.metadataService.rates.deleteStaleFiles | quote }} diff --git a/helm-charts/dbrepo/templates/search-db-dashboard/secret.yaml b/helm-charts/dbrepo/templates/search-db-dashboard/secret.yaml index f7caf1d29290312437cf014e2766d8b8eabcd226..3d3f75888f1511047ae78de4e3c6503035e29718 100644 --- a/helm-charts/dbrepo/templates/search-db-dashboard/secret.yaml +++ b/helm-charts/dbrepo/templates/search-db-dashboard/secret.yaml @@ -17,5 +17,5 @@ stringData: opensearch: ssl: verificationMode: none - username: {{ .Values.searchDb.username }} - password: {{ .Values.searchDb.password }} + username: {{ index .Values "search-db" "username" }} + password: {{ index .Values "search-db" "password" }} diff --git a/helm-charts/dbrepo/templates/search-service/secret.yaml b/helm-charts/dbrepo/templates/search-service/secret.yaml index de636d510424d2250fe598463c4eb4b6b6be53b2..ed2881fe17a0ec16c9d2875c6d3b9abab935ac0b 100644 --- a/helm-charts/dbrepo/templates/search-service/secret.yaml +++ b/helm-charts/dbrepo/templates/search-service/secret.yaml @@ -5,8 +5,8 @@ metadata: name: search-service-secret namespace: {{ .Values.namespace }} stringData: - opensearch-host: "{{ .Values.searchDb.host }}" - opensearch-port: "{{ .Values.searchDb.port }}" - opensearch-username: "{{ .Values.searchDb.username }}" - opensearch-password: "{{ .Values.searchDb.password }}" + opensearch-host: "{{ index .Values "search-db" "host" }}" + opensearch-port: "{{ index .Values "search-db" "port" }}" + opensearch-username: "{{ index .Values "search-db" "username" }}" + opensearch-password: "{{ index .Values "search-db" "password" }}" log-level: "{{ ternary "DEBUG" "INFO" .Values.searchService.image.debug }}" diff --git a/helm-charts/dbrepo/templates/storage-service/secret.yaml b/helm-charts/dbrepo/templates/storage-service/secret.yaml index baf13a16ad937e93c364e6fbd4e1a594c10c227c..525323c623e127e23957b5b74b9c83f8d9980f0b 100644 --- a/helm-charts/dbrepo/templates/storage-service/secret.yaml +++ b/helm-charts/dbrepo/templates/storage-service/secret.yaml @@ -14,8 +14,8 @@ stringData: "name": "admin", "credentials": [ { - "accessKey": "{{ .Values.storageService.s3.auth.username }}", - "secretKey": "{{ .Values.storageService.s3.auth.password }}" + "accessKey": "{{ index .Values "storage-service" "s3" "auth" "username" }}", + "secretKey": "{{ index .Values "storage-service" "s3" "auth" "password" }}" } ], "actions": [ diff --git a/helm-charts/dbrepo/templates/upload-service/deployment.yaml b/helm-charts/dbrepo/templates/upload-service/deployment.yaml index 9123ede83eefe7b7dc03e9cfbb6f1334f17afd2a..15eb7470671b14eb946a74e41b1f7c2d884c8ecd 100644 --- a/helm-charts/dbrepo/templates/upload-service/deployment.yaml +++ b/helm-charts/dbrepo/templates/upload-service/deployment.yaml @@ -4,7 +4,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: upload-service - namespace: {{ $.Values.namespace }} + namespace: {{ .Values.namespace }} labels: app: upload-service service: upload-service diff --git a/helm-charts/dbrepo/templates/upload-service/secret.yaml b/helm-charts/dbrepo/templates/upload-service/secret.yaml index ba309cc7ec41b7390f46c5e12d0a2893e31bee18..1d94dc2ebdcc8ecfda0b934fc6fb2849ba1ba535 100644 --- a/helm-charts/dbrepo/templates/upload-service/secret.yaml +++ b/helm-charts/dbrepo/templates/upload-service/secret.yaml @@ -6,7 +6,7 @@ metadata: name: upload-service-secret namespace: {{ .Values.namespace }} stringData: - aws-access-key-id: "{{ .Values.storageService.s3.auth.username }}" - aws-secret-access-key: "{{ .Values.storageService.s3.auth.password }}" + aws-access-key-id: "{{ index .Values "storage-service" "s3" "auth" "username" }}" + aws-secret-access-key: "{{ index .Values "storage-service" "s3" "auth" "password" }}" aws-region: "default" {{- end }} \ No newline at end of file diff --git a/helm-charts/dbrepo/templates/upload-service/service.yaml b/helm-charts/dbrepo/templates/upload-service/service.yaml index 3c4d957002cf479ed03c2df6a4bbf305b6068d87..ace05e5035a82a506ed28f9d4d45840b75ab97a2 100644 --- a/helm-charts/dbrepo/templates/upload-service/service.yaml +++ b/helm-charts/dbrepo/templates/upload-service/service.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Service metadata: name: upload-service - namespace: {{ $.Values.namespace }} + namespace: {{ .Values.namespace }} labels: service: upload-service spec: diff --git a/helm-charts/dbrepo/values.yaml b/helm-charts/dbrepo/values.yaml index 793a27405d5c1151556f15013bff5df898b56ae7..22a68cee6c967f7e3a3d69954378c13090ec57ef 100644 --- a/helm-charts/dbrepo/values.yaml +++ b/helm-charts/dbrepo/values.yaml @@ -6,7 +6,7 @@ strategyType: RollingUpdate clusterDomain: cluster.local -metadataDb: +metadata-db: fullnameOverride: metadata-db image: debug: false @@ -35,7 +35,7 @@ metadataDb: storageClass: default replicaCount: 3 # uneven 3,5,7 -authService: +auth-service: fullnameOverride: auth-service image: debug: false @@ -71,7 +71,7 @@ authService: mountPath: /opt/bitnami/keycloak/data/import replicaCount: 2 -authDb: +auth-db: fullnameOverride: auth-db host: auth-db-pgpool port: 5432 @@ -96,7 +96,7 @@ authDb: size: 10Gi storageClass: default -dataDb: +data-db: fullnameOverride: data-db image: debug: false @@ -156,7 +156,7 @@ dataDb: sharedStorageClass: default replicaCount: 3 # uneven -searchDb: +search-db: fullnameOverride: search-db host: search-db port: 9200 @@ -232,7 +232,7 @@ searchDb: ".opendistro-asynchronous-search-response*", ] -searchDbDashboard: +search-db-dashboard: fullnameOverride: search-db-dashboard opensearchHosts: http://search-db:9200 extraInitContainers: @@ -267,7 +267,7 @@ uploadService: tag: v1.12 replicaCount: 2 -brokerService: +broker-service: fullnameOverride: broker-service image: debug: true @@ -327,9 +327,6 @@ brokerService: secret: secretName: broker-service-secret extraPlugins: rabbitmq_prometheus rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl - extraEnvVars: - - name: BITNAMI_DEBUG - value: "true" persistence: enabled: false size: 5Gi @@ -400,13 +397,13 @@ searchService: debug: false replicaCount: 2 -storageService: +storage-service: fullnameOverride: storage-service master: enabled: true filer: enabled: true - replicas: 1 + replicas: 2 enablePVC: false storage: 25Gi s3: @@ -418,10 +415,10 @@ storageService: existingConfigSecret: seaweedfs-s3-secret volume: enabled: true - replicas: 1 + replicas: 2 s3: enabled: true - replicas: 1 + replicas: 2 port: 9000 metricsPort: 9091 enableAuth: true @@ -431,7 +428,7 @@ storageService: username: seaweedfsadmin password: seaweedfsadmin -logService: +log-service: fullnameOverride: log-service config: outputs: |