Skip to content

Commit

Permalink
build docker for clickzetta
Browse files Browse the repository at this point in the history
  • Loading branch information
yunqiqiliang committed Nov 22, 2023
1 parent f04fad2 commit 62a6af9
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 8 deletions.
3 changes: 3 additions & 0 deletions build_clickzetta_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker-compose build
docker-compose push
#docker-compose -f docker-compose-up-only.yml up -d
32 changes: 32 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"config_version":"1.4",
"storage_dir": "./mdb_storage",
"log": {
"level": {
"console": "ERROR",
"file": "WARNING",
"db": "WARNING"
}
},
"debug": false,
"integrations": {},
"api": {
"http": {
"host": "192.168.8.142",
"port": "47334"
},
"mysql": {
"host": "192.168.8.142",
"password": "",
"port": "47335",
"user": "mindsdb",
"database": "mindsdb",
"ssl": true
},
"mongodb": {
"host": "192.168.8.142",
"port": "47336",
"database": "mindsdb"
}
}
}
27 changes: 27 additions & 0 deletions docker-compose-up-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3.2"

services:

mindsdb:
platform: linux/amd64
restart: always
image: clickzetta/mindsdb:1.0.0
ports:
- '47334:47334'
- '47335:47335'
- '47336:47336'
# watchfiles will reload the app when python files are changed
command: bash -c "watchfiles --filter python 'python -m mindsdb' ."
environment:
MINDSDB_DOCKER_ENV: "True"
MINDSDB_STORAGE_DIR: "/mindsdb/var"
# OPENAI_API_KEY: "..."
volumes:
- type: bind
source: .
target: /mindsdb
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"]
interval: 30s
timeout: 4s
retries: 100
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
dockerfile: docker/mindsdb.Dockerfile
platform: linux/amd64
restart: always
image: clickzetta/mindsdb:1.0.0
ports:
- '47334:47334'
- '47335:47335'
Expand Down
23 changes: 17 additions & 6 deletions docker/mindsdb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
FROM python:3.10 as build
COPY . /mindsdb
WORKDIR /mindsdb
RUN --mount=type=cache,target=/root/.cache/pip pip install "."
# RUN pip install "git+https://github.com/StpMax/clickhouse-sqlalchemy@5eadc4f"
# RUN pip install "git+https://github.com/ea-rus/snowflake-sqlalchemy"
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade langchain && pip install "."


# Install extras on top of the bare mindsdb
Expand All @@ -13,18 +15,27 @@ RUN --mount=type=cache,target=/root/.cache/pip if [ -n "$EXTRAS" ]; then pip ins

# Copy installed pip packages and install only what we need
FROM python:3.10-slim

# "rm ... docker-clean" stops docker from removing packages from our cache
# https://vsupalov.com/buildkit-cache-mount-dockerfile/
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt update && apt-get upgrade -y \
&& apt-get install -y libmagic1 libpq5
--mount=target=/var/cache/apt,type=cache,sharing=locked
# rm -f /etc/apt/apt.conf.d/docker-clean \
# && apt update && apt-get upgrade -y \
# && apt-get install -y libmagic1 libpq5
RUN rm -f /etc/apt/apt.conf.d/docker-clean
RUN apt update
RUN echo "APT Update Completed"
RUN apt-get upgrade -y
RUN echo "APT Upgrade Completed"
RUN apt-get install -y libmagic1 libpq5
RUN echo "APT Package Install Completed"

RUN pip install watchfiles
COPY --link --from=extras /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages

ENV FLASK_DEBUG "1"

EXPOSE 47334/tcp
EXPOSE 47335/tcp
EXPOSE 47336/tcp
EXPOSE 47336/tcp
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
)
DEFAULT_PIP_EXTRAS = [
'postgres',
'mssql',
# 'mssql',
'mysql',
'mariadb',
'scylla',
'cassandra',
'clickhouse',
'snowflake',
# 'snowflake',
'slack',
'file',
'sqlite',
Expand Down

0 comments on commit 62a6af9

Please sign in to comment.