diff --git a/dbrepo-metadata-db/1_setup-schema.sql b/dbrepo-metadata-db/1_setup-schema.sql index 4ba9d70b174dca5b3481d8042f47c332afc4cf2b..bace25377142becc8a6024177225514681f37c44 100644 --- a/dbrepo-metadata-db/1_setup-schema.sql +++ b/dbrepo-metadata-db/1_setup-schema.sql @@ -1,630 +1,6 @@ -BEGIN; - -CREATE TABLE IF NOT EXISTS `mdb_users` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - keycloak_id VARCHAR(36) NOT NULL, - username VARCHAR(255) NOT NULL, - firstname VARCHAR(255), - lastname VARCHAR(255), - orcid VARCHAR(255), - affiliation VARCHAR(255), - is_internal BOOLEAN NOT NULL DEFAULT FALSE, - mariadb_password VARCHAR(255) NOT NULL, - theme VARCHAR(255) NOT NULL DEFAULT ('light'), - language VARCHAR(3) NOT NULL DEFAULT ('en'), - PRIMARY KEY (`id`), - UNIQUE (`keycloak_id`), - UNIQUE (`username`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_images` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - registry VARCHAR(255) NOT NULL DEFAULT 'docker.io', - name VARCHAR(255) NOT NULL, - version VARCHAR(255) NOT NULL, - DEFAULT_port INT NOT NULL, - dialect VARCHAR(255) NOT NULL, - driver_class VARCHAR(255) NOT NULL, - jdbc_method VARCHAR(255) NOT NULL, - is_DEFAULT BOOLEAN NOT NULL DEFAULT FALSE, - created TIMESTAMP NOT NULL DEFAULT NOW(), - last_modified TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE (`name`, `version`), - UNIQUE (`is_DEFAULT`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_containers` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - internal_name VARCHAR(255) NOT NULL, - name VARCHAR(255) NOT NULL, - host VARCHAR(255) NOT NULL, - port INT NOT NULL DEFAULT 3306, - ui_host VARCHAR(255) NOT NULL DEFAULT host, - ui_port INT NOT NULL DEFAULT port, - ui_additional_flags TEXT, - image_id VARCHAR(36) NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - last_modified TIMESTAMP, - privileged_username VARCHAR(255) NOT NULL, - privileged_password VARCHAR(255) NOT NULL, - quota INT, - readonly_username VARCHAR(255) NOT NULL, - readonly_password VARCHAR(255) NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`image_id`) REFERENCES mdb_images (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_licenses` -( - identifier VARCHAR(255) NOT NULL, - uri TEXT NOT NULL, - description TEXT NOT NULL, - PRIMARY KEY (`identifier`), - UNIQUE (uri(200)) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_databases` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - cid VARCHAR(36) NOT NULL, - grafana_dashboard_uid character varying(255), - name VARCHAR(255) NOT NULL, - internal_name VARCHAR(255) NOT NULL, - exchange_name VARCHAR(255) NOT NULL, - description TEXT, - engine VARCHAR(20), - is_public BOOLEAN NOT NULL DEFAULT TRUE, - is_schema_public BOOLEAN NOT NULL DEFAULT TRUE, - is_dashboard_enabled BOOLEAN NOT NULL DEFAULT TRUE, - image LONGBLOB, - owned_by VARCHAR(36) NOT NULL, - contact_person VARCHAR(36) NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - last_modified TIMESTAMP, - PRIMARY KEY (`id`), - FOREIGN KEY (`cid`) REFERENCES mdb_containers (`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_tables` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - tDBID VARCHAR(36) NOT NULL, - tName VARCHAR(64) NOT NULL, - internal_name VARCHAR(64) NOT NULL, - queue_name VARCHAR(255) NOT NULL, - routing_key VARCHAR(255), - tDescription VARCHAR(2048), - num_rows BIGINT, - data_length BIGINT, - max_data_length BIGINT, - avg_row_length BIGINT, - created TIMESTAMP NOT NULL DEFAULT NOW(), - versioned BOOLEAN NOT NULL DEFAULT TRUE, - is_public BOOLEAN NOT NULL DEFAULT TRUE, - is_schema_public BOOLEAN NOT NULL DEFAULT TRUE, - owned_by VARCHAR(36) NOT NULL DEFAULT UUID(), - last_modified TIMESTAMP, - PRIMARY KEY (`ID`), - UNIQUE (`tDBID`, `internal_name`), - FOREIGN KEY (`tDBID`) REFERENCES mdb_databases (`id`), - FOREIGN KEY (`owned_by`) REFERENCES mdb_users (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - tID VARCHAR(36) NOT NULL, - cName VARCHAR(64), - internal_name VARCHAR(64) NOT NULL, - Datatype ENUM ('CHAR','VARCHAR','BINARY','VARBINARY','TINYBLOB','TINYTEXT','TEXT','BLOB','MEDIUMTEXT','MEDIUMBLOB','LONGTEXT','LONGBLOB','ENUM','SET','SERIAL','BIT','TINYINT','BOOL','SMALLINT','MEDIUMINT','INT','BIGINT','FLOAT','DOUBLE','DECIMAL','DATE','DATETIME','TIMESTAMP','TIME','YEAR'), - length BIGINT UNSIGNED NULL, - ordinal_position INT NOT NULL, - index_length BIGINT UNSIGNED NULL, - description VARCHAR(2048), - size BIGINT UNSIGNED, - d BIGINT UNSIGNED, - 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`), - UNIQUE (`tID`, `internal_name`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_enums` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - column_id VARCHAR(36) NOT NULL, - value VARCHAR(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 VARCHAR(36) NOT NULL DEFAULT UUID(), - column_id VARCHAR(36) NOT NULL, - value VARCHAR(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_constraints_foreign_key` -( - fkid VARCHAR(36) NOT NULL DEFAULT UUID(), - tid VARCHAR(36) NOT NULL, - rtid VARCHAR(36) NOT NULL, - name VARCHAR(255) 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_primary_key` -( - pkid VARCHAR(36) NOT NULL DEFAULT UUID(), - tID VARCHAR(36) NOT NULL, - cid VARCHAR(36) NOT NULL, - PRIMARY KEY (`pkid`), - FOREIGN KEY (`tID`) REFERENCES mdb_tables (`id`) ON DELETE CASCADE, - FOREIGN KEY (`cid`) REFERENCES mdb_columns (`id`) ON DELETE CASCADE -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_constraints_foreign_key_reference` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - fkid VARCHAR(36) NOT NULL, - cid VARCHAR(36) NOT NULL, - rcid VARCHAR(36) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE (fkid, cid, rcid), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - name VARCHAR(255) NOT NULL, - tid VARCHAR(36) 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - uid VARCHAR(36) NOT NULL, - cid VARCHAR(36) 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - tid VARCHAR(36) 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - cID VARCHAR(36) NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - PRIMARY KEY (id, cid), - FOREIGN KEY (`id`) REFERENCES mdb_concepts (`id`), - FOREIGN KEY (`cID`) REFERENCES mdb_columns (`ID`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_columns_units` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - cID VARCHAR(36) NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - PRIMARY KEY (id, cID), - FOREIGN KEY (id) REFERENCES mdb_units (id), - FOREIGN KEY (`cID`) REFERENCES mdb_columns (`ID`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_view` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - vdbid VARCHAR(36) NOT NULL, - vName VARCHAR(64) NOT NULL, - internal_name VARCHAR(64) NOT NULL, - Query TEXT NOT NULL, - query_hash VARCHAR(255) NOT NULL, - Public BOOLEAN NOT NULL DEFAULT TRUE, - is_schema_public BOOLEAN NOT NULL DEFAULT TRUE, - InitialView BOOLEAN NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - last_modified TIMESTAMP, - owned_by VARCHAR(36) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE (`vdbid`, `internal_name`), - FOREIGN KEY (`vdbid`) REFERENCES mdb_databases (`id`), - FOREIGN KEY (`owned_by`) REFERENCES mdb_users (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_messages` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - view_id VARCHAR(36) NOT NULL, - name VARCHAR(64), - internal_name VARCHAR(64) NOT NULL, - column_type 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'), - ordinal_position INT NOT NULL, - size BIGINT UNSIGNED, - d BIGINT UNSIGNED, - is_null_allowed BOOLEAN NOT NULL DEFAULT TRUE, - PRIMARY KEY (`id`), - FOREIGN KEY (`view_id`) REFERENCES mdb_view (`id`) ON DELETE CASCADE, - UNIQUE (view_id, internal_name) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifiers` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - dbid VARCHAR(36) NOT NULL, - qid VARCHAR(36), - vid VARCHAR(36), - tid VARCHAR(36), - publisher VARCHAR(255) NOT NULL, - language VARCHAR(2), - publication_year INT NOT NULL, - publication_month INT, - publication_day INT, - identifier_type ENUM ('DATABASE', 'SUBSET', 'VIEW', 'TABLE') NOT NULL, - status ENUM ('DRAFT', 'PUBLISHED') NOT NULL DEFAULT ('PUBLISHED'), - 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(), - owned_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 (`owned_by`) REFERENCES mdb_users (`id`), - FOREIGN KEY (`tid`) REFERENCES mdb_tables (`id`), - FOREIGN KEY (`vid`) REFERENCES mdb_view (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_identifier_licenses` -( - pid VARCHAR(36) NOT NULL DEFAULT UUID(), - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - pid VARCHAR(36) 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - pid VARCHAR(36) 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - pid VARCHAR(36) 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_identifier_related` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - pid VARCHAR(36) NOT NULL DEFAULT UUID(), - value VARCHAR(255) NOT NULL, - type ENUM ('DOI','URL','URN','ARK','ARXIV','BIBCODE','EAN13','EISSN','HANDLE','IGSN','ISBN','ISTC','LISSN','LSID','PMID','PURL','UPC','W3ID') NOT NULL, - relation ENUM ('IS_CITED_BY','CITES','IS_SUPPLEMENT_TO','IS_SUPPLEMENTED_BY','IS_CONTINUED_BY','CONTINUES','IS_DESCRIBED_BY','DESCRIBES','HAS_METADATA','IS_METADATA_FOR','HAS_VERSION','IS_VERSION_OF','IS_NEW_VERSION_OF','IS_PREVIOUS_VERSION_OF','IS_PART_OF','HAS_PART','IS_PUBLISHED_IN','IS_REFERENCED_BY','REFERENCES','IS_DOCUMENTED_BY','DOCUMENTS','IS_COMPILED_BY','COMPILES','IS_VARIANT_FORM_OF','IS_ORIGINAL_FORM_OF','IS_IDENTICAL_TO','IS_REVIEWED_BY','REVIEWS','IS_DERIVED_FROM','IS_SOURCE_OF','IS_REQUIRED_BY','REQUIRES','IS_OBSOLETED_BY','OBSOLETES') NOT NULL, - 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 VARCHAR(36) NOT NULL DEFAULT UUID(), - pid VARCHAR(36) 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_access` -( - aUserID VARCHAR(255) NOT NULL, - aDBID VARCHAR(36) NOT NULL, - attime TIMESTAMP, - download BOOLEAN, - created TIMESTAMP NOT NULL DEFAULT NOW(), - PRIMARY KEY (aUserID, aDBID), - FOREIGN KEY (`aDBID`) REFERENCES mdb_databases (`id`), - FOREIGN KEY (`aUserID`) REFERENCES mdb_users (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_have_access` -( - user_id VARCHAR(36) NOT NULL, - database_id VARCHAR(36) NOT NULL, - access_type ENUM ('READ', 'WRITE_OWN', 'WRITE_ALL') NOT NULL, - created TIMESTAMP NOT NULL DEFAULT NOW(), - PRIMARY KEY (user_id, database_id), - FOREIGN KEY (`database_id`) REFERENCES mdb_databases (`id`), - FOREIGN KEY (`user_id`) REFERENCES mdb_users (`id`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_image_types` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - image_id VARCHAR(36) NOT NULL, - display_name VARCHAR(255) NOT NULL, - value VARCHAR(255) NOT NULL, - size_min INT UNSIGNED, - size_max INT UNSIGNED, - size_DEFAULT INT UNSIGNED, - size_required BOOLEAN comment 'When setting NULL, the service assumes the data type has no size', - size_step INT UNSIGNED, - d_min INT UNSIGNED, - d_max INT UNSIGNED, - d_DEFAULT INT UNSIGNED, - d_required BOOLEAN comment 'When setting NULL, the service assumes the data type has no d', - d_step INT UNSIGNED, - type_hint TEXT, - data_hint TEXT, - documentation TEXT NOT NULL, - is_generated BOOLEAN NOT NULL, - is_quoted BOOLEAN NOT NULL, - is_buildable BOOLEAN NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`image_id`) REFERENCES `mdb_images` (`id`), - UNIQUE (`value`) -) WITH SYSTEM VERSIONING; - -CREATE TABLE IF NOT EXISTS `mdb_image_operators` -( - id VARCHAR(36) NOT NULL DEFAULT UUID(), - image_id VARCHAR(36) NOT NULL, - display_name VARCHAR(255) NOT NULL, - value VARCHAR(255) NOT NULL, - documentation TEXT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`image_id`) REFERENCES `mdb_images` (`id`), - UNIQUE (image_id, value) -) WITH SYSTEM VERSIONING; - -COMMIT; - -BEGIN; - -INSERT INTO `mdb_licenses` (identifier, uri, description) -VALUES ('CC0-1.0', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', - 'CC0 waives copyright interest in a work you''ve created and dedicates it to the world-wide public domain. Use CC0 to opt out of copyright entirely and ensure your work has the widest reach.'), - ('CC-BY-4.0', 'https://creativecommons.org/licenses/by/4.0/legalcode', - 'The Creative Commons Attribution license allows re-distribution and re-use of a licensed work on the condition that the creator is appropriately credited.'); - -INSERT INTO `mdb_images` (id, name, registry, version, DEFAULT_port, dialect, driver_class, jdbc_method) -VALUES ('d79cb089-363c-488b-9717-649e44d8fcc5', 'mariadb', 'docker.io', '11.1.3', 3306, - 'org.hibernate.dialect.MariaDBDialect', 'org.mariadb.jdbc.Driver', 'mariadb'); - -INSERT INTO `mdb_image_types` (image_id, display_name, value, size_min, size_max, size_DEFAULT, size_required, - size_step, d_min, d_max, d_DEFAULT, d_required, d_step, type_hint, data_hint, - documentation, is_quoted, is_buildable, is_generated) -VALUES ('d79cb089-363c-488b-9717-649e44d8fcc5', 'BIGINT(size)', 'bigint', 0, null, null, FALSE, 1, null, null, null, - null, null, null, null, 'https://mariadb.com/kb/en/bigint/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'BINARY(size)', 'binary', 0, 255, 255, TRUE, 1, null, null, null, null, - null, 'size in Bytes', null, 'https://mariadb.com/kb/en/binary/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'BIT(size)', 'bit', 0, 64, null, FALSE, 1, null, null, null, null, null, - null, null, 'https://mariadb.com/kb/en/bit/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'BLOB(size)', 'blob', 0, 65535, null, FALSE, 1, null, null, null, null, - null, 'size in Bytes', null, 'https://mariadb.com/kb/en/blob/', FALSE, FALSE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'BOOL', 'bool', null, null, null, null, null, null, null, null, null, - null, null, null, 'https://mariadb.com/kb/en/bool/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'CHAR(size)', 'char', 0, 255, 255, FALSE, 1, null, null, null, null, - null, null, null, 'https://mariadb.com/kb/en/char/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'DATE', 'date', null, null, null, null, null, null, null, null, null, - null, 'min. 1000-01-01, max. 9999-12-31', 'e.g. YYYY-MM-DD, YY-MM-DD, YYMMDD, YYYY/MM/DD', - 'https://mariadb.com/kb/en/date/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'DATETIME(fsp)', 'datetime', 0, 6, null, null, 1, null, null, null, - null, null, 'fsp=microsecond precision, min. 1000-01-01 00:00:00.0, max. 9999-12-31 23:59:59.9', - 'e.g. YYYY-MM-DD HH:MM:SS, YY-MM-DD HH:MM:SS, YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD, YYMMDD', - 'https://mariadb.com/kb/en/datetime/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'DECIMAL(size, d)', 'decimal', 0, 65, null, FALSE, 1, 0, 38, null, - FALSE, null, null, null, 'https://mariadb.com/kb/en/decimal/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'DOUBLE(size, d)', 'double', null, null, null, FALSE, null, null, null, - null, FALSE, null, null, null, 'https://mariadb.com/kb/en/double/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'ENUM(v1,v2,...)', 'enum', null, null, null, null, null, null, null, - null, null, null, null, 'e.g. value1, value2, ...', 'https://mariadb.com/kb/en/enum/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'FLOAT(size)', 'float', null, null, null, FALSE, null, null, null, null, - null, null, null, null, 'https://mariadb.com/kb/en/float/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'INT(size)', 'int', null, null, null, FALSE, null, null, null, null, - null, null, 'size in Bytes', null, 'https://mariadb.com/kb/en/int/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'LONGBLOB', 'longblob', null, null, null, null, null, null, null, null, - null, null, 'max. 3.999 GiB', null, 'https://mariadb.com/kb/en/longblob/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'LONGTEXT', 'longtext', null, null, null, null, null, null, null, null, - null, null, 'max. 3.999 GiB', null, 'https://mariadb.com/kb/en/longtext/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'MEDIUMBLOB', 'mediumblob', null, null, null, null, null, null, null, - null, null, null, 'max. 15.999 MiB', null, 'https://mariadb.com/kb/en/mediumblob/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'MEDIUMINT', 'mediumint', null, null, null, null, null, null, null, - null, null, null, 'size in Bytes', null, 'https://mariadb.com/kb/en/mediumint/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'MEDIUMTEXT', 'mediumtext', null, null, null, null, null, null, null, - null, null, null, 'size in Bytes', null, 'https://mariadb.com/kb/en/mediumtext/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'SERIAL', 'serial', null, null, null, null, null, null, null, null, - null, null, null, null, 'https://mariadb.com/kb/en/bigint/', TRUE, TRUE, TRUE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'SET(v1,v2,...)', 'set', null, null, null, null, null, null, null, null, - null, null, null, 'e.g. value1, value2, ...', 'https://mariadb.com/kb/en/set/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'SMALLINT(size)', 'smallint', 0, null, null, FALSE, null, null, null, - null, null, null, 'size in Bytes', null, 'https://mariadb.com/kb/en/smallint/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TEXT(size)', 'text', 0, null, null, FALSE, null, null, null, null, - null, null, 'size in Bytes', null, 'https://mariadb.com/kb/en/text/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TIME(fsp)', 'time', 0, 6, 0, FALSE, null, null, null, null, null, null, - 'fsp=microsecond precision, min. 0, max. 6', 'e.g. HH:MM:SS, HH:MM, HHMMSS, H:M:S', - 'https://mariadb.com/kb/en/time/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TIMESTAMP(fsp)', 'timestamp', 0, 6, 0, FALSE, null, null, null, null, - null, null, 'fsp=microsecond precision, min. 0, max. 6', - 'e.g. YYYY-MM-DD HH:MM:SS, YY-MM-DD HH:MM:SS, YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD, YYMMDD', - 'https://mariadb.com/kb/en/timestamp/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TINYBLOB', 'tinyblob', null, null, null, null, null, null, null, null, - null, null, null, 'fsp=microsecond precision, min. 0, max. 6', 'https://mariadb.com/kb/en/timestamp/', FALSE, - TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TINYINT(size)', 'tinyint', 0, null, null, FALSE, null, null, null, - null, null, null, null, 'size in Bytes', 'https://mariadb.com/kb/en/tinyint/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'TINYTEXT', 'tinytext', null, null, null, null, null, null, null, null, - null, null, null, 'max. 255 characters', 'https://mariadb.com/kb/en/tinytext/', TRUE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'YEAR', 'year', 2, 4, null, FALSE, 2, null, null, null, null, null, - 'min. 1901, max. 2155', 'e.g. YYYY, YY', 'https://mariadb.com/kb/en/year/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'VARBINARY(size)', 'varbinary', 0, null, null, TRUE, null, null, null, - null, null, null, null, null, 'https://mariadb.com/kb/en/varbinary/', FALSE, TRUE, FALSE), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'VARCHAR(size)', 'varchar', 0, 65532, 255, TRUE, null, null, null, null, - null, null, null, null, 'https://mariadb.com/kb/en/varchar/', FALSE, TRUE, FALSE); - - -INSERT INTO `mdb_image_operators` (image_id, display_name, value, documentation) -VALUES ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Equal operator', '=', - 'https://mariadb.com/kb/en/assignment-operators-assignment-operator/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'NULL-safe equal operator', '<=>', - 'https://mariadb.com/kb/en/null-safe-equal/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Less-than operator', '<', 'https://mariadb.com/kb/en/less-than/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Less than or equal operator', '<=', - 'https://mariadb.com/kb/en/less-than-or-equal/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Greater-than operator', '>', - 'https://mariadb.com/kb/en/greater-than/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Greater than or equal operator', '>=', - 'https://mariadb.com/kb/en/greater-than-or-equal/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'Not equal operator', '!=', 'https://mariadb.com/kb/en/not-equal/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'LIKE', 'LIKE', 'https://mariadb.com/kb/en/like/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'NOT LIKE', 'NOT LIKE', 'https://mariadb.com/kb/en/not-like/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'IN', 'IN', 'https://mariadb.com/kb/en/in/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'NOT IN', 'NOT IN', 'https://mariadb.com/kb/en/not-in/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'IS NOT NULL', 'IS NOT NULL', 'https://mariadb.com/kb/en/is-not-null/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'IS NULL', 'IS NULL', 'https://mariadb.com/kb/en/is-null/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'REGEXP', 'REGEXP', 'https://mariadb.com/kb/en/regexp/'), - ('d79cb089-363c-488b-9717-649e44d8fcc5', 'NOT REGEXP', 'NOT REGEXP', 'https://mariadb.com/kb/en/not-regexp/'); - -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; \ No newline at end of file + BEGIN; + INSERT INTO `mdb_containers` (name, internal_name, image_id, host, port, privileged_username, privileged_password, readonly_username, readonly_password) + VALUES ('mariadb-galera:11.3.2-debian-12-r9', 'mariadb-galera:11.3.2-debian-12-r9', + 'd79cb089-363c-488b-9717-649e44d8fcc5', 'data-db', 3306, '{{ .Values.datadb.rootUser.user }}', + '{{ .Values.datadb.rootUser.password }}'); + COMMIT; \ No newline at end of file diff --git a/helm/dbrepo/charts/seaweedfs-4.2.1.tgz b/helm/dbrepo/charts/seaweedfs-4.2.1.tgz index 8b7d04b8926ea3f58a45cde600c02805b4805feb..2e8722a788b04ed720c0d9f5d21b694800fe011b 100644 Binary files a/helm/dbrepo/charts/seaweedfs-4.2.1.tgz and b/helm/dbrepo/charts/seaweedfs-4.2.1.tgz differ diff --git a/helm/dbrepo/files/logging.json b/helm/dbrepo/files/logging.json new file mode 100644 index 0000000000000000000000000000000000000000..f737dfaf57ade50f76585405b55d9afd24522150 --- /dev/null +++ b/helm/dbrepo/files/logging.json @@ -0,0 +1,1116 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 3, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 6, + "panels": [], + "title": "Application", + "type": "row" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "warn" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "error" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "info" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "debug" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 1, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "percent", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "WARN", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "hide": false, + "id": "1", + "type": "count" + } + ], + "query": "level: WARN", + "queryType": "lucene", + "refId": "warn", + "timeField": "@timestamp" + }, + { + "alias": "ERROR", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "level: ERROR", + "queryType": "lucene", + "refId": "error", + "timeField": "@timestamp" + }, + { + "alias": "INFO", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "level: INFO", + "queryType": "lucene", + "refId": "info", + "timeField": "@timestamp" + }, + { + "alias": "DEBUG", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "level: DEBUG", + "queryType": "lucene", + "refId": "debug", + "timeField": "@timestamp" + } + ], + "title": "Errors and Warnings over Time", + "type": "barchart" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 8, + "options": { + "dedupStrategy": "none", + "enableInfiniteScrolling": false, + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Logs", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "level: ERROR", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Errors", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "message", + "container_id", + "container_name", + "logger", + "@timestamp" + ] + } + } + } + ], + "type": "logs" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 9, + "options": { + "dedupStrategy": "none", + "enableInfiniteScrolling": false, + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Logs", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "level: WARN", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Warnings", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "message", + "container_id", + "container_name", + "logger", + "@timestamp" + ] + } + } + } + ], + "type": "logs" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 17, + "panels": [], + "title": "Application Debugging", + "type": "row" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 15, + "options": { + "dedupStrategy": "none", + "enableInfiniteScrolling": false, + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Logs", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "level: INFO", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Info", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "message", + "container_id", + "container_name", + "logger", + "@timestamp" + ] + } + } + } + ], + "type": "logs" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 16, + "options": { + "dedupStrategy": "none", + "enableInfiniteScrolling": false, + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Logs", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "level: DEBUG", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Debug", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "message", + "container_id", + "container_name", + "logger", + "@timestamp" + ] + } + } + } + ], + "type": "logs" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 5, + "panels": [], + "title": "HTTP Gateway", + "type": "row" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "request.method" + }, + "properties": [ + { + "id": "custom.width" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 7, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Logs", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "container_name: \"/dbrepo-gateway-service\" AND code: >=400", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "HTTP Gateway Errors", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "code", + "method", + "path", + "size" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": { + "code": 2, + "method": 0, + "path": 1, + "size": 3 + }, + "renameByName": { + "@timestamp": "", + "code": "response.status", + "method": "request.method", + "path": "request.url", + "size": "body.size" + } + } + }, + { + "id": "calculateField", + "options": { + "alias": "Count", + "mode": "reduceRow", + "reduce": { + "include": [ + "request.url", + "response.status" + ], + "reducer": "distinctCount" + }, + "replaceFields": false + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "Count" + } + ] + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Count", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "200" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + }, + { + "id": "displayName", + "value": "200s" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "300" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + }, + { + "id": "displayName", + "value": "300s" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "400" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + }, + { + "id": "displayName", + "value": "400s" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "500" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + }, + { + "id": "displayName", + "value": "500s" + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 34 + }, + "id": 14, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.5.3", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "container_name: \"/dbrepo-gateway-service\" AND code: (>=200 AND <300)", + "queryType": "lucene", + "refId": "200", + "timeField": "@timestamp" + }, + { + "alias": "", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "container_name: \"/dbrepo-gateway-service\" AND code: (>=300 AND <400)", + "queryType": "lucene", + "refId": "300", + "timeField": "@timestamp" + }, + { + "alias": "", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "container_name: \"/dbrepo-gateway-service\" AND code: (>=400 AND <500)", + "queryType": "lucene", + "refId": "400", + "timeField": "@timestamp" + }, + { + "alias": "", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "dbrepoopensearch0" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "container_name: \"/dbrepo-gateway-service\" AND code: >=500", + "queryType": "lucene", + "refId": "500", + "timeField": "@timestamp" + } + ], + "title": "HTTP Status Codes over Time", + "type": "barchart" + } + ], + "preload": false, + "refresh": "1m", + "schemaVersion": 40, + "tags": [ + "ui", + "dashboard", + "metadata", + "data", + "gateway", + "analyse", + "metrics", + "auth", + "search" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Logging", + "uid": "aejhojr0mrpj4c", + "version": 33, + "weekStart": "" +} \ No newline at end of file diff --git a/helm/dbrepo/templates/dashboard-ui-secret.yaml b/helm/dbrepo/templates/dashboard-ui-secret.yaml index 0816c696377d28c3c3e9ab1358e5bce69e4e36b2..4e645eab704765440cbabd76f1bc1ce4df9b495b 100644 --- a/helm/dbrepo/templates/dashboard-ui-secret.yaml +++ b/helm/dbrepo/templates/dashboard-ui-secret.yaml @@ -6,12 +6,11 @@ metadata: name: dashboard-ui-secret namespace: {{ include "common.names.namespace" . | quote }} stringData: - GF_SERVER_PROTOCOL: "http" - GF_SERVER_DOMAIN: "{{ .Values.hostname }}" - GF_SERVER_ROOT_URL: "https://%(domain)s/dashboard/" + BASE_URL: "{{ .Values.gateway }}" GF_AUTH_ANONYMOUS_ENABLED: "true" GF_AUTH_ANONYMOUS_ORG_ROLE: "Viewer" - GF_SERVER_SERVE_FROM_SUB_PATH: "true" + GF_INSTALL_PLUGINS: "yesoreyeram-infinity-datasource,grafana-opensearch-datasource" + GF_SERVER_ROOT_URL: "http://dashboard-ui:3000/dashboard/" GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true" LDAP_ADMIN_USERNAME: "{{ .Values.identityservice.global.adminUser }}" LDAP_ADMIN_PASSWORD: "{{ .Values.identityservice.global.adminPassword }}" @@ -19,7 +18,7 @@ stringData: ldap.toml: | [[servers]] host = "identity-service" - port = 389 + port = 1389 use_ssl = false # Search user bind dn diff --git a/helm/dbrepo/templates/data-db-configmap.yaml b/helm/dbrepo/templates/data-db-configmap.yaml index 31fdb84aee6198ca30eeb22edc72909057fcab1b..cf80439a72b46eda575ae8e9626849caa0dbf6ee 100644 --- a/helm/dbrepo/templates/data-db-configmap.yaml +++ b/helm/dbrepo/templates/data-db-configmap.yaml @@ -1,4 +1,5 @@ {{- if .Values.datadb.enabled }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/helm/dbrepo/templates/gateway-configmap.yaml b/helm/dbrepo/templates/gateway-configmap.yaml index 3f500f0d9b0683e427e86a45a6d988900b5d9cbd..1f9c167e0ac4ff8e5d7ece1dcf01f33025ba95cf 100644 --- a/helm/dbrepo/templates/gateway-configmap.yaml +++ b/helm/dbrepo/templates/gateway-configmap.yaml @@ -36,7 +36,7 @@ data: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://dashboard-ui:3000/; + proxy_pass http://dashboard-ui:3000; proxy_read_timeout 90; } @@ -51,7 +51,7 @@ data: proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; - proxy_pass http://dashboard-ui:3000/; + proxy_pass http://dashboard-ui:3000; proxy_read_timeout 90; } diff --git a/helm/dbrepo/templates/identity-statefulset.yaml b/helm/dbrepo/templates/identity-deployment.yaml similarity index 98% rename from helm/dbrepo/templates/identity-statefulset.yaml rename to helm/dbrepo/templates/identity-deployment.yaml index f65a547e669b1346f6bb58a2bdce7745cd5f430f..57b3dd7c328b6cc24caf2df59c1bde970065c26d 100644 --- a/helm/dbrepo/templates/identity-statefulset.yaml +++ b/helm/dbrepo/templates/identity-deployment.yaml @@ -40,7 +40,7 @@ spec: name: identity-service-secret {{- if .Values.identityservice.persistence.enabled }} volumeMounts: - - name: openldap-data + - name: data mountPath: /bitnami/openldap {{- end }} livenessProbe: @@ -67,7 +67,7 @@ spec: {{- if .Values.identityservice.persistence.enabled }} volumeClaimTemplates: - metadata: - name: openldap-data + name: data spec: accessModes: [ "ReadWriteOnce" ] {{- if .Values.global.storageClass }} diff --git a/helm/dbrepo/templates/logging-configmap.yaml b/helm/dbrepo/templates/logging-configmap.yaml index f4c088642367fafebffce22b7d5c110d272cf728..3755f74368e4a16234ffeebcf61910d6e7f56fbc 100644 --- a/helm/dbrepo/templates/logging-configmap.yaml +++ b/helm/dbrepo/templates/logging-configmap.yaml @@ -6,7 +6,7 @@ metadata: name: logging-service-config namespace: {{ include "common.names.namespace" . | quote }} data: - dbrepo_parser.conf: |- + parsers_dbrepo.conf: |- [PARSER] # https://rubular.com/r/78ieBhDKvlzPnW Name java @@ -51,13 +51,13 @@ data: Time_Key time Time_Format %H:%M:%S.%L Time_Keep On - fluentbit.conf: |- + fluent-bit.conf: |- [SERVICE] Flush 5 Daemon Off Log_Level debug Parsers_File parsers.conf - Parsers_File dbrepo_parser.conf + Parsers_File parsers_dbrepo.conf [INPUT] Name forward diff --git a/helm/dbrepo/templates/logging-deployment.yaml b/helm/dbrepo/templates/logging-deployment.yaml index 80b93a4053896df409ce0edf9a0897933f08fbc2..89fd0948d0479f695ed3956bf6a6956a73c00e67 100644 --- a/helm/dbrepo/templates/logging-deployment.yaml +++ b/helm/dbrepo/templates/logging-deployment.yaml @@ -38,9 +38,12 @@ spec: - containerPort: 24224 protocol: UDP volumeMounts: - - mountPath: /opt/bitnami/fluent-bit/conf/ + - mountPath: /opt/bitnami/fluent-bit/conf/fluent-bit.conf + subPath: fluent-bit.conf + name: config + - mountPath: /opt/bitnami/fluent-bit/conf/parsers_dbrepo.conf + subPath: parsers_dbrepo.conf name: config - readOnly: true livenessProbe: exec: command: diff --git a/helm/dbrepo/templates/metadata-db-configmap.yaml b/helm/dbrepo/templates/metadata-db-configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7a39304dbf3582be116124072cc801f3a0b2bf50 --- /dev/null +++ b/helm/dbrepo/templates/metadata-db-configmap.yaml @@ -0,0 +1,22 @@ +{{- if .Values.metadatadb.enabled }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: metadata-db-setup + namespace: {{ include "common.names.namespace" . | quote }} +data: + {{ (.Files.Glob "files/01-setup-schema.sql").AsConfig | nindent 2 }} + 02-setup-data.sql: | + BEGIN; + INSERT INTO `mdb_containers` (name, internal_name, image_id, host, port, privileged_username, privileged_password, + readonly_username, readonly_password) + VALUES ('mariadb-galera:11.3.2-debian-12-r9', 'mariadb-galera:11.3.2-debian-12-r9', + 'd79cb089-363c-488b-9717-649e44d8fcc5', 'data-db', 3306, '{{ .Values.datadb.rootUser.user }}', + '{{ .Values.datadb.rootUser.password }}', '{{ .Values.datadb.readonlyUser.user }}', + '{{ .Values.datadb.readonlyUser.password }}'); + COMMIT; + {{- with .Values.metadatadb.extraInitDbScripts }} + {{ toYaml . | nindent 2 }} + {{- end }} +{{- end }} diff --git a/helm/dbrepo/templates/metadata-setup-configmap.yaml b/helm/dbrepo/templates/metadata-setup-configmap.yaml deleted file mode 100644 index 36fed736d8368e5209a96fd778f6555b89494bc1..0000000000000000000000000000000000000000 --- a/helm/dbrepo/templates/metadata-setup-configmap.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if .Values.metadatadb.enabled }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: metadata-db-setup - namespace: {{ include "common.names.namespace" . | quote }} -data: - {{- with .Values.metadatadb.extraInitDbScripts }} - {{ toYaml . | nindent 2 }} - {{- end }} - {{ (.Files.Glob "files/01-setup-schema.sql").AsConfig | nindent 2 }} - 02-setup-data.sql: | - BEGIN; - INSERT INTO `mdb_containers` (name, internal_name, image_id, host, port, privileged_username, privileged_password) - VALUES ('mariadb-galera:11.3.2-debian-12-r9', 'mariadb-galera:11.3.2-debian-12-r9', 1, 'data-db', 3306, '{{ .Values.datadb.rootUser.user }}', '{{ .Values.datadb.rootUser.password }}'); - COMMIT; -{{- end }} diff --git a/helm/dbrepo/values.yaml b/helm/dbrepo/values.yaml index fe2278faea9487c6f0b635c11cb9fa44c045c618..90741358d4b82008ad4d74741b2653d544c72dc5 100644 --- a/helm/dbrepo/values.yaml +++ b/helm/dbrepo/values.yaml @@ -166,6 +166,11 @@ datadb: user: root ## @param datadb.rootUser.password The root user password. password: dbrepo + readonlyUser: + ## @param datadb.readonlyUser.user The readonly username. + user: readonly + ## @param datadb.readonlyUser.password The readonly password. + password: readonly db: ## @param datadb.db.name The database name. name: dbrepo diff --git a/helm/seaweedfs/Chart.lock b/helm/seaweedfs/Chart.lock index bd7187708025bddd56e9f840f05aaa8c8a212205..7dca0b6927791dbcc300fffdbf293accae9c37ed 100644 --- a/helm/seaweedfs/Chart.lock +++ b/helm/seaweedfs/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: mariadb repository: oci://registry-1.docker.io/bitnamicharts - version: 20.4.3 + version: 20.5.3 - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts version: 16.6.5 - name: common repository: oci://registry-1.docker.io/bitnamicharts version: 2.30.0 -digest: sha256:caad17722be72729e47ffc699f4de69463e71fdc2cdd5812c60f5119754743a2 -generated: "2025-04-25T09:10:19.697315063+02:00" +digest: sha256:70d3ecdbdf71b1a9bcdea9c0deb4f776fcc2b51af444e85612b32f887c8b5576 +generated: "2025-04-25T10:46:57.714514706+02:00" diff --git a/helm/seaweedfs/charts/mariadb-20.4.3.tgz b/helm/seaweedfs/charts/mariadb-20.4.3.tgz deleted file mode 100644 index be02f47fb0e381105992b699e56fd1fca5f9ba3f..0000000000000000000000000000000000000000 Binary files a/helm/seaweedfs/charts/mariadb-20.4.3.tgz and /dev/null differ diff --git a/helm/seaweedfs/charts/mariadb-20.5.3.tgz b/helm/seaweedfs/charts/mariadb-20.5.3.tgz new file mode 100644 index 0000000000000000000000000000000000000000..26e91fd8cfba97218673197133afa7dbbb7db995 Binary files /dev/null and b/helm/seaweedfs/charts/mariadb-20.5.3.tgz differ diff --git a/make/build.mk b/make/build.mk index 0ec5055ffe91cfd12584fe1e474e2e13fe9a243c..e96740191cce31903362515db376ee43e804db00 100644 --- a/make/build.mk +++ b/make/build.mk @@ -37,7 +37,7 @@ build-python-lib: ## Build the Python Library. .PHONY: build-helm build-helm: ## Build the DBRepo and DBRepo MariaDB Galera Helm Charts. - helm dependency update ./helm/seaweedfs - helm package ./helm/seaweedfs --destination ./build - helm dependency update ./helm/dbrepo +# helm dependency update ./helm/seaweedfs +# helm package ./helm/seaweedfs --destination ./build +# helm dependency update ./helm/dbrepo helm package ./helm/dbrepo --destination ./build