diff --git a/charts/statgpt/Chart.yaml b/charts/statgpt/Chart.yaml index 6eccf39..3513070 100644 --- a/charts/statgpt/Chart.yaml +++ b/charts/statgpt/Chart.yaml @@ -54,4 +54,4 @@ maintainers: name: statgpt sources: - https://github.com/epam/statgpt-helm -version: 1.0.3 +version: 1.0.4 diff --git a/charts/statgpt/README.md b/charts/statgpt/README.md index 4a7cf10..fa6b2e0 100644 --- a/charts/statgpt/README.md +++ b/charts/statgpt/README.md @@ -1,6 +1,6 @@ # statgpt -![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) +![Version: 1.0.4](https://img.shields.io/badge/Version-1.0.4-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) Umbrella chart for StatGPT solution @@ -231,7 +231,7 @@ helm install my-release . --namespace my-namespace --values values.yaml --set ad | pgvector.primary.extraVolumeMounts | list | `[{"mountPath":"/opt/bitnami/postgresql/lib","name":"postgresql-files","subPath":"postgresql-files/lib"},{"mountPath":"/opt/bitnami/postgresql/share","name":"postgresql-files","subPath":"postgresql-files/share"}]` | Mount complete PostgreSQL directories (lib and share) with pgvector extension included | | pgvector.primary.extraVolumes | list | `[{"emptyDir":{},"name":"postgresql-files"}]` | Shared volume for storing complete PostgreSQL directories with pgvector extension | | pgvector.primary.initContainers | list | `[{"command":["/bin/bash","-c","set -e\necho \"=== Setting up PostgreSQL with pgvector extension ===\"\n\nPGVECTOR_VERSION=\"{{ .Values.pgvectorVersion }}\"\necho \"Installing pgvector version: $PGVECTOR_VERSION\"\n\n# Create directory structure in shared volume\nmkdir -p /shared/postgresql-files/lib /shared/postgresql-files/share\n\n# Copy entire existing PostgreSQL directories to preserve all libraries and extensions\necho \"Copying existing PostgreSQL directories...\"\ncp -r /opt/bitnami/postgresql/lib/* /shared/postgresql-files/lib/\ncp -r /opt/bitnami/postgresql/share/* /shared/postgresql-files/share/\n\n# Install build dependencies for compiling pgvector\necho \"Installing build dependencies...\"\ninstall_packages git build-essential\n\n# Clone and build pgvector from source\necho \"Building pgvector extension version $PGVECTOR_VERSION...\"\ncd /tmp\ngit clone --branch \"$PGVECTOR_VERSION\" https://github.com/pgvector/pgvector.git\ncd pgvector\nexport PG_CONFIG=/opt/bitnami/postgresql/bin/pg_config\nmake clean && make\n\n# Add compiled pgvector files to the copied PostgreSQL directories\necho \"Installing pgvector files...\"\ncp vector.so /shared/postgresql-files/lib/\ncp sql/vector--*.sql /shared/postgresql-files/share/extension/\ncp vector.control /shared/postgresql-files/share/extension/\n\n# Set proper ownership for Bitnami PostgreSQL user\nchown -R 1001:1001 /shared\n\n# Verify installation\necho \"Verifying pgvector installation...\"\nls -la /shared/postgresql-files/lib/vector.so\nls -la /shared/postgresql-files/share/extension/vector.control\n\necho \"=== pgvector $PGVECTOR_VERSION setup completed successfully ===\"\n"],"image":"{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}","name":"setup-pgvector","securityContext":{"runAsNonRoot":false,"runAsUser":0},"volumeMounts":[{"mountPath":"/shared","name":"postgresql-files"}]}]` | Build and install pgvector extension by copying existing PostgreSQL directories and adding pgvector files | -| pgvector.primary.initdb | object | `{"scripts":{"01_create_extension.sql":"-- Create the vector extension in the database\nCREATE EXTENSION IF NOT EXISTS vector;\n\n-- Display installed extensions for verification\n\\dx\n"}}` | Database initialization scripts to create the vector extension after PostgreSQL startup | +| pgvector.primary.initdb | object | `{"scripts":{"01_create_extension.sh":"#!/bin/sh\nset -e\n\nexport PGPASSWORD=$POSTGRES_POSTGRES_PASSWORD\n\necho \"=== Creating the vector extension in the database ===\"\npsql -U postgres -d $POSTGRES_DATABASE -c \"CREATE EXTENSION IF NOT EXISTS vector;\"\n\necho \"Currently installed extensions:\"\npsql -U postgres -d $POSTGRES_DATABASE -c \"\\dx\"\n\necho \"=== The vector extension has been successfully created in the database ===\"\n"}}` | Database initialization scripts to create the vector extension after PostgreSQL startup | | pgvector.primary.resources.limits.cpu | string | `"4000m"` | Maximum CPU limit for the container | | pgvector.primary.resources.limits.memory | string | `"4Gi"` | Maximum memory limit for the container | | pgvector.primary.resources.requests.cpu | string | `"2000m"` | Minimum CPU request for resource scheduling | diff --git a/charts/statgpt/values.yaml b/charts/statgpt/values.yaml index e142ded..5460638 100644 --- a/charts/statgpt/values.yaml +++ b/charts/statgpt/values.yaml @@ -478,12 +478,19 @@ pgvector: # -- Database initialization scripts to create the vector extension after PostgreSQL startup initdb: scripts: - 01_create_extension.sql: | - -- Create the vector extension in the database - CREATE EXTENSION IF NOT EXISTS vector; + 01_create_extension.sh: | + #!/bin/sh + set -e - -- Display installed extensions for verification - \dx + export PGPASSWORD=$POSTGRES_POSTGRES_PASSWORD + + echo "=== Creating the vector extension in the database ===" + psql -U postgres -d $POSTGRES_DATABASE -c "CREATE EXTENSION IF NOT EXISTS vector;" + + echo "Currently installed extensions:" + psql -U postgres -d $POSTGRES_DATABASE -c "\dx" + + echo "=== The vector extension has been successfully created in the database ===" elasticsearch: # -- Indicates whether the elasticsearch service is enabled