diff --git a/.docs/.swagger/api-analyse.yaml b/.docs/.swagger/api-analyse.yaml index d40208256c83e2f6ffef38f9bb1d2d517458c677..b59837ca7ee0c457b88c05ba9815bc3625ab40f0 100644 --- a/.docs/.swagger/api-analyse.yaml +++ b/.docs/.swagger/api-analyse.yaml @@ -12,7 +12,7 @@ info: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 title: Database Repository Analyse Service API - version: $TAG + version: __APPVERSION__ openapi: 3.0.0 paths: /api/analyse/determinedt: diff --git a/.docs/.swagger/api-data.yaml b/.docs/.swagger/api-data.yaml index 2dd3a10e3034a394e10836160d00a3e88f011023..0b089a632761ddbebfcd7fe34c4a51b41d3573c5 100644 --- a/.docs/.swagger/api-data.yaml +++ b/.docs/.swagger/api-data.yaml @@ -8,7 +8,7 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: $TAG + version: __APPVERSION__ externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services diff --git a/.docs/.swagger/api-metadata.yaml b/.docs/.swagger/api-metadata.yaml index ee2919a16ebb7cf5afe3308065e27e95ca3dbc0b..185142b56e223473f237db623f01f7be43eed5a3 100644 --- a/.docs/.swagger/api-metadata.yaml +++ b/.docs/.swagger/api-metadata.yaml @@ -8,7 +8,7 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: $TAG + version: __APPVERSION__ externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services diff --git a/.docs/.swagger/api-search.yaml b/.docs/.swagger/api-search.yaml index 6c6822d5fd8d8f683217ae0701058a385f97f013..0da98c6f1d4cc1c78d77911d60abaeefc7293f14 100644 --- a/.docs/.swagger/api-search.yaml +++ b/.docs/.swagger/api-search.yaml @@ -12,7 +12,7 @@ info: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 title: Database Repository Search Service API - version: $TAG + version: __APPVERSION__ openapi: 3.0.0 paths: /api/search: diff --git a/.docs/.swagger/api-sidecar.yaml b/.docs/.swagger/api-sidecar.yaml index 16840f5350f8a53fc5bc985732b94bcbb5aaafa3..d0b972b18d21ac50665ea946d9aa9dd86c45031b 100644 --- a/.docs/.swagger/api-sidecar.yaml +++ b/.docs/.swagger/api-sidecar.yaml @@ -21,7 +21,7 @@ info: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 title: Database Repository Data Database sidecar API - version: $TAG + version: __APPVERSION__ openapi: 3.0.0 paths: /health: diff --git a/.docs/.swagger/api-upload.yaml b/.docs/.swagger/api-upload.yaml index 138a9bb51ee60f8ba27365b79f42dbef8a670d2e..b08342a5433dfef4b25bc211cd76c60e753778c4 100644 --- a/.docs/.swagger/api-upload.yaml +++ b/.docs/.swagger/api-upload.yaml @@ -8,7 +8,7 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: $TAG + version: __APPVERSION__ externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services diff --git a/.docs/deployment-docker-compose.md b/.docs/deployment-docker-compose.md index 761feccfc17587db9d26517a6cf7a689a90a2b47..9769675597ace5f624999f87ad4a8b24634801b0 100644 --- a/.docs/deployment-docker-compose.md +++ b/.docs/deployment-docker-compose.md @@ -20,8 +20,8 @@ For this small, local, test deployment any modern hardware would suffice, we rec the following settings. - min. 8 vCPU cores -- min. 16GB RAM memory -- min. 200GB SSD storage +- min. 8GB free RAM memory +- min. 200GB free SSD storage - min. 100Mbit/s connection *Optional*: public IP-address if you want to secure the deployment with a (free) TLS-certificate from Let's Encrypt. @@ -134,6 +134,22 @@ In case the deployment is unsuccessful, we have explanations on their origin and `sudo netstat -tulpn` (sudo is necessary for the process id) and then stop the service or application gracefully or force a stop via `kill -15 PID` (not recommended). +**IllegalArgumentException values less than -1 bytes are not supported** + +: *Origin*: Your deployment machine (e.g. laptop, virtual machine) appears to not have enough RAM assigned. +: *Solution*: Assign more RAM to the deployment machine (e.g. add vRAM to the virtual machine). + +## Next Steps + +You should now be able to view the front end at [http://localhost](http://localhost). + +Please be warned that the default configuration is not intended for public deployments. It is only intended to have a +running system within minutes to play around within the system and explore features. It is strongly advised to change +the default `.env` environment variables. + +Next, create a [user account](../usage-overview/#create-user-account) and +then [create a database](../usage-overview/#create-database) to [import a dataset](../usage-overview/#import-dataset). + ## Security !!! warning "Known security issues with the default configuration" diff --git a/.docs/deployment-helm.md b/.docs/deployment-helm.md index d87f53e453ead005f8fce802de66c15c98502f0e..70372724aab70877e3ddebc416085fd07cde5d0f 100644 --- a/.docs/deployment-helm.md +++ b/.docs/deployment-helm.md @@ -10,27 +10,21 @@ for your deployment and update the variables, especially `hostname`. ```shell helm upgrade --install dbrepo \ -n dbrepo \ - "oci://s210.dl.hpc.tuwien.ac.at/dbrepo/helm/dbrepo-core" \ + "oci://s210.dl.hpc.tuwien.ac.at/dbrepo/helm/dbrepo" \ --values ./values.yaml \ - --version "1.4.0" \ + --version "__CHARTVERSION__" \ --create-namespace \ --cleanup-on-fail ``` -This chart is also on [Artifact Hub](https://artifacthub.io/packages/helm/dbrepo/dbrepo-core). +This chart is also on [Artifact Hub](https://artifacthub.io/packages/helm/dbrepo/dbrepo) with a full documentation +about values, etc. -## Dependencies +## Prerequisites -Our chart depends on seven other charts which will be automatically resolved when installing our `dbrepo-core` chart: - -* Keycloak (Bitnami, v17.3.3) for [Authentication Service](../system-services-authentication) -* MariaDB Galera (Bitnami, v11.0.1) for [Data Database](../system-databases-data) & [Metadata Database](../system-databases-metadata) -* SeaweedFS (SeaweedFS, v3.59.4) for [Storage Service](../system-services-storage) -* OpenSearch (OpenSearch Project, v2.16.0) for [Search Database](../system-databases-search) -* OpenSearch Dashboards (OpenSearch Project, v2.14.0) for [Search Dashboard](../system-other-search-dashboard) -* PostgreSQL HA (Bitnami, v12.1.7) for [Auth Database](../system-databases-auth) -* RabbitMQ (Bitnami, v12.5.1) for [Broker Service](../system-services-broker) -* FluentBit (FluentBit, v0.40.0) for logging in the cluster. +* Kubernetes 1.24+ +* Kubernetes 3.8.0+ +* PV provisioner support in the underlying infrastructure ## Limitations diff --git a/.docs/images/screenshots/import-database-dump-step-1.png b/.docs/images/screenshots/import-database-dump-step-1.png new file mode 100644 index 0000000000000000000000000000000000000000..6078687b34d755d2770d0a64243d5aeb903a10b0 Binary files /dev/null and b/.docs/images/screenshots/import-database-dump-step-1.png differ diff --git a/.docs/images/screenshots/import-database-dump-step-2.png b/.docs/images/screenshots/import-database-dump-step-2.png new file mode 100644 index 0000000000000000000000000000000000000000..b827109ad6368aa8e258a9a573b35c79410a62c0 Binary files /dev/null and b/.docs/images/screenshots/import-database-dump-step-2.png differ diff --git a/.docs/images/screenshots/import-database-dump-step-3.png b/.docs/images/screenshots/import-database-dump-step-3.png new file mode 100644 index 0000000000000000000000000000000000000000..a51f10fa5986ec1e1a188c9ee34426018367e11d Binary files /dev/null and b/.docs/images/screenshots/import-database-dump-step-3.png differ diff --git a/.docs/overrides/main.html b/.docs/overrides/main.html index 5da83ed9258551258c3a8bc9458d678d66ee62bb..bc23fb67ea28eedf751c5cda48461513524cd46d 100644 --- a/.docs/overrides/main.html +++ b/.docs/overrides/main.html @@ -14,7 +14,7 @@ if (segments.length >= 4) { return segments[3] } else { - return '$VERSION' + return '__APPVERSION__' } } function switchVersion(value) { diff --git a/.docs/redirect.html b/.docs/redirect.html index de670e15b3b0a0832987928fcf6a2a5a81a4ce9f..053a5581bfeeb797c2d571a1dd378b1ed88df305 100644 --- a/.docs/redirect.html +++ b/.docs/redirect.html @@ -5,16 +5,16 @@ <head> <meta charset="UTF-8"> <title>Redirect Notice</title> - <meta http-equiv="Refresh" content="0; url='https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/'" /> + <meta http-equiv="Refresh" content="0; url='https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/__APPVERSION__/'" /> </head> <body> <h1>Redirect Notice</h1> <p> - This page should automatically open the documentation for version <code>$VERSION</code>. In case this page does not load the site is + This page should automatically open the documentation for version <code>__APPVERSION__</code>. In case this page does not load the site is available at: </p> <p> - <a href="https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/">https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/</a> + <a href="https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/__APPVERSION__/">https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/__APPVERSION__/</a> </p> </body> </html> \ No newline at end of file diff --git a/.docs/system-databases-data.md b/.docs/system-databases-data.md index 7e02599f943a14283429d179a91315a6bd316d72..7c31d5e967951b287104a29d0978f6f3b8577202 100644 --- a/.docs/system-databases-data.md +++ b/.docs/system-databases-data.md @@ -15,7 +15,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/data-db-sidecar:$TAG`](https://hub.docker.com/r/dbrepo/data-db-sidecar) + Image: [`dbrepo/data-db-sidecar:__APPVERSION__`](https://hub.docker.com/r/dbrepo/data-db-sidecar) * Ports: 3305/tcp * Swagger UI: `http://<hostname>:1080/swagger-ui/` <a href="../swagger/sidecar" target="_blank">:fontawesome-solid-square-up-right: view online</a> diff --git a/.docs/system-databases-metadata.md b/.docs/system-databases-metadata.md index 326ed3874e3f968fb28f5eaba677c53f9d71b7fa..4ff9980f2538fda70ba5eebfd213ec1ceee07f53 100644 --- a/.docs/system-databases-metadata.md +++ b/.docs/system-databases-metadata.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/metadata-db:$TAG`](https://hub.docker.com/r/dbrepo/metadata-db) + Image: [`dbrepo/metadata-db:__APPVERSION__`](https://hub.docker.com/r/dbrepo/metadata-db) * Ports: 3306/tcp * JDBC: `jdbc://mariadb:<hostname>:3306` diff --git a/.docs/system-databases-search.md b/.docs/system-databases-search.md index c01fa7c638d126148aa8925b02df3eb71af5ffdb..130347215b195972dd47d9d3dfaef9d63e103192 100644 --- a/.docs/system-databases-search.md +++ b/.docs/system-databases-search.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/search-db:$TAG`](https://hub.docker.com/r/dbrepo/search-db) + Image: [`dbrepo/search-db:__APPVERSION__`](https://hub.docker.com/r/dbrepo/search-db) * Ports: 9200/tcp diff --git a/.docs/system-other-ui.md b/.docs/system-other-ui.md index 54194cf7f979088ca148c19a7f5add894cd678ac..955120bb3e1ed87978ae58bea95f6f51362c78c6 100644 --- a/.docs/system-other-ui.md +++ b/.docs/system-other-ui.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/ui:$TAG`](https://hub.docker.com/r/dbrepo/ui) + Image: [`dbrepo/ui:__APPVERSION__`](https://hub.docker.com/r/dbrepo/ui) * Ports: 3000/tcp, 9100/tcp * Prometheus: `http://<hostname>:9100/metrics` @@ -46,7 +46,7 @@ configured as well via the `dbrepo.config.json` values file. The important links ```json title="dbrepo.config.json" { "title": "Database Repository", - "version": "$TAG_DOCKER-COMPOSE", + "version": "__APPVERSION___DOCKER-COMPOSE", "logo": { "path": "/my_logo.png" }, @@ -65,7 +65,7 @@ if you use a Kubernetes deployment via ConfigMap and Volumes). ```yaml title="docker-compose.yml" services: dbrepo-ui: - image: docker.io/dbrepo/ui:$TAG + image: docker.io/dbrepo/ui:__APPVERSION__ volumes: - ./my_logo.png:/app/static/my_logo.png - ./dbrepo.conf.json:/app/dbrepo.conf.json diff --git a/.docs/system-services-analyse.md b/.docs/system-services-analyse.md index 66ee40d47789180e4ad4d5c47e200aba7d493ff6..2fb20690b56558901e2e1d0dfe2a9ed21a7a793b 100644 --- a/.docs/system-services-analyse.md +++ b/.docs/system-services-analyse.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/analyse-service:$TAG`](https://hub.docker.com/r/dbrepo/analyse-service) + Image: [`dbrepo/analyse-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/analyse-service) * Ports: 5000/tcp * Prometheus: `http://<hostname>:5000/metrics` diff --git a/.docs/system-services-authentication.md b/.docs/system-services-authentication.md index 41cea49974dfc7dff90ca6b2ca7ef46d0afa9a03..0f1d32f3291292f489f10042ac280f47debe2499 100644 --- a/.docs/system-services-authentication.md +++ b/.docs/system-services-authentication.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/authentication-service:$TAG`](https://hub.docker.com/r/dbrepo/authentication-service) + Image: [`dbrepo/authentication-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/authentication-service) * Ports: 8080/tcp * Health: `http://<hostname>:8080/api/auth/health` diff --git a/.docs/system-services-data.md b/.docs/system-services-data.md index 88e781e6e8bc22af2dc6299037a164300cafdb8c..b8a1fe6263da6f236735206b7477c65adda84128 100644 --- a/.docs/system-services-data.md +++ b/.docs/system-services-data.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/data-service:$TAG`](https://hub.docker.com/r/dbrepo/data-service) + Image: [`dbrepo/data-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/data-service) * Ports: 9093/tcp * Info: `http://<hostname>:9093/actuator/info` diff --git a/.docs/system-services-gateway.md b/.docs/system-services-gateway.md index aa3c24db64c67c4c553b3857947b8a38cc72b603..718e6c0eb520de12ff91978ac9a1c209b1001ca5 100644 --- a/.docs/system-services-gateway.md +++ b/.docs/system-services-gateway.md @@ -18,13 +18,16 @@ Provides a single point of access to the *application programming interface* (AP standard [NGINX](https://www.nginx.com/) reverse proxy for load balancing. This component is optional if you already have a load balancer or reverse proxy running. -### Settings +## Settings + +### SSL/TLS Security To setup SSL/TLS encryption, mount your TLS certificate and TLS private key into the container directly into the `/etc/nginx/` directory. ```yaml title="docker-compose.yml" services: + ... dbrepo-gateway-service: image: docker.io/nginx:1.25-alpine-slim ports: @@ -38,6 +41,21 @@ services: If your TLS private key as a password, you need to specify it in the `dbrepo.conf` file. +### User Interface + +To serve the [User Interface](../system-other-ui/) under different port than `80`, change the port mapping in +the `docker-compose.yml` to e.g. port `8000`: + +```yaml title="docker-compose.yml" +services: + ... + dbrepo-gateway-service: + image: docker.io/nginx:1.25-alpine-slim + ports: + - "8000:80" + ... +``` + ## Limitations (none relevant to DBRepo) diff --git a/.docs/system-services-metadata.md b/.docs/system-services-metadata.md index 434a8318388afb326a14722486bbc60e628def9b..5c0e1d52001eac9f4c1833214a140aa7a953d639 100644 --- a/.docs/system-services-metadata.md +++ b/.docs/system-services-metadata.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/metadata-service:$TAG`](https://hub.docker.com/r/dbrepo/metadata-service) + Image: [`dbrepo/metadata-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/metadata-service) * Ports: 9099/tcp * Info: `http://<hostname>:9099/actuator/info` diff --git a/.docs/system-services-search.md b/.docs/system-services-search.md index 397feff381a68adcbcbc13998e860f8ae7a0593c..85bba96e9f38cbb5265fc7c1d2207d809d08ce44 100644 --- a/.docs/system-services-search.md +++ b/.docs/system-services-search.md @@ -8,7 +8,7 @@ author: Martin Weise !!! debug "Debug Information" - Image: [`dbrepo/search-service:$TAG`](https://hub.docker.com/r/dbrepo/search-service) + Image: [`dbrepo/search-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/search-service) * Ports: 4000/tcp * Health: `http://<hostname>:4000/api/search/health` diff --git a/.docs/usage-overview.md b/.docs/usage-overview.md index af1ce9cbf8ea18645c2795b3d390e49ab41d6208..075de96375e6a1a65e70659bd4d5773f53ae1e31 100644 --- a/.docs/usage-overview.md +++ b/.docs/usage-overview.md @@ -11,7 +11,7 @@ We give usage examples of the most important use-cases we identified. | [Create User Account](#create-user-account) | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | | [Create Database](#create-database) | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | | [Import Dataset](#import-dataset) | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | -| [Import Database Dump](#import-database-dump) | :x: | :x: | :white_check_mark: | :x: | +| [Import Database Dump](#import-database-dump) | :white_check_mark: | :white_check_mark: | :x: | :x: | | [Import Live Data](#import-live-data) | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | [Export Subset](#export-subset) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | [Assign Database PID](#assign-database-pid) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | @@ -541,19 +541,58 @@ access to. This is the default for self-created databases like above in [Create A user wants to import a database dump in `.sql` (or in `.sql.gz`) format into DBRepo. -=== "JDBC API" +=== "UI" + + First, create a new database as descriped in the [Create Database](#create-database) use-case above. Then, import + the database dump `dump.sql` via the [MySQL Workbench](https://www.mysql.com/products/workbench/) client which is + semi-compatible with MariaDB databases, i.e. core features work some status/performance features do not. + + Setup a new connection in the MySQL Workbench (c.f. Figure 14) by clicking the small + ":material-plus-circle-outline:" button :material-numeric-1-circle-outline: to open the dialog. In the opened dialog + fill out the connection parameters (for local deployments the hostname is `127.0.0.1` and port `3307` for the + [Data Database](../system-databases-data/) :material-numeric-2-circle-outline:. + + The default credentials are username `root` and password `dbrepo`, type the password in + :material-numeric-3-circle-outline: and click the "OK" button. Then finish the setup of the new connection by + clicking the "OK" button :material-numeric-4-circle-outline:. + + <figure markdown> +  + <figcaption>Figure 14: Setup New Connection in MySQL Workbench.</figcaption> + </figure> + + Now you should be able to see some statistics for the Data Database (c.f. Figure 15), especially that it is running + :material-numeric-1-circle-outline: and basic connection and version information :material-numeric-2-circle-outline:. + + <figure markdown> +  + <figcaption>Figure 15: Server status of the Data Database in MySQL Workbench.</figcaption> + </figure> + + Then proceed to import the database dump `dump.sql` by clicking "Data Import/Restore" + :material-numeric-1-circle-outline: and select "Import from Self-Contained File" in the Import Options. Then + select the `dump.sql` file in the file path selection. Last, select the database you want to import this `dump.sql` + into :material-numeric-4-circle-outline: (you can also create a new database for the import by clicking "New..."). + The import starts after clicking "Start Import" :material-numeric-5-circle-outline:. + + <figure markdown> +  + <figcaption>Figure 16: Data Import/Restore in MySQL Workbench.</figcaption> + </figure> + +=== "Terminal" First, create a new database as descriped in the [Create Database](#create-database) use-case above. Then, import the database dump `dump.sql` via the `mariadb` client. ```bash - mariadb -u USERNAME -pYOURPASSWORD db_name < dump.sql + mariadb -H127.0.0.1 -p3307 -uUSERNAME -pYOURPASSWORD db_name < dump.sql ``` Alternatively, if your database dump is compressed, import the `dump.sql.gz` by piping it through `gunzip`. ```bash - gunzip < dump.sql.gz | mysql -u root -pYOURPASSWORD db_name + gunzip < dump.sql.gz | mysql -H127.0.0.1 -p3307 -uUSERNAME -pYOURPASSWORD db_name ``` The [Metadata Service](../system-services-metadata) periodically (by default configuration every 60 seconds) checks diff --git a/.gitignore b/.gitignore index d8df088d814c603259804ff7b011a2d2b8d7f13c..a8f907321af8b733fbac77271140b4c069910b4d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ build/ .docs/.swagger/dist/ .docs/.swagger/site/ site/ +final/ .$* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63d24af465ea1486eeae94fc07d7ee54c73b2263..5db40d358078b2be2a2738f40e16af35c0584ddd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,11 @@ variables: HOSTALIASES: ./hosts - TAG: "${TAG:-latest}" TRIVY_NO_PROGRESS: "true" TRIVY_CACHE_DIR: ".trivycache/" DOCKER_HOST: "unix:///var/run/dind/docker.sock" TESTCONTAINERS_RYUK_DISABLED: "false" - APP_VERSION: "1.4.1" - CHART_VERSION: "1.4.1" + APP_VERSION: "1.4.0" + CHART_VERSION: "1.4.0" image: debian:12-slim @@ -157,8 +156,8 @@ scan-analyse-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-analyse-service-report.json docker.io/dbrepo/analyse-service:latest @@ -178,8 +177,8 @@ scan-authentication-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-authentication-service-report.json docker.io/dbrepo/authentication-service:latest @@ -199,8 +198,8 @@ scan-broker-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-broker-service-report.json docker.io/dbrepo/broker-service:latest @@ -220,8 +219,8 @@ scan-gateway-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-gateway-service-report.json docker.io/nginx:1.25.0-alpine-slim @@ -241,11 +240,10 @@ scan-metadata-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - - "ifconfig eth0 mtu 1450 up" - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-metadata-service-report.json docker.io/dbrepo/metadata-service:latest - trivy image --insecure --exit-code 0 docker.io/dbrepo/metadata-service:latest - trivy image --insecure --exit-code 1 --severity CRITICAL docker.io/dbrepo/metadata-service:latest @@ -263,11 +261,10 @@ scan-data-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - - "ifconfig eth0 mtu 1450 up" - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-data-service-report.json docker.io/dbrepo/data-service:latest - trivy image --insecure --exit-code 0 docker.io/dbrepo/data-service:latest - trivy image --insecure --exit-code 1 --severity CRITICAL docker.io/dbrepo/data-service:latest @@ -285,8 +282,8 @@ scan-search-db: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-search-db-report.json docker.io/dbrepo/search-db:latest @@ -306,8 +303,8 @@ scan-search-dashboard: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-search-dashboard-report.json docker.io/opensearchproject/opensearch-dashboards:2.10.0 @@ -327,8 +324,8 @@ scan-search-db-init: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-search-db-init-report.json docker.io/dbrepo/search-db-init:latest @@ -348,8 +345,8 @@ scan-data-db: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-data-db-report.json docker.io/bitnami/mariadb:11.2.2-debian-11-r0 @@ -369,8 +366,8 @@ scan-metadata-db: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-metadata-db-report.json docker.io/dbrepo/metadata-db:latest @@ -390,8 +387,8 @@ scan-ui: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-ui-report.json docker.io/dbrepo/ui:latest @@ -411,8 +408,8 @@ scan-storage-service: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-storage-service-report.json docker.io/chrislusf/seaweedfs:3.59 @@ -432,8 +429,8 @@ scan-storage-service-init: stage: scan only: refs: - - dev - master + - release-v1.4 allow_failure: true script: - trivy image --insecure --exit-code 0 --format template --template "@.trivy/gitlab.tpl" -o ./.trivy/trivy-storage-service-init-report.json docker.io/dbrepo/storage-service-init:latest @@ -464,7 +461,7 @@ release-latest: - echo "$CI_REGISTRY2_PASSWORD" | docker login --username "$CI_REGISTRY2_USER" --password-stdin $CI_REGISTRY2_URL script: - "ifconfig eth0 mtu 1450 up" - - "apk add make" + - "apk add make bash" - TAG=latest make release release-1.3: @@ -483,7 +480,7 @@ release-1.3: - echo "$CI_REGISTRY2_PASSWORD" | docker login --username "$CI_REGISTRY2_USER" --password-stdin $CI_REGISTRY2_URL script: - "ifconfig eth0 mtu 1450 up" - - "apk add make" + - "apk add make bash" - "TAG=1.3.0 make release" release-1.4: @@ -502,7 +499,7 @@ release-1.4: - echo "$CI_REGISTRY2_PASSWORD" | docker login --username "$CI_REGISTRY2_USER" --password-stdin $CI_REGISTRY2_URL script: - "ifconfig eth0 mtu 1450 up" - - "apk add make" + - "apk add make bash" - "TAG=${APP_VERSION} make release" release-helm-latest: @@ -518,6 +515,7 @@ release-helm-latest: - apk add sed helm - 'sed -i -e "s/^version:.*/version: \"${CHART_VERSION}-0.git.${CI_PIPELINE_ID}.${CI_COMMIT_SHORT_SHA}\"/g" ./helm-charts/dbrepo/Chart.yaml' - 'sed -i -e "s/^appVersion:.*/appVersion: \"${CHART_VERSION}-0.git.${CI_PIPELINE_ID}.${CI_COMMIT_SHORT_SHA}\"/g" ./helm-charts/dbrepo/Chart.yaml' + - find ./helm-charts -type f -exec sed -i -e "s/__CHARTVERSION__/${CHART_VERSION}/g" {} \; - helm package ./helm-charts/dbrepo --destination ./build - helm push "./build/dbrepo-${CHART_VERSION}-0.git.${CI_PIPELINE_ID}.${CI_COMMIT_SHORT_SHA}.tgz" "oci://${CI_REGISTRY2_URL}/helm" @@ -533,9 +531,10 @@ release-helm-1.4: - apk add sed helm curl - 'sed -i -e "s/^version:.*/version: \"${CHART_VERSION}\"/g" ./helm-charts/dbrepo/Chart.yaml' - 'sed -i -e "s/^appVersion:.*/appVersion: \"${APP_VERSION}\"/g" ./helm-charts/dbrepo/Chart.yaml' + - find ./helm-charts -type f -exec sed -i -e "s/__CHARTVERSION__/${CHART_VERSION}/g" {} \; - helm package ./helm-charts/dbrepo --destination ./build - helm push "./build/dbrepo-${CHART_VERSION}.tgz" "oci://${CI_REGISTRY2_URL}/helm" - - curl -sSL -X POST --form 'chart=@dbrepo-${CHART_VERSION}.tgz' --user mweise:${GITLAB_ACCESS_TOKEN} https://gitlab.example.com/api/v4/projects/450/packages/helm/api/stable/charts + - curl -sSL -X POST --form 'chart=@build/dbrepo-${CHART_VERSION}.tgz' --user mweise:${GITLAB_ACCESS_TOKEN} https://gitlab.example.com/api/v4/projects/450/packages/helm/api/stable/charts build-api-latest: stage: build @@ -549,6 +548,7 @@ build-api-latest: - apk add bash git - git fetch && git checkout master - bash .docs/.swagger/swagger-site.sh + - find ./site -type f -exec sed -i -e "s/__APPVERSION__/latest/g" {} \; - mkdir -p ./swagger/latest - cp -r ./site/* ./swagger/latest/ cache: @@ -595,6 +595,7 @@ build-api-1.4: - apk add bash git maven - git fetch && git checkout release-v1.4 - bash .docs/.swagger/swagger-site.sh + - find ./site -type f -exec sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" {} \; - mkdir -p ./swagger/${APP_VERSION} - cp -r ./site/* ./swagger/${APP_VERSION}/ cache: @@ -642,11 +643,12 @@ docs-latest: - apt-get update && apt-get install -y git make sed - git fetch && git checkout master - pip install -r ./requirements.txt - - mkdir -p ./final/{latest,1.3} - - sed -i -e "s/\$TAG/${APP_VERSION}/g" - - sed -i -e "s/\$APP_VERSION/${APP_VERSION}/g" + - mkdir -p ./final + - sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" .docs/redirect.html + - cp ./.docs/redirect.html ./final/index.html + - find .docs/ -type f -exec sed -i -e "s/__APPVERSION__/latest/g" {} \; + - find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/${CHART_VERSION}/g" {} \; - mkdocs build && cp -r ./site ./final/latest - - cp ./.docs/redirect.html ./final/index.html ./final/1.3/index.html - cp -r ./swagger/latest ./final/latest/swagger cache: paths: @@ -703,8 +705,8 @@ docs-1.4: - pip install -r ./.docs/requirements.txt - wget https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/overrides/main.html -O .docs/overrides/main.html -q - mkdir -p ./final - - sed -i -e "s/\$TAG/${APP_VERSION}/g" - - sed -i -e "s/\$APP_VERSION/${APP_VERSION}/g" + - find .docs/ -type f -exec sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" {} \; + - find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/${CHART_VERSION}/g" {} \; - mkdocs build && cp -r ./site ./final/${APP_VERSION} - cp -r ./swagger/${APP_VERSION} ./final/${APP_VERSION}/swagger cache: diff --git a/.scripts/docker-prune.sh b/.scripts/docker-prune.sh new file mode 100755 index 0000000000000000000000000000000000000000..c82dc1b674247df131682619e8bbf30b3d68f541 --- /dev/null +++ b/.scripts/docker-prune.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [[ "$CI_COMMIT_BRANCH" =~ (dev|master) ]]; then + echo "pruning for branch ${CI_COMMIT_BRANCH} ..." + docker system prune -f -a --volumes +fi \ No newline at end of file diff --git a/Makefile b/Makefile index 3dc5869a3cf93298b072c27529c23a7760ccbc2b..19f2a215f992f569b36e5ed73ee0c0be06022840 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,9 @@ build-frontend: build-swagger: bash ./.docs/generate.sh +build-helm: + helm package ./helm-charts/dbrepo --destination ./build + tag: tag-analyse-service tag-authentication-service tag-metadata-db tag-ui tag-metadata-service tag-data-service tag-search-db tag-search-db-init tag-search-service tag-data-db-sidecar tag-analyse-service: diff --git a/README.md b/README.md index 92d200dc1520c6007edfff1bb4e8af75f230c654..3fbcba67d0e1a0f0f48773b77598ebb0f1d9cdbd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/commits/master) [](https://opensource.org/licenses/Apache-2.0) [](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/tags) -[](https://artifacthub.io/packages/helm/dbrepo/dbrepo-core) +[](https://artifacthub.io/packages/helm/dbrepo/dbrepo)  diff --git a/bin/build-docker.sh b/bin/build-docker.sh index e58ec77e3c6f1360303f6e1162f36b9c7eb3f802..0fd30f989cf1710b0493f2f294212f04763d4c1c 100644 --- a/bin/build-docker.sh +++ b/bin/build-docker.sh @@ -1,4 +1,4 @@ #!/bin/bash -docker build -t dbrepo-metadata-service:build --target build dbrepo-metadata-service -docker build -t dbrepo-data-service:build --target build dbrepo-data-service +docker build --network=host -t dbrepo-metadata-service:build --target build dbrepo-metadata-service +docker build --network=host -t dbrepo-data-service:build --target build dbrepo-data-service docker compose build --parallel \ No newline at end of file diff --git a/dbrepo-analyse-service/app.py b/dbrepo-analyse-service/app.py index 4d4c5cda88d2e5fe6c4a1c18551d4124d69c0ec8..792a8240f8a753613acc450e4e6ee0c0a7b7369c 100644 --- a/dbrepo-analyse-service/app.py +++ b/dbrepo-analyse-service/app.py @@ -80,7 +80,7 @@ template = { "info": { "title": "Database Repository Analyse Service API", "description": "Service that analyses data structures", - "version": "$TAG", + "version": "__APPVERSION__", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at", diff --git a/dbrepo-data-db/sidecar/app.py b/dbrepo-data-db/sidecar/app.py index 931f18d85566fdd8f37affa9dc9ee17ec7453164..802a17b3b59033a2b8977937a5a1b80632bc7cf1 100644 --- a/dbrepo-data-db/sidecar/app.py +++ b/dbrepo-data-db/sidecar/app.py @@ -61,7 +61,7 @@ template = { "info": { "title": "Database Repository Data Database sidecar API", "description": "Sidecar that downloads the import .csv file", - "version": "$TAG", + "version": "__APPVERSION__", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at" diff --git a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index d19efa07842120d19b5cb91dbeb7a59461febe04..f7b33979a78946d23cfea809a49a20f2d75bdb76 100644 --- a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -24,7 +24,7 @@ public class SwaggerConfig { .name("Prof. Andreas Rauber") .email("andreas.rauber@tuwien.ac.at")) .description("Service that manages the data") - .version("$TAG") + .version("__APPVERSION__") .license(new License() .name("Apache 2.0") .url("https://www.apache.org/licenses/LICENSE-2.0"))) diff --git a/dbrepo-gateway-service/dbrepo.conf b/dbrepo-gateway-service/dbrepo.conf index d05efc2ef902923b1b6ea5de57c7d2bbfc1a6014..3ae1a2b110aca23d29b079c2add2c10046c21dda 100644 --- a/dbrepo-gateway-service/dbrepo.conf +++ b/dbrepo-gateway-service/dbrepo.conf @@ -73,8 +73,13 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; proxy_pass http://upload; proxy_read_timeout 90; + # Disable request and response buffering + proxy_request_buffering off; + proxy_buffering off; + proxy_http_version 1.1; } location /api/analyse { diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index ad5f5d273eb6ffa8f4eacc28d28834fefeefeb32..8aa287f9fd5c51548aec0ca20562cd07a84d335d 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -24,7 +24,7 @@ public class SwaggerConfig { .name("Prof. Andreas Rauber") .email("andreas.rauber@tuwien.ac.at")) .description("Service that manages the metadata") - .version("$TAG") + .version("__APPVERSION__") .license(new License() .name("Apache 2.0") .url("https://www.apache.org/licenses/LICENSE-2.0"))) diff --git a/dbrepo-search-service/app/__init__.py b/dbrepo-search-service/app/__init__.py index c8cd7d40738d4e15ac0065ac73b64dfbd126b7a3..e090b89e1d966bfb61c0c511efd3a978d0fc8cff 100644 --- a/dbrepo-search-service/app/__init__.py +++ b/dbrepo-search-service/app/__init__.py @@ -66,7 +66,7 @@ def create_app(config_class=Config): "info": { "title": "Database Repository Search Service API", "description": "Service that searches the search database", - "version": "$TAG", + "version": "latest", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at" diff --git a/dbrepo-ui/api/upload.service.js b/dbrepo-ui/api/upload.service.js index f37cf24d1f3bb7e91c9183d5ca570ff46bafa7bb..7627c37e8739091cc3391ed5fce130b9d1a04334 100644 --- a/dbrepo-ui/api/upload.service.js +++ b/dbrepo-ui/api/upload.service.js @@ -1,10 +1,11 @@ import Vue from 'vue' +import config from '../dbrepo.config.json' const tus = require('tus-js-client') class UploadService { upload (file) { return new Promise((resolve, reject) => { - const endpoint = `${location.protocol}//${location.host}/api/upload/files` + const endpoint = `http${config.upload.useSsl ? 's' : ''}://${config.upload.endpoint}:${config.upload.port}/api/upload/files` console.debug('upload endpoint', endpoint) if (!tus.isSupported) { console.error('Your browser does not support uploads!') @@ -19,7 +20,7 @@ class UploadService { filetype: file.type }, onError (error) { - console.error('Failed because: ' + error) + console.error('Failed to upload:', error) reject(error) }, onProgress (bytesUploaded, bytesTotal) { diff --git a/dbrepo-ui/dbrepo.config.json b/dbrepo-ui/dbrepo.config.json index 3ec6309002a75fe1bc2a424d5185175db12109b1..cbd1ca4165707e19f274d9549e074ec67e88052e 100644 --- a/dbrepo-ui/dbrepo.config.json +++ b/dbrepo-ui/dbrepo.config.json @@ -34,6 +34,11 @@ "secret": "seaweedfsadmin" } }, + "upload": { + "endpoint": "localhost", + "port": 1080, + "useSsl": false + }, "database": { "connection": { "extraInfo": null diff --git a/dbrepo-ui/pages/database/_database_id/table/_table_id/import.vue b/dbrepo-ui/pages/database/_database_id/table/_table_id/import.vue index 15ce462653c2ee36976c7edec4f94e92d775e85d..980b440ddd6beaa3a89283e350f5b6a657bc88da 100644 --- a/dbrepo-ui/pages/database/_database_id/table/_table_id/import.vue +++ b/dbrepo-ui/pages/database/_database_id/table/_table_id/import.vue @@ -205,7 +205,8 @@ export default { this.$toast.success('Successfully imported data') this.$router.push(`/database/${this.$route.params.database_id}/table/${this.$route.params.table_id}`) }) - .catch(() => { + .catch((error) => { + this.$toast.error('Failed to import data', error) this.loading = false }) .finally(() => { diff --git a/dbrepo-ui/pages/database/_database_id/table/import.vue b/dbrepo-ui/pages/database/_database_id/table/import.vue index adc353bedae47e6e407a04acef396e74cc3db710..a013fcff66234e4bf2a5348714140e35a5263944 100644 --- a/dbrepo-ui/pages/database/_database_id/table/import.vue +++ b/dbrepo-ui/pages/database/_database_id/table/import.vue @@ -341,8 +341,8 @@ export default { resolve(metadata) }) .catch((error) => { + this.$toast.error('Failed to import data', error) this.loading = false - this.$toast.error('Failed to upload file') reject(error) }) .finally(() => { diff --git a/helm-charts/README.md b/helm-charts/README.md deleted file mode 100644 index 02cc2b39549865a2aa012ec8b604481d54440157..0000000000000000000000000000000000000000 --- a/helm-charts/README.md +++ /dev/null @@ -1 +0,0 @@ -# DBRepo \ No newline at end of file diff --git a/helm-charts/dbrepo/Chart.yaml b/helm-charts/dbrepo/Chart.yaml index e7cb091c5a6786a1c347c11e828bb05330347e71..59295782271c8f78c4796f8c32cd313807897e57 100644 --- a/helm-charts/dbrepo/Chart.yaml +++ b/helm-charts/dbrepo/Chart.yaml @@ -1,10 +1,9 @@ apiVersion: v2 name: dbrepo -description: | - We present a database repository system that allows researchers to ingest data into a central, versioned repository - through common interfaces, provides efficient access to arbitrary subsets of data even when the underlying data store - is evolving, allows reproducing of query results and supports findable-, accessible-, interoperable- and reusable - data. +description: Helm Chart for installing DBRepo +category: Database +sources: + - https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services type: application version: "1.4.1-RC1" appVersion: "1.4.0" @@ -14,8 +13,7 @@ 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/static/favicon.png +icon: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/.docs/images/signet_white.png dependencies: - name: opensearch alias: search-db diff --git a/helm-charts/dbrepo/README.md b/helm-charts/dbrepo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e8cdbdc8001b12877da4fbbe55d88e1f48262e11 --- /dev/null +++ b/helm-charts/dbrepo/README.md @@ -0,0 +1,53 @@ +# DBRepo Helm chart + +[DBRepo](https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/__CHARTVERSION__/) is a database repository system that +allows researchers to ingest data into a central, versioned repository through common interfaces. + +## TL;DR + +Download the +sample [`values.yaml`](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/helm-charts/dbrepo/values.yaml?inline=true) +for your deployment and update the variables, especially `hostname`. + +```bash +helm install my-release "oci://s210.dl.hpc.tuwien.ac.at/dbrepo/helm/dbrepo" --values ./values.yaml --version "__CHARTVERSION__" +``` + +## Prerequisites + +* Kubernetes 1.24+ +* Kubernetes 3.8.0+ +* PV provisioner support in the underlying infrastructure + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +helm install my-release "oci://s210.dl.hpc.tuwien.ac.at/dbrepo/helm/dbrepo" --values ./values.yaml --version "__CHARTVERSION__" +``` + +The command deploys DBRepo on the Kubernetes cluster in the default configuration. The Parameters section lists the +parameters that can be configured during installation. + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Parameters + +### Common parameters + +| Name | Description | Value | +|-----------------|--------------------------------------|-----------------| +| `namespace` | Namespace which DBRepo is running in | `""` | +| `hostname` | The hostname for ingress rules | `""` | +| `strategyType` | Deployments update strategy | `RollingUpdate` | +| `clusterDomain` | Internal cluster domain | `cluster.local` | + diff --git a/helm-charts/dbrepo/values.yaml b/helm-charts/dbrepo/values.yaml index 4fb5af517db018a3facfe2b14de1f042a3f776d4..a477b725a9e870d7ab9b98a3346be26f380e6850 100644 --- a/helm-charts/dbrepo/values.yaml +++ b/helm-charts/dbrepo/values.yaml @@ -1,6 +1,6 @@ -namespace: dbrepo +namespace: -hostname: example.com +hostname: strategyType: RollingUpdate diff --git a/install.sh b/install.sh index da07dd9482681299a47356e55bbd1097ea338729..8c436d2e3c5c2d9f24e903d08bb1e336a49dd877 100644 --- a/install.sh +++ b/install.sh @@ -1,29 +1,59 @@ #!/bin/bash +MIN_CPU=8 +MIN_RAM=8 +SKIP_CHECKS=${SKIP_CHECKS:-0} -# dependency -docker info > /dev/null -if [ $? -ne 0 ]; then - echo "Docker is not installed (or accessible in bash) on your system:" - echo "" - echo " - install docker from https://docs.docker.com/desktop/install/linux-install/" - echo " - make sure the docker executable is in \$PATH" - exit 2 +# checks +if [[ $SKIP_CHECKS -eq 0 ]]; then + echo "[✨] Startup check ..." + docker info > /dev/null + if [[ $? -ne 0 ]]; then + echo "Docker is not installed (or accessible in bash) on your system:" + echo "" + echo " - install docker from https://docs.docker.com/desktop/install/linux-install/" + echo " - make sure the docker executable is in \$PATH" + exit 2 + else + echo "$(docker --version) OK" + fi + CPU=$(cat /proc/cpuinfo | grep processor | wc -l) + if [[ $CPU -lt $MIN_CPU ]]; then + echo "You do not have enough vCPU resources available:" + echo "" + echo " - we found ${CPU} vCPU cores instead of necessary ${MIN_CPU}" + echo " - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag" + exit 3 + else + echo "vCPU ${CPU} OK" + fi + RAM=$(free -g -t | awk 'NR==2 {print $4}') + if [[ $RAM -lt $MIN_RAM ]]; then + echo "You do not have enough RAM free resources:" + echo "" + echo " - we found ${RAM}GB RAM (free) instead of necessary ${RAM}GB" + echo " - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag" + exit 4 + else + echo "RAM ${RAM}GB OK" + fi +else + echo "[✨] Skipping checks ..." fi # environment echo "[🚀] Gathering environment ..." mkdir -p ./dist -curl -sSL -o ./docker-compose.yml https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/docker-compose.prod.yml -curl -sSL -o ./dist/setup-schema_local.sql https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-metadata-db/setup-schema_local.sql -curl -sSL -o ./dist/rabbitmq.conf https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-broker-service/rabbitmq.conf -curl -sSL -o ./dist/enabled_plugins https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-broker-service/enabled_plugins -curl -sSL -o ./dist/cert.pem https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-broker-service/cert.pem -curl -sSL -o ./dist/pubkey.pem https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-broker-service/pubkey.pem -curl -sSL -o ./dist/definitions.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-broker-service/definitions.json -curl -sSL -o ./dist/dbrepo.conf https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-gateway-service/dbrepo.conf -curl -sSL -o ./dist/opensearch_dashboards.yml https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-search-db/opensearch_dashboards.yml -curl -sSL -o ./dist/dbrepo.config.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-ui/dbrepo.config.json -curl -sSL -o ./dist/s3_config.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-storage-service/s3_config.json +curl -sSL -o ./docker-compose.yml https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/docker-compose.prod.yml +curl -sSL -o ./dist/setup-schema_local.sql https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-metadata-db/setup-schema_local.sql +curl -sSL -o ./dist/rabbitmq.conf https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-broker-service/rabbitmq.conf +curl -sSL -o ./dist/enabled_plugins https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-broker-service/enabled_plugins +curl -sSL -o ./dist/cert.pem https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-broker-service/cert.pem +curl -sSL -o ./dist/pubkey.pem https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-broker-service/pubkey.pem +curl -sSL -o ./dist/definitions.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-broker-service/definitions.json +curl -sSL -o ./dist/dbrepo.conf https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-gateway-service/dbrepo.conf +curl -sSL -o ./dist/opensearch_dashboards.yml https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-search-db/opensearch_dashboards.yml +curl -sSL -o ./dist/dbrepo.config.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-ui/dbrepo.config.json +curl -sSL -o ./dist/s3_config.json https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo-storage-service/s3_config.json echo "[📦] Pulling images ..." docker compose pull @@ -45,4 +75,5 @@ if [ $? -eq 0 ]; then echo "" echo " docker compose logs -f" echo "" + echo "Read about next steps online: https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/latest/deployment-docker-compose/#next-steps" fi diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7dd197a44b15e5c7cca6376a7cc0287a7d60c74 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +mkdocs==1.4.3 +mkdocs-material==9.1.17 +mkdocs-with-pdf==0.9.3 +mkdocs-material-extensions>=1.0.3 +requests>=2.27.0 +py-dotenv>=0.1 +python-dotenv==1.0.0 +requests==2.31.0 \ No newline at end of file