diff --git a/.scripts/check-helm.sh b/.scripts/check-helm.sh new file mode 100755 index 0000000000000000000000000000000000000000..2233434029da0f89a672b9796317ac261bfa476a --- /dev/null +++ b/.scripts/check-helm.sh @@ -0,0 +1,6 @@ +#!/bin/bash +helm schema > /dev/null +if [ $? -ne 0 ]; then + echo "!!! Please install the Helm values schema plugin first\n" + echo " https://github.com/losisin/helm-values-schema-json" +fi diff --git a/dbrepo-search-service/init/app.py b/dbrepo-search-service/init/app.py index ed360e41285a73350bdf6ad0294cc266434902e0..450575ba090c445e030c60464a68f820f79b173b 100644 --- a/dbrepo-search-service/init/app.py +++ b/dbrepo-search-service/init/app.py @@ -102,9 +102,11 @@ class App: return True def fetch_databases(self) -> List[Database]: + logging.debug(f"fetching database from endpoint: {self.metadata_service_endpoint}") client = RestClient(endpoint=self.metadata_service_endpoint) databases = [] - for database in client.get_databases(): + for database, index in client.get_databases(): + logging.debug(f"fetching database {index}/{len(databases)} details for database id: {database.id}") databases.append(client.get_database(database_id=database.id)) logging.debug(f"fetched {len(databases)} database(s)") return databases diff --git a/helm/dbrepo-mariadb-galera/.gitignore b/helm/dbrepo-mariadb-galera/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..613d851d27fbfa390c201b7ed8591da3e04bec35 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/.gitignore @@ -0,0 +1,6 @@ +# generated +*.crt +*.key +*.srl +*.csr +build/* \ No newline at end of file diff --git a/helm/dbrepo-mariadb-galera/.helmignore b/helm/dbrepo-mariadb-galera/.helmignore new file mode 100644 index 0000000000000000000000000000000000000000..b9029e8dea3ccab2aabc5c3a8d9226e9bb9ac827 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/.helmignore @@ -0,0 +1,30 @@ +# Dev +values.dev.yaml +Chart.tpl.yaml +hack/ +# MacOS +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Generated +build/ +artifacthub-repo.yml +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# Make +Makefile diff --git a/helm/dbrepo-mariadb-galera/Chart.lock b/helm/dbrepo-mariadb-galera/Chart.lock new file mode 100644 index 0000000000000000000000000000000000000000..fb510b79ee5efe30a1091eb91b09a163f7e6c4e9 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: mariadb-galera + repository: https://charts.bitnami.com/bitnami + version: 10.1.3 +digest: sha256:ec9ea7a577993779d520b0c93990fb04847f96e41f2bd503141ba66338340985 +generated: "2024-09-14T01:42:48.297778184+04:00" diff --git a/helm/dbrepo-mariadb-galera/Chart.yaml b/helm/dbrepo-mariadb-galera/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4be4337885fe446add1835f3a5296bc2a42f9583 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/Chart.yaml @@ -0,0 +1,23 @@ +annotations: + licenses: Apache-2.0 +apiVersion: v2 +name: dbrepo-mariadb-galera +description: Helm Chart for installing DBRepo Data Database +sources: + - https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services +type: application +version: "1.4.6" +appVersion: "1.4.6" +keywords: + - dbrepo +maintainers: + - name: Martin Weise + email: martin.weise@tuwien.ac.at +home: https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/ +icon: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-ui/public/favicon.png +dependencies: + - name: mariadb-galera + alias: database + version: 10.1.3 # app version: 11.1.3 + repository: https://charts.bitnami.com/bitnami + condition: database.enabled \ No newline at end of file diff --git a/helm/dbrepo-mariadb-galera/README.md b/helm/dbrepo-mariadb-galera/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c5aa55100a7959b5a7bc888519e4d7ccbdaefb5e --- /dev/null +++ b/helm/dbrepo-mariadb-galera/README.md @@ -0,0 +1,6 @@ +# DBRepo MariaDB Helm chart + +tbd + +## Parameters + diff --git a/helm/dbrepo-mariadb-galera/charts/mariadb-galera-10.1.3.tgz b/helm/dbrepo-mariadb-galera/charts/mariadb-galera-10.1.3.tgz new file mode 100644 index 0000000000000000000000000000000000000000..c906aaf7634b20f0eaf9358b435b01086bdc4f55 Binary files /dev/null and b/helm/dbrepo-mariadb-galera/charts/mariadb-galera-10.1.3.tgz differ diff --git a/helm/dbrepo-mariadb-galera/templates/_compatibility.tpl b/helm/dbrepo-mariadb-galera/templates/_compatibility.tpl new file mode 100644 index 0000000000000000000000000000000000000000..6fc2aa8fa45e3bf7a8cfdb5312515aa2c27a0491 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/templates/_compatibility.tpl @@ -0,0 +1,42 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* vim: set filetype=mustache: */}} + +{{/* +Return true if the detected platform is Openshift +Usage: +{{- include "common.compatibility.isOpenshift" . -}} +*/}} +{{- define "common.compatibility.isOpenshift" -}} +{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1" -}} +{{- true -}} +{{- end -}} +{{- end -}} + +{{/* +Render a compatible securityContext depending on the platform. By default it is maintained as it is. In other platforms like Openshift we remove default user/group values that do not work out of the box with the restricted-v1 SCC +Usage: +{{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) -}} +*/}} +{{- define "common.compatibility.renderSecurityContext" -}} +{{- $adaptedContext := .secContext -}} + +{{- if (((.context.Values.global).compatibility).openshift) -}} + {{- if or (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "force") (and (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "auto") (include "common.compatibility.isOpenshift" .context)) -}} + {{/* Remove incompatible user/group values that do not work in Openshift out of the box */}} + {{- $adaptedContext = omit $adaptedContext "fsGroup" "runAsUser" "runAsGroup" -}} + {{- if not .secContext.seLinuxOptions -}} + {{/* If it is an empty object, we remove it from the resulting context because it causes validation issues */}} + {{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{/* Remove fields that are disregarded when running the container in privileged mode */}} +{{- if $adaptedContext.privileged -}} + {{- $adaptedContext = omit $adaptedContext "capabilities" "seLinuxOptions" -}} +{{- end -}} +{{- omit $adaptedContext "enabled" | toYaml -}} +{{- end -}} \ No newline at end of file diff --git a/helm/dbrepo-mariadb-galera/templates/_helpers.tpl b/helm/dbrepo-mariadb-galera/templates/_helpers.tpl new file mode 100644 index 0000000000000000000000000000000000000000..b17e44d2dfa6f6e7a09c3ab58b35794c46791c71 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "kubernetes.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "kubernetes.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "kubernetes.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "kubernetes.labels" -}} +helm.sh/chart: {{ include "kubernetes.chart" . }} +{{ include "kubernetes.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "kubernetes.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kubernetes.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "kubernetes.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "kubernetes.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/dbrepo-mariadb-galera/templates/configmap.yaml b/helm/dbrepo-mariadb-galera/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..066a0d1afbbc5d46cd00a1f5315195365aef0c66 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/templates/configmap.yaml @@ -0,0 +1,580 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: database-setup + namespace: {{ .Values.namespace }} +data: + {{- with .Values.database.extraInitDbScripts }} + {{ toYaml . | nindent 2 }} + {{- end }} + 02-setup-data.sql: | + BEGIN; + INSERT INTO `mdb_containers` (name, internal_name, image_id, host, port, sidecar_host, sidecar_port, privileged_username, privileged_password) + VALUES ('MariaDB 11.1.3', 'mariadb_11_1_3', 1, 'data-db', 3306, 'data-db', 8080, 'root', 'dbrepo'); + COMMIT; + 01-setup-schema.sql: | + 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 character varying(255) NOT NULL default ('light'), + language character varying(3) NOT NULL default ('en'), + PRIMARY KEY (id), + UNIQUE (username), + UNIQUE (email) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_images` + ( + id bigint NOT NULL AUTO_INCREMENT, + registry character varying(255) NOT NULL DEFAULT 'docker.io', + 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, + 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_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), + sidecar_port integer, + 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, + quota integer NOT NULL DEFAULT 50, + 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, + description 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, + 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, + `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), + UNIQUE (tDBID, internal_name), + 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(64), + internal_name VARCHAR(64) NOT NULL, + 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, + index_length BIGINT NULL, + description VARCHAR(2048), + 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, + 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 BIGINT NOT NULL AUTO_INCREMENT, + tID BIGINT NOT NULL, + cid BIGINT 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 BIGINT NOT NULL AUTO_INCREMENT, + fkid BIGINT NOT NULL, + cid BIGINT NOT NULL, + rcid BIGINT 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 BIGINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + 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(64) NOT NULL, + internal_name VARCHAR(64) 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, + view_id BIGINT NOT NULL, + dfID BIGINT, + 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 INTEGER NOT NULL, + size BIGINT, + d BIGINT, + auto_generated BOOLEAN DEFAULT false, + is_null_allowed BOOLEAN NOT NULL DEFAULT true, + PRIMARY KEY (id), + FOREIGN KEY (view_id) REFERENCES mdb_view (id) + ) WITH SYSTEM VERSIONING; + + CREATE TABLE IF NOT EXISTS `mdb_identifiers` + ( + id BIGINT NOT NULL AUTO_INCREMENT, + dbid BIGINT NOT NULL, + 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, + 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(), + 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) NOT NULL, + relation varchar(255) 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 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_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, 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` (name, registry, version, default_port, dialect, driver_class, jdbc_method) + VALUES ('mariadb', 'docker.io', '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), + (1, '%d.%c.%Y', 'dd.MM.yyyy', '30.01.2022', false); + + 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/dbrepo-mariadb-galera/templates/secret.yaml b/helm/dbrepo-mariadb-galera/templates/secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fc5a2a7c5ddaa757c9fc29dc75b24d787a3c0656 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: sidecar-secret + namespace: {{ .Values.namespace }} +stringData: + S3_ACCESS_KEY_ID: "{{ .Values.s3.auth.adminAccessKeyId }}" + S3_SECRET_ACCESS_KEY: "{{ .Values.s3.auth.adminSecretAccessKey }}" + S3_STORAGE_ENDPOINT: "{{ .Values.s3.endpoint }}" diff --git a/helm/dbrepo-mariadb-galera/values.schema.json b/helm/dbrepo-mariadb-galera/values.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..9dbb1f01336e3ee40f404473191855d06a992c48 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/values.schema.json @@ -0,0 +1,304 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "database": { + "properties": { + "db": { + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "extraInitDbScripts": { + "properties": {}, + "type": "object" + }, + "extraVolumeMounts": { + "items": { + "properties": { + "mountPath": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "extraVolumes": { + "items": { + "properties": { + "emptyDir": { + "properties": {}, + "type": "object" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "fullnameOverride": { + "type": "string" + }, + "galera": { + "properties": { + "mariabackup": { + "properties": { + "password": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "host": { + "type": "string" + }, + "initdbScriptsConfigMap": { + "type": "string" + }, + "jdbcExtraArgs": { + "type": "string" + }, + "metrics": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "persistence": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "rootUser": { + "properties": { + "password": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "type": "object" + }, + "service": { + "properties": { + "extraPorts": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "targetPort": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "sidecars": { + "items": { + "properties": { + "envFrom": { + "items": { + "properties": { + "secretRef": { + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "livenessProbe": { + "properties": { + "exec": { + "properties": { + "command": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "initialDelaySeconds": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + } + }, + "type": "object" + }, + "name": { + "type": "string" + }, + "ports": { + "items": { + "properties": { + "containerPort": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "protocol": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "readinessProbe": { + "properties": { + "exec": { + "properties": { + "command": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "initialDelaySeconds": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + } + }, + "type": "object" + }, + "securityContext": { + "properties": { + "allowPrivilegeEscalation": { + "type": "boolean" + }, + "capabilities": { + "properties": { + "drop": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "runAsGroup": { + "type": "integer" + }, + "runAsNonRoot": { + "type": "boolean" + }, + "runAsUser": { + "type": "integer" + }, + "seccompProfile": { + "properties": { + "type": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "volumeMounts": { + "items": { + "properties": { + "mountPath": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "namespace": { + "type": "string" + }, + "s3": { + "properties": { + "auth": { + "properties": { + "adminAccessKeyId": { + "type": "string" + }, + "adminSecretAccessKey": { + "type": "string" + } + }, + "type": "object" + }, + "endpoint": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" +} diff --git a/helm/dbrepo-mariadb-galera/values.yaml b/helm/dbrepo-mariadb-galera/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2e8e94c72e593c0d2da52cf0fd35d3cb4277a703 --- /dev/null +++ b/helm/dbrepo-mariadb-galera/values.yaml @@ -0,0 +1,108 @@ +# Copyright the DBRepo developers +# SPDX-License-Identifier: APACHE-2.0 + +## @param namespace The namespace to install the chart +namespace: dbrepo + +s3: + endpoint: http://storage-service-s3:8333 + auth: + adminAccessKeyId: seaweedfsadmin + adminSecretAccessKey: seaweedfsadmin + +database: + ## @param database.enabled Enable the Metadata Database. + enabled: true + ## @skip database.fullnameOverride + fullnameOverride: data-db + ## @param database.host The hostname for the microservices. + host: data-db + rootUser: + ## @param database.rootUser.user The root username. + user: root + ## @param database.rootUser.password The root user password. + password: dbrepo + db: + ## @param database.db.name The database name. + name: dbrepo + galera: + mariabackup: + ## @param database.galera.mariabackup.user The database backup username. + user: backup + ## @param database.galera.mariabackup.password The database backup user password + password: backup + ## @param database.jdbcExtraArgs The extra arguments for JDBC connections in the microservices. + jdbcExtraArgs: "" + metrics: + ## @skip database.metrics.enabled The Prometheus settings. + enabled: false + ## @skip database.initdbScriptsConfigMap The initial database scripts. + initdbScriptsConfigMap: database-setup + ## @param database.extraInitDbScripts Additional init.db scripts that are executed on the first start. + extraInitDbScripts: { } + # 03-additional-data.sql: | + # BEGIN; + # INSERT INTO `mdb_containers` (name, internal_name, image_id, host, port, sidecar_host, sidecar_port, privileged_username, privileged_password) + # VALUES ('MariaDB Galera TEST', 'mariadb_11_1_3', 1, 'data-db', 3306, 'data-db', 80, 'root', 'dbrepo'); + # COMMIT; + ## @param database.replicaCount The number of cluster nodes, should be uneven i.e. 2n+1 + replicaCount: 3 + persistence: + ## @param database.persistence.enabled Enable persistent storage. + enabled: true + ## @skip database.service + service: + extraPorts: + - name: "sidecar" + port: 8080 + targetPort: 8080 + protocol: TCP + ## @skip database.sidecars + sidecars: + - name: sidecar + image: registry.datalab.tuwien.ac.at/dbrepo/data-db-sidecar:1.4.5 + imagePullPolicy: Always + securityContext: + runAsUser: 1001 + runAsGroup: 0 + runAsNonRoot: true + allowPrivilegeEscalation: false + seccompProfile: + type: RuntimeDefault + capabilities: + drop: + - ALL + ports: + - name: "sidecar" + containerPort: 8080 + protocol: TCP + envFrom: + - secretRef: + name: data-service-secret + livenessProbe: + exec: + command: + - /bin/bash + - -ec + - "curl -sSL localhost:8080/health | grep 'UP' || exit 1" + initialDelaySeconds: 120 + periodSeconds: 30 + readinessProbe: + exec: + command: + - /bin/bash + - -ec + - "curl -sSL localhost:8080/health | grep 'UP' || exit 1" + initialDelaySeconds: 30 + periodSeconds: 30 + volumeMounts: + - name: s3 + mountPath: /s3 + ## @skip database.extraVolumeMounts + extraVolumeMounts: + - name: s3 + mountPath: /s3 + ## @skip database.extraVolumes + extraVolumes: + - name: s3 + emptyDir: { } diff --git a/helm/dbrepo/Chart.lock b/helm/dbrepo/Chart.lock index 45878cdfc0597e70b690912b03e500643e617367..21f0b9d1972b91ad04e2ce681c8f97ca0ec18476 100644 --- a/helm/dbrepo/Chart.lock +++ b/helm/dbrepo/Chart.lock @@ -5,9 +5,9 @@ dependencies: - name: keycloak repository: https://charts.bitnami.com/bitnami version: 21.6.1 -- name: mariadb - repository: https://charts.bitnami.com/bitnami - version: 14.1.4 +- name: dbrepo-mariadb-galera + repository: file://../dbrepo-mariadb-galera + version: 1.4.6 - name: mariadb-galera repository: https://charts.bitnami.com/bitnami version: 10.1.3 @@ -23,5 +23,5 @@ dependencies: - name: openldap-stack-ha repository: https://jp-gouin.github.io/helm-openldap/ version: 4.2.5 -digest: sha256:bc81f32931159cbea98f6da5f58ff3425a5cd03183506ab218120be136486468 -generated: "2024-07-12T06:33:37.323435643+02:00" +digest: sha256:b25413b979bd026412ed188968db993c958bc71175b379315d5e24d373f8065f +generated: "2024-09-14T01:52:39.203839653+04:00" diff --git a/helm/dbrepo/Chart.yaml b/helm/dbrepo/Chart.yaml index 9ad87242a2ea2af6f155694e90d99ca28bb990ba..517d649b8a023c2a232ca15e0d4cabdbf0ed3347 100644 --- a/helm/dbrepo/Chart.yaml +++ b/helm/dbrepo/Chart.yaml @@ -26,10 +26,10 @@ dependencies: version: 21.6.1 # app version: 24.0.5 repository: https://charts.bitnami.com/bitnami condition: authservice.enabled - - name: mariadb + - name: dbrepo-mariadb-galera alias: datadb - version: 14.1.4 # app version: 11.1.3 - repository: https://charts.bitnami.com/bitnami + version: 1.4.6 + repository: file://../dbrepo-mariadb-galera condition: datadb.enabled - name: mariadb-galera alias: metadatadb diff --git a/helm/dbrepo/charts/dbrepo-mariadb-galera-1.4.6.tgz b/helm/dbrepo/charts/dbrepo-mariadb-galera-1.4.6.tgz new file mode 100644 index 0000000000000000000000000000000000000000..6729ba0a6c32d47f6710c8e81915c8726f4c3bde Binary files /dev/null and b/helm/dbrepo/charts/dbrepo-mariadb-galera-1.4.6.tgz differ diff --git a/helm/dbrepo/charts/mariadb-14.1.4.tgz b/helm/dbrepo/charts/mariadb-14.1.4.tgz deleted file mode 100644 index 83f470bdcade4fdfc13b0d1f4f46095b877e3bcd..0000000000000000000000000000000000000000 Binary files a/helm/dbrepo/charts/mariadb-14.1.4.tgz and /dev/null differ diff --git a/helm/dbrepo/templates/auth-configmap.yaml b/helm/dbrepo/templates/auth-configmap.yaml index 269d18c99d7800101afc8ac1c3528104fad7243c..948b31e77d83cf289162f3dad5401b374f2e589a 100644 --- a/helm/dbrepo/templates/auth-configmap.yaml +++ b/helm/dbrepo/templates/auth-configmap.yaml @@ -540,7 +540,7 @@ data: "description" : "${default-container-handling}", "composite" : true, "composites" : { - "realm" : [ "find-container", "list-containers" ] + "realm" : [ "find-container" ] }, "clientRole" : false, "containerId" : "82c39861-d877-4667-a0f3-4daa2ee230e0", @@ -2153,7 +2153,7 @@ data: "subType" : "anonymous", "subComponents" : { }, "config" : { - "allowed-protocol-mapper-types" : [ "oidc-full-name-mapper", "saml-user-attribute-mapper", "saml-user-property-mapper", "saml-role-list-mapper", "oidc-usermodel-attribute-mapper", "oidc-usermodel-property-mapper", "oidc-address-mapper", "oidc-sha256-pairwise-sub-mapper" ] + "allowed-protocol-mapper-types" : [ "saml-user-attribute-mapper", "oidc-full-name-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-address-mapper", "saml-user-property-mapper", "oidc-usermodel-property-mapper", "oidc-usermodel-attribute-mapper", "saml-role-list-mapper" ] } }, { "id" : "1849e52a-b8c9-44a8-af3d-ee19376a1ed1", @@ -2179,7 +2179,7 @@ data: "subType" : "authenticated", "subComponents" : { }, "config" : { - "allowed-protocol-mapper-types" : [ "saml-user-property-mapper", "oidc-usermodel-property-mapper", "saml-role-list-mapper", "oidc-address-mapper", "saml-user-attribute-mapper", "oidc-full-name-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-usermodel-attribute-mapper" ] + "allowed-protocol-mapper-types" : [ "saml-role-list-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-full-name-mapper", "oidc-usermodel-property-mapper", "oidc-usermodel-attribute-mapper", "saml-user-property-mapper", "saml-user-attribute-mapper", "oidc-address-mapper" ] } } ], "org.keycloak.storage.UserStorageProvider" : [ { @@ -2195,8 +2195,8 @@ data: "config" : { "ldap.attribute" : [ "createTimestamp" ], "is.mandatory.in.ldap" : [ "false" ], - "always.read.value.from.ldap" : [ "true" ], "read.only" : [ "true" ], + "always.read.value.from.ldap" : [ "true" ], "user.model.attribute" : [ "createTimestamp" ] } }, { @@ -2219,8 +2219,8 @@ data: "config" : { "ldap.attribute" : [ "cn" ], "is.mandatory.in.ldap" : [ "true" ], - "read.only" : [ "false" ], "always.read.value.from.ldap" : [ "true" ], + "read.only" : [ "false" ], "user.model.attribute" : [ "firstName" ] } }, { @@ -2231,8 +2231,8 @@ data: "config" : { "ldap.attribute" : [ "mail" ], "is.mandatory.in.ldap" : [ "false" ], - "read.only" : [ "false" ], "always.read.value.from.ldap" : [ "false" ], + "read.only" : [ "false" ], "user.model.attribute" : [ "email" ] } }, { @@ -2245,13 +2245,13 @@ data: "group.name.ldap.attribute" : [ "cn" ], "preserve.group.inheritance" : [ "false" ], "membership.user.ldap.attribute" : [ "uid" ], - "groups.dn" : [ "ou=users,{{ .Values.identityservice.global.ldapDomain }}" ], + "groups.dn" : [ "ou=users,dc=dbrepo,dc=at" ], "mode" : [ "LDAP_ONLY" ], "user.roles.retrieve.strategy" : [ "LOAD_GROUPS_BY_MEMBER_ATTRIBUTE" ], - "membership.ldap.attribute" : [ "member" ], "ignore.missing.groups" : [ "false" ], - "group.object.classes" : [ "groupOfNames" ], + "membership.ldap.attribute" : [ "member" ], "memberof.ldap.attribute" : [ "memberOf" ], + "group.object.classes" : [ "groupOfNames" ], "groups.path" : [ "/" ], "drop.non.existing.groups.during.sync" : [ "false" ] } @@ -2263,8 +2263,8 @@ data: "config" : { "ldap.attribute" : [ "modifyTimestamp" ], "is.mandatory.in.ldap" : [ "false" ], - "always.read.value.from.ldap" : [ "true" ], "read.only" : [ "true" ], + "always.read.value.from.ldap" : [ "true" ], "user.model.attribute" : [ "modifyTimestamp" ] } }, { @@ -2277,15 +2277,15 @@ data: "is.mandatory.in.ldap" : [ "true" ], "attribute.force.default" : [ "false" ], "is.binary.attribute" : [ "false" ], - "always.read.value.from.ldap" : [ "false" ], "read.only" : [ "false" ], + "always.read.value.from.ldap" : [ "false" ], "user.model.attribute" : [ "username" ] } } ] }, "config" : { - "pagination" : [ "false" ], "fullSyncPeriod" : [ "-1" ], + "pagination" : [ "false" ], "startTls" : [ "false" ], "usersDn" : [ "ou=users,dc=dbrepo,dc=at" ], "connectionPooling" : [ "true" ], @@ -2293,14 +2293,14 @@ data: "useKerberosForPasswordAuthentication" : [ "false" ], "importEnabled" : [ "true" ], "enabled" : [ "true" ], + "bindDn" : [ "cn=admin,dc=dbrepo,dc=at" ], + "bindCredential" : [ "admin" ], "usernameLDAPAttribute" : [ "uid" ], - "bindCredential" : [ "{{ .Values.identityservice.global.adminPassword }}" ], - "bindDn" : [ "cn={{ .Values.identityservice.global.adminUser }},{{ .Values.identityservice.global.ldapDomain }}" ], "changedSyncPeriod" : [ "-1" ], "lastSync" : [ "1719252666" ], "vendor" : [ "other" ], "uuidLDAPAttribute" : [ "entryUUID" ], - "connectionUrl" : [ "ldap://identity-service:389" ], + "connectionUrl" : [ "ldap://identity-service:1389" ], "allowKerberosAuthentication" : [ "false" ], "syncRegistrations" : [ "true" ], "authType" : [ "simple" ], diff --git a/helm/dbrepo/values.schema.json b/helm/dbrepo/values.schema.json index d178a430f279eec834738943ca5e128766f863fe..3e4c87a1ad78fe527c5321c03aec155f4df3c090 100644 --- a/helm/dbrepo/values.schema.json +++ b/helm/dbrepo/values.schema.json @@ -434,217 +434,6 @@ }, "type": "object" }, - "primary": { - "properties": { - "extraVolumeMounts": { - "items": { - "properties": { - "mountPath": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "extraVolumes": { - "items": { - "properties": { - "emptyDir": { - "properties": {}, - "type": "object" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "persistence": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "type": "object" - }, - "service": { - "properties": { - "extraPorts": { - "items": { - "properties": { - "name": { - "type": "string" - }, - "port": { - "type": "integer" - }, - "protocol": { - "type": "string" - }, - "targetPort": { - "type": "integer" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "sidecars": { - "items": { - "properties": { - "envFrom": { - "items": { - "properties": { - "secretRef": { - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "image": { - "type": "string" - }, - "imagePullPolicy": { - "type": "string" - }, - "livenessProbe": { - "properties": { - "exec": { - "properties": { - "command": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "initialDelaySeconds": { - "type": "integer" - }, - "periodSeconds": { - "type": "integer" - } - }, - "type": "object" - }, - "name": { - "type": "string" - }, - "ports": { - "items": { - "properties": { - "containerPort": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "protocol": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "readinessProbe": { - "properties": { - "exec": { - "properties": { - "command": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "initialDelaySeconds": { - "type": "integer" - }, - "periodSeconds": { - "type": "integer" - } - }, - "type": "object" - }, - "securityContext": { - "properties": { - "allowPrivilegeEscalation": { - "type": "boolean" - }, - "capabilities": { - "properties": { - "drop": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "runAsGroup": { - "type": "integer" - }, - "runAsNonRoot": { - "type": "boolean" - }, - "runAsUser": { - "type": "integer" - }, - "seccompProfile": { - "properties": { - "type": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "volumeMounts": { - "items": { - "properties": { - "mountPath": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, "secondary": { "properties": { "replicaCount": { diff --git a/helm/dbrepo/values.yaml b/helm/dbrepo/values.yaml index 30565f66f49e1bcf96cace5b45f64c91d99fdb57..ad50a24f0fea69b98addca6c5ba1535ec46a4e55 100644 --- a/helm/dbrepo/values.yaml +++ b/helm/dbrepo/values.yaml @@ -141,62 +141,6 @@ datadb: metrics: ## @skip datadb.metrics.enabled enabled: true - ## @skip datadb.primary - primary: - service: - extraPorts: - - name: "sidecar" - port: 8080 - targetPort: 8080 - protocol: TCP - sidecars: - - name: sidecar - image: registry.datalab.tuwien.ac.at/dbrepo/data-db-sidecar:1.4.6 - imagePullPolicy: Always - securityContext: - runAsUser: 1001 - runAsGroup: 0 - runAsNonRoot: true - allowPrivilegeEscalation: false - seccompProfile: - type: RuntimeDefault - capabilities: - drop: - - ALL - ports: - - name: "sidecar" - containerPort: 8080 - protocol: TCP - envFrom: - - secretRef: - name: data-service-secret - livenessProbe: - exec: - command: - - /bin/bash - - -ec - - "curl -sSL localhost:8080/health | grep 'UP' || exit 1" - initialDelaySeconds: 120 - periodSeconds: 30 - readinessProbe: - exec: - command: - - /bin/bash - - -ec - - "curl -sSL localhost:8080/health | grep 'UP' || exit 1" - initialDelaySeconds: 30 - periodSeconds: 30 - volumeMounts: - - name: s3 - mountPath: /s3 - extraVolumeMounts: - - name: s3 - mountPath: /s3 - extraVolumes: - - name: s3 - emptyDir: { } - persistence: - enabled: true ## @skip datadb.secondary secondary: replicaCount: 2 diff --git a/make/build.mk b/make/build.mk index 8ccf91ccaa14de4ee207d37b61f2749e2e8d0a3f..861226251224ec7432d77d9bb1b7fa9fb33d0fe9 100644 --- a/make/build.mk +++ b/make/build.mk @@ -30,5 +30,10 @@ build-lib: ## Build the Python Library. (cd ./dbrepo-search-service/init && PIPENV_IGNORE_VIRTUALENVS=1 pipenv install) .PHONY: build-helm -build-helm: ## Build the Helm Chart. +build-helm: ## Build the DBRepo and DBRepo MariaDB Galera Helm Charts. + ./.scripts/check-helm.sh + helm package ./helm/dbrepo-mariadb-galera --destination ./build + helm schema -input ./helm/dbrepo-mariadb-galera/values.yaml -output ./helm/dbrepo-mariadb-galera/values.schema.json + helm dependency update ./helm/dbrepo helm package ./helm/dbrepo --destination ./build + helm schema -input ./helm/dbrepo/values.yaml -output ./helm/dbrepo/values.schema.json diff --git a/make/gen.mk b/make/gen.mk index c57ead4072bd0f61257aab11093b23cbf2670036..322bc6625941b33eb72912212f3034e6cf259dd4 100644 --- a/make/gen.mk +++ b/make/gen.mk @@ -9,7 +9,6 @@ gen-swagger-doc: build-images ## Generate Swagger documentation and fetch. .PHONY: gen-helm-doc gen-helm-doc: build-helm ## Generate Helm documentation and schema - helm schema -input ./helm/dbrepo/values.yaml -output ./helm/dbrepo/values.schema.json || echo "Do you have the plugin installed?: https://github.com/losisin/helm-values-schema-json" readme-generator-for-helm --readme ./helm/dbrepo/README.md --values ./helm/dbrepo/values.yaml .PHONY: gen-dbrepo-doc diff --git a/make/rel.mk b/make/rel.mk index 1d24df1b774a32ea0eb53e6bfe9501bfecbbb524..1f8b5a1cc56c5d6fe7164ebfa4c9007363a4ddbc 100644 --- a/make/rel.mk +++ b/make/rel.mk @@ -27,5 +27,6 @@ release-images: tag-images ## Release the docker images. docker push "${REPOSITORY_URL}/storage-service-init:${APP_VERSION}" .PHONY: release-helm -release-helm: gen-helm-doc ## Release the Helm chart. - helm push ./build/dbrepo-${CHART_VERSION}.tgz oci://registry.datalab.tuwien.ac.at/dbrepo/dbrepo/helm \ No newline at end of file +release-helm: gen-helm-doc ## Release the DBRepo and DBRepo MariaDB Galera Helm charts. + helm push ./build/dbrepo-${CHART_VERSION}.tgz oci://registry.datalab.tuwien.ac.at/dbrepo/dbrepo/helm + helm push ./build/dbrepo-mariadb-galera-${CHART_VERSION}.tgz oci://registry.datalab.tuwien.ac.at/dbrepo/dbrepo/helm \ No newline at end of file