-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.yottadb
More file actions
64 lines (57 loc) · 3.04 KB
/
Dockerfile.yottadb
File metadata and controls
64 lines (57 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Dockerfile.yottadb — YottaDB + Python/uv environment for running yottadb SDK tests
#
# Usage (built automatically by utils/ydb.sh):
# docker build -f Dockerfile.yottadb -t m2py-ydb .
# docker run --rm -v "$PWD:/workspace" m2py-ydb uv run pytest tests/ -x -n0
#
FROM yottadb/yottadb:latest
# Install Python, build tools (for yottadb C extension), and uv
RUN apt-get update -qq \
&& apt-get install -y -qq --no-install-recommends \
python3 python3-dev python3-venv \
gcc ca-certificates curl libffi-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
ENV UV_LINK_MODE=copy
# Set backend
ENV M2PY_GLOBAL_BACKEND=yottadb
# Configure database with VistA-compatible settings.
# Based on WorldVistA/docker-vista createVistaInstance.sh (Sam Habiel et al.).
# Key tunings vs YDB defaults:
# BLOCK_SIZE=4096, RECORD_SIZE=16368, KEY_SIZE=1019 — VistA data needs large records/keys
# GLOBAL_BUFFER_COUNT=4096 — 16 MB buffer cache (vs 1024 default) for heavy ^DD traversal
# ALLOCATION=200000, EXTENSION_COUNT=1024 — pre-allocate to reduce file growth overhead
# LOCK_SPACE=4096 — DMUFINIT acquires ~580 concurrent locks during package installation
# null_subscripts=always — required by VistA code (e.g., ^TMP("MXMLPRSE",$J,"ELE",""))
# TEMP segment (MM access) — memory-mapped I/O for transient globals (^TMP, ^UTILITY, etc.)
RUN bash -c '\
source /opt/yottadb/current/ydb_env_set && \
{ echo "change -segment DEFAULT -ACCESS_METHOD=BG -BLOCK_SIZE=4096 -ALLOCATION=200000 -EXTENSION_COUNT=1024 -GLOBAL_BUFFER_COUNT=4096 -LOCK_SPACE=4096"; \
echo "change -region DEFAULT -RECORD_SIZE=16368 -KEY_SIZE=1019 -NULL_SUBSCRIPTS=ALWAYS"; \
echo "add -segment TEMP -ACCESS_METHOD=MM -BLOCK_SIZE=4096 -ALLOCATION=10000 -EXTENSION_COUNT=1024 -GLOBAL_BUFFER_COUNT=4096 -LOCK_SPACE=400 -FILE=$ydb_dir/$ydb_rel/g/temp.dat"; \
echo "add -region TEMP -RECORD_SIZE=16368 -KEY_SIZE=1019 -NULL_SUBSCRIPTS=ALWAYS -NOJOURNAL -DYNAMIC_SEGMENT=TEMP"; \
echo "add -name TMP -region=TEMP"; \
echo "add -name TEMP -region=TEMP"; \
echo "add -name UTILITY -region=TEMP"; \
echo "add -name XTMP -region=TEMP"; \
echo "add -name XUTL -region=TEMP"; \
echo "add -name HLTMP -region=TEMP"; \
echo "show -all"; \
} | yottadb -run GDE && \
mupip create -region=TEMP && \
mupip set -null_subscripts=always -region DEFAULT && \
mupip set -lock_space=4096 -region DEFAULT'
# Source YDB env on every bash invocation
RUN echo 'source /opt/yottadb/current/ydb_env_set' >> /root/.bashrc
WORKDIR /workspace
# Entrypoint: source YDB env, sync deps (including yottadb group), then
# run whatever command was passed. The venv is placed in /tmp/m2py-venv
# so the host .venv isn't clobbered.
ENTRYPOINT ["/bin/bash", "-c", "\
source /opt/yottadb/current/ydb_env_set && \
export UV_PROJECT_ENVIRONMENT=/tmp/m2py-venv && \
uv sync --group yottadb --quiet 2>&1 | tail -3 && \
exec \"$@\"", "--"]
CMD ["bash"]