From 67b17e871fe75e04a872da0f06c79ecb6df0aa39 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Thu, 3 Oct 2024 13:26:27 -0400 Subject: [PATCH 1/5] adding mindsDB --- public/svgs/mindsdb.svg | 12 ++++++++++++ templates/compose/mindsdb.yaml | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 public/svgs/mindsdb.svg create mode 100644 templates/compose/mindsdb.yaml diff --git a/public/svgs/mindsdb.svg b/public/svgs/mindsdb.svg new file mode 100644 index 000000000..53799dd1c --- /dev/null +++ b/public/svgs/mindsdb.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/templates/compose/mindsdb.yaml b/templates/compose/mindsdb.yaml new file mode 100644 index 000000000..44bae7719 --- /dev/null +++ b/templates/compose/mindsdb.yaml @@ -0,0 +1,35 @@ +# documentation: https://docs.mindsdb.com/what-is-mindsdb +# slogan: MindsDB is the platform for building AI from enterprise data, enabling smarter organizations. +# tags: mysql, postgresdb, machine-learning, ai +# logo: svgs/mindsdb.png +# port: 47334 + +services: + mindsdb: + image: mindsdb/mindsdb + restart: always + environment: + - SERVICE_FQDN_MINDSDB_47334 + - MINDSDB_DOCKER_ENV=true + - MINDSDB_STORAGE_DIR=/mindsdb/var + - FLASK_DEBUG=1 # This will make sure http requests are logged regardless of log level + - OPENAI_API_KEY=$OPENAI_API_KEY + - LANGFUSE_HOST=$LANGFUSE_HOST + - LANGFUSE_PUBLIC_KEY=$LANGFUSE_PUBLIC_KEY + - LANGFUSE_SECRET_KEY=$LANGFUSE_SECRET_KEY + - LANGFUSE_RELEASE="local" + # - LANGFUSE_DEBUG="True" + - LANGFUSE_TIMEOUT="10" + - LANGFUSE_SAMPLE_RATE="1.0" + ports: + - 47335:47335 + - 47336:47336 + volumes: + - type: bind + source: . + target: /mindsdb + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"] + interval: 30s + timeout: 4s + retries: 100 From daf355bbe499b4bb37cde150de1957d10c38a757 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Wed, 16 Oct 2024 16:20:12 -0400 Subject: [PATCH 2/5] Update mindsdb.yaml --- templates/compose/mindsdb.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/compose/mindsdb.yaml b/templates/compose/mindsdb.yaml index 44bae7719..d985bd8c9 100644 --- a/templates/compose/mindsdb.yaml +++ b/templates/compose/mindsdb.yaml @@ -10,6 +10,7 @@ services: restart: always environment: - SERVICE_FQDN_MINDSDB_47334 + - SERVICE_FQDN_API_47335 - MINDSDB_DOCKER_ENV=true - MINDSDB_STORAGE_DIR=/mindsdb/var - FLASK_DEBUG=1 # This will make sure http requests are logged regardless of log level @@ -21,13 +22,11 @@ services: # - LANGFUSE_DEBUG="True" - LANGFUSE_TIMEOUT="10" - LANGFUSE_SAMPLE_RATE="1.0" - ports: - - 47335:47335 - - 47336:47336 + # ports: + # - 47335:47335 + # - 47336:47336 volumes: - - type: bind - source: . - target: /mindsdb + - mindsdb-data:/mindsdb healthcheck: test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"] interval: 30s From 38af81c40bee55102b54e9c957b8f2ff05022aa3 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Wed, 16 Oct 2024 18:28:49 -0400 Subject: [PATCH 3/5] Update mindsdb.yaml --- templates/compose/mindsdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/compose/mindsdb.yaml b/templates/compose/mindsdb.yaml index d985bd8c9..230bbbf47 100644 --- a/templates/compose/mindsdb.yaml +++ b/templates/compose/mindsdb.yaml @@ -26,7 +26,7 @@ services: # - 47335:47335 # - 47336:47336 volumes: - - mindsdb-data:/mindsdb + - mindsdb-data:/mindsdb/var healthcheck: test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"] interval: 30s From ce2bc46c28c49cd71051a7acad514b4d73f63b21 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Wed, 16 Oct 2024 18:31:06 -0400 Subject: [PATCH 4/5] Update mindsdb.yaml --- templates/compose/mindsdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/compose/mindsdb.yaml b/templates/compose/mindsdb.yaml index 230bbbf47..06e120863 100644 --- a/templates/compose/mindsdb.yaml +++ b/templates/compose/mindsdb.yaml @@ -10,7 +10,7 @@ services: restart: always environment: - SERVICE_FQDN_MINDSDB_47334 - - SERVICE_FQDN_API_47335 + - SERVICE_FQDN_API_47335=/api - MINDSDB_DOCKER_ENV=true - MINDSDB_STORAGE_DIR=/mindsdb/var - FLASK_DEBUG=1 # This will make sure http requests are logged regardless of log level From 55a8f17cb99863b1e723eb980a695e24dff79a11 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Wed, 16 Oct 2024 22:00:42 -0400 Subject: [PATCH 5/5] WORKING! --- .../compose/grafana-with-postgresql.yaml | 62 +++++++++++-------- templates/compose/mindsdb.yaml | 15 +++++ 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/templates/compose/grafana-with-postgresql.yaml b/templates/compose/grafana-with-postgresql.yaml index 25276468e..5656069fb 100644 --- a/templates/compose/grafana-with-postgresql.yaml +++ b/templates/compose/grafana-with-postgresql.yaml @@ -1,39 +1,49 @@ -# documentation: https://grafana.com -# slogan: Grafana is the open source analytics & monitoring solution for every database. -# tags: grafana,analytics,monitoring,dashboard -# logo: svgs/grafana.svg -# port: 3000 + + +# documentation: https://docs.mindsdb.com/what-is-mindsdb +# slogan: MindsDB is the platform for building AI from enterprise data, enabling smarter organizations. +# tags: mysql, postgresdb, machine-learning, ai +# logo: svgs/mindsdb.png +# port: 47334 services: - grafana: - image: grafana/grafana-oss + mindsdb: + image: mindsdb/mindsdb + restart: always + container_name: mindsdb environment: - - SERVICE_FQDN_GRAFANA_3000 - - GF_SERVER_ROOT_URL=${SERVICE_FQDN_GRAFANA} - - GF_SERVER_DOMAIN=${SERVICE_FQDN_GRAFANA} - - GF_SECURITY_ADMIN_PASSWORD=${SERVICE_PASSWORD_GRAFANA} - - GF_DATABASE_TYPE=postgres - - GF_DATABASE_HOST=postgresql - - GF_DATABASE_USER=$SERVICE_USER_POSTGRES - - GF_DATABASE_PASSWORD=$SERVICE_PASSWORD_POSTGRES - - GF_DATABASE_NAME=${POSTGRES_DB:-grafana} + - SERVICE_FQDN_MINDSDB_47334 + - SERVICE_FQDN_API_47335=/api + - MINDSDB_DOCKER_ENV=true + - MINDSDB_STORAGE_DIR=/mindsdb/var + - FLASK_DEBUG=1 # This will make sure http requests are logged regardless of log level + - OPENAI_API_KEY=$OPENAI_API_KEY + - LANGFUSE_HOST=$LANGFUSE_HOST + - LANGFUSE_PUBLIC_KEY=$LANGFUSE_PUBLIC_KEY + - LANGFUSE_SECRET_KEY=$LANGFUSE_SECRET_KEY + - LANGFUSE_RELEASE="local" + # - LANGFUSE_DEBUG="True" + - LANGFUSE_TIMEOUT="10" + - LANGFUSE_SAMPLE_RATE="1.0" + - MINDSDB_DB_CON=postgresql://postgres:postgres@postgresql + # ports: + # - 47335:47335 + # - 47336:47336 volumes: - - grafana-data:/var/lib/grafana + - mindsdb-data:/mindsdb/var healthcheck: - test: ["CMD", "curl", "-f", "http://127.0.0.1:3000/api/health"] - interval: 5s - timeout: 20s - retries: 10 - depends_on: - - postgresql + test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"] + interval: 30s + timeout: 4s + retries: 100 postgresql: image: postgres:16-alpine volumes: - postgresql-data:/var/lib/postgresql/data environment: - - POSTGRES_USER=$SERVICE_USER_POSTGRES - - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES - - POSTGRES_DB=${POSTGRES_DB:-grafana} + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=mindsdb healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s diff --git a/templates/compose/mindsdb.yaml b/templates/compose/mindsdb.yaml index 06e120863..3628a14d8 100644 --- a/templates/compose/mindsdb.yaml +++ b/templates/compose/mindsdb.yaml @@ -8,6 +8,7 @@ services: mindsdb: image: mindsdb/mindsdb restart: always + container_name: mindsdb environment: - SERVICE_FQDN_MINDSDB_47334 - SERVICE_FQDN_API_47335=/api @@ -22,6 +23,7 @@ services: # - LANGFUSE_DEBUG="True" - LANGFUSE_TIMEOUT="10" - LANGFUSE_SAMPLE_RATE="1.0" + - MINDSDB_DB_CON='postgresql://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgresql' # ports: # - 47335:47335 # - 47336:47336 @@ -32,3 +34,16 @@ services: interval: 30s timeout: 4s retries: 100 + postgresql: + image: postgres:16-alpine + volumes: + - postgresql-data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=$SERVICE_USER_POSTGRES + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES + - POSTGRES_DB=${POSTGRES_DB:-mindsdb} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10