Skip to content

Conversation

@sscargal
Copy link
Contributor

@sscargal sscargal commented Dec 1, 2025

Purpose of the change

Update asyncpg to an official release. Allows build-docker.sh and memmachine-compose.sh build to work.

Description

The pyproject.toml included a GitHub commit version of asyncpg, which caused the Docker image build pipeline to fail as the base image didn't include git. The changes in the asyncpg commit have been merged into v0.31.0, so we removed the explicit commit version and bumped the minimum asyncpg version.

Fixes/Closes

Fixes #637

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I can successfully run build-docker.sh and memmachine-compose.sh build.

  • Manual verification (list step-by-step instructions)

Logs:

$ ./build-docker.sh 
==> Select build options:
Which image type to build? (1: CPU, 2: GPU, 3: Both) [3]: 
Which architectures? (1: amd64, 2: arm64, 3: Both) [3]: 1
Latest Git tag is 'v0.1.10'. Use this? (Y/n): n
Please enter the version tag (e.g., v0.1.1): v0.2.0-rc1
==> A 'latest' tag (e.g., 'latest-gpu') acts as a pointer to the newest stable release.
Apply 'latest' tags for this version? (Y/n): 
Select action (1: Build locally, 2: Build and Push, 3: Cancel) [2]: 1
==> Checking for required dependencies...
==> All dependencies are present.
==> Setting up Docker Buildx multi-architecture builder...
Name:          memmachine_builder
Driver:        docker-container
Last Activity: 2025-12-01 18:50:11 +0000 UTC

Nodes:
Name:                  memmachine_builder0
Endpoint:              unix:///var/run/docker.sock
Driver Options:        image="moby/buildkit:v0.12.0"
Status:                running
BuildKit daemon flags: --allow-insecure-entitlement=network.host
BuildKit version:      v0.12.0
Platforms:             linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
Labels:
 org.mobyproject.buildkit.worker.executor:         oci
 org.mobyproject.buildkit.worker.hostname:         016780a00772
 org.mobyproject.buildkit.worker.network:          host
 org.mobyproject.buildkit.worker.oci.process-mode: sandbox
 org.mobyproject.buildkit.worker.selinux.enabled:  false
 org.mobyproject.buildkit.worker.snapshotter:      overlayfs
GC Policy rule#0:
 All:            false
 Filters:        type==source.local,type==exec.cachemount,type==source.git.checkout
 Keep Duration:  48h0m0s
 Reserved Space: 488.3MiB
GC Policy rule#1:
 All:            false
 Keep Duration:  1440h0m0s
 Reserved Space: 11.18GiB
GC Policy rule#2:
 All:            false
 Reserved Space: 11.18GiB
GC Policy rule#3:
 All:            true
 Reserved Space: 11.18GiB
==> Buildx builder is ready.
==> --- BUILD SUMMARY ---
Image Types: 	 CPU GPU
Version: 		 v0.2.0-rc1
Architectures: 	 linux/amd64
Apply 'latest' tags: 	 true
Action: 		 Local Build
---------------------
Continue? (Y/n): 
==> Preparing to build CPU image...
[+] Building 20.6s (21/21) FINISHED                                                                                                                                                  docker-container:memmachine_builder
 => [internal] load build definition from Dockerfile                                                                                                                                                                0.0s
 => => transferring dockerfile: 1.91kB                                                                                                                                                                              0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:0.8.15                                                                                                                                                        0.7s
 => [internal] load metadata for docker.io/library/python:3.12-slim-trixie                                                                                                                                          0.7s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                                                                   0.0s
 => => transferring context: 1.29kB                                                                                                                                                                                 0.0s
 => FROM ghcr.io/astral-sh/uv:0.8.15@sha256:a5727064a0de127bdb7c9d3c1383f3a9ac307d9f2d8a391edc7896c54289ced0                                                                                                        0.0s
 => => resolve ghcr.io/astral-sh/uv:0.8.15@sha256:a5727064a0de127bdb7c9d3c1383f3a9ac307d9f2d8a391edc7896c54289ced0                                                                                                  0.0s
 => [internal] load build context                                                                                                                                                                                   0.7s
 => => transferring context: 1.51MB                                                                                                                                                                                 0.7s
 => [builder 1/9] FROM docker.io/library/python:3.12-slim-trixie@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                            0.0s
 => => resolve docker.io/library/python:3.12-slim-trixie@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                                    0.0s
 => CACHED [builder 2/9] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y curl &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*                                                        0.0s
 => CACHED [builder 3/9] RUN python -m pip install --upgrade pip                                                                                                                                                    0.0s
 => CACHED [builder 4/9] COPY --from=ghcr.io/astral-sh/uv:0.8.15 /uv /uvx /usr/local/bin/                                                                                                                           0.0s
 => CACHED [builder 5/9] WORKDIR /app                                                                                                                                                                               0.0s
 => CACHED [builder 6/9] COPY pyproject.toml uv.lock ./                                                                                                                                                             0.0s
 => [builder 7/9] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then         uv sync --locked --no-install-project --no-editable --no-dev --extra gpu;     else         uv sync --loc  0.9s
 => [builder 8/9] COPY . /app                                                                                                                                                                                       4.4s 
 => [builder 9/9] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then         uv sync --locked --no-editable --no-dev --extra gpu;     else         uv sync --locked --no-editable --n  0.3s 
 => [final 4/6] WORKDIR /app                                                                                                                                                                                        0.0s 
 => [final 5/6] COPY --from=builder /app/.venv /app/.venv                                                                                                                                                           1.4s 
 => [final 6/6] RUN python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"                                                                                                                 1.1s 
 => exporting to docker image format                                                                                                                                                                                9.8s 
 => => exporting layers                                                                                                                                                                                             6.1s
 => => exporting manifest sha256:ad82c7c61fb024055d27983b689dc03125bfc7a826602d01573ae92c8909fd91                                                                                                                   0.0s 
 => => exporting config sha256:d5e97eed58463463e09bec1ae0b1233fdb7b20239285e2f73f2c3fd92a58b405                                                                                                                     0.0s
 => => sending tarball                                                                                                                                                                                              3.7s
 => importing to docker                                                                                                                                                                                             3.0s
 => => loading layer eb42032f82ad 5.58MB / 5.58MB                                                                                                                                                                   3.0s
 => => loading layer 0b1f731781fe 7.10MB / 7.10MB                                                                                                                                                                   2.8s
 => => loading layer 8a0f26077e12 93B / 93B                                                                                                                                                                         2.6s
 => => loading layer 39bcd11ae6a4 83.73MB / 83.73MB                                                                                                                                                                 2.6s
 => => loading layer 4c1910f77f4b 11.24MB / 11.24MB                                                                                                                                                                 0.2s
==> CPU image built successfully!
==> To test it, run: docker run -it --rm memmachine/memmachine:v0.2.0-rc1-cpu bash
==> Preparing to build GPU image...
[+] Building 277.5s (20/20) FINISHED                                                                                                                                                 docker-container:memmachine_builder
 => [internal] load build definition from Dockerfile                                                                                                                                                                0.0s
 => => transferring dockerfile: 1.91kB                                                                                                                                                                              0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:0.8.15                                                                                                                                                        0.1s
 => [internal] load metadata for docker.io/library/python:3.12-slim-trixie                                                                                                                                          0.1s
 => [internal] load .dockerignore                                                                                                                                                                                   0.0s
 => => transferring context: 1.29kB                                                                                                                                                                                 0.0s
 => FROM ghcr.io/astral-sh/uv:0.8.15@sha256:a5727064a0de127bdb7c9d3c1383f3a9ac307d9f2d8a391edc7896c54289ced0                                                                                                        0.0s
 => => resolve ghcr.io/astral-sh/uv:0.8.15@sha256:a5727064a0de127bdb7c9d3c1383f3a9ac307d9f2d8a391edc7896c54289ced0                                                                                                  0.0s
 => [internal] load build context                                                                                                                                                                                   0.6s
 => => transferring context: 1.51MB                                                                                                                                                                                 0.6s
 => [builder 1/9] FROM docker.io/library/python:3.12-slim-trixie@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                            0.0s
 => => resolve docker.io/library/python:3.12-slim-trixie@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                                    0.0s
 => CACHED [builder 2/9] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y curl &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*                                                        0.0s
 => CACHED [builder 3/9] RUN python -m pip install --upgrade pip                                                                                                                                                    0.0s
 => CACHED [builder 4/9] COPY --from=ghcr.io/astral-sh/uv:0.8.15 /uv /uvx /usr/local/bin/                                                                                                                           0.0s
 => CACHED [builder 5/9] WORKDIR /app                                                                                                                                                                               0.0s
 => CACHED [builder 6/9] COPY pyproject.toml uv.lock ./                                                                                                                                                             0.0s
 => [builder 7/9] RUN --mount=type=cache,target=/root/.cache/uv     if [ "true" = "true" ]; then         uv sync --locked --no-install-project --no-editable --no-dev --extra gpu;     else         uv sync --loc  13.3s
 => [builder 8/9] COPY . /app                                                                                                                                                                                       2.3s 
 => [builder 9/9] RUN --mount=type=cache,target=/root/.cache/uv     if [ "true" = "true" ]; then         uv sync --locked --no-editable --no-dev --extra gpu;     else         uv sync --locked --no-editable --no  0.3s 
 => CACHED [final 4/6] WORKDIR /app                                                                                                                                                                                 0.0s 
 => [final 5/6] COPY --from=builder /app/.venv /app/.venv                                                                                                                                                          18.5s 
 => [final 6/6] RUN python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"                                                                                                                 3.2s 
 => exporting to docker image format                                                                                                                                                                              219.1s 
 => => exporting layers                                                                                                                                                                                           171.1s 
 => => exporting manifest sha256:bc2017c2ffb9c60c9fe6705e7d69c76ad6282647e0bd3f1384c0c11e618368d2                                                                                                                   0.0s 
 => => exporting config sha256:e98a325608131ddaa1fcdcfdeefdea38e5e70e732070a970897d4a6396832951                                                                                                                     0.0s 
 => => sending tarball                                                                                                                                                                                             48.0s
 => importing to docker                                                                                                                                                                                            30.1s
 => => loading layer b7dba91f1964 4.24GB / 4.24GB                                                                                                                                                                  30.1s
 => => loading layer a1fe44befc9e 17.36MB / 17.36MB                                                                                                                                                                 0.9s
==> GPU image built successfully!
==> To test it, run: docker run -it --rm memmachine/memmachine:v0.2.0-rc1-gpu bash
==> All selected operations are complete.

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Screenshots/Gifs

See logs above

Further comments

MemMachine starts successfully using the locally built Docker images.
Only tested on Linux. Needs verification on Windows and Mac OS X.

Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
@sscargal sscargal requested review from jealous and jgong December 1, 2025 19:37
@sscargal
Copy link
Contributor Author

sscargal commented Dec 1, 2025

MemMachine starts successfully using the new Docker image (CPU)

$ ./memmachine-compose.sh 
MemMachine Docker Startup Script
====================================

[SUCCESS] Docker and Docker Compose are available
[WARNING] .env file not found. Creating from template...
[SUCCESS] Created .env file from sample_configs/env.dockercompose
[WARNING] configuration.yml file not found. Creating from template...
[PROMPT] Which configuration would you like to use for the Docker Image? (CPU/GPU) [CPU]: 
[INFO] CPU configuration selected.
[PROMPT] Which provider would you like to use? (OpenAI/Bedrock/Ollama) [OpenAI]: 
[INFO] Selected provider: OPENAI
[SUCCESS] Set MEMMACHINE_IMAGE to memmachine/memmachine:latest-cpu in .env file
[PROMPT] Which OpenAI LLM model would you like to use? [gpt-4o-mini]: 
[SUCCESS] Selected OpenAI LLM model: gpt-4o-mini
[PROMPT] Which OpenAI embedding model would you like to use? [text-embedding-3-small]: 
[SUCCESS] Selected OpenAI embedding model: text-embedding-3-small
[INFO] Generating configuration file for OPENAI provider...
[SUCCESS] Generated configuration file with OPENAI provider settings
[PROMPT] OpenAI API key is not set. Would you like to set your OpenAI API key? (y/N) y
[PROMPT] Enter your OpenAI API key: 
[SUCCESS] Set OPENAI_API_KEY in .env and configuration.yml
[PROMPT] Would you like to configure a custom OpenAI Base URL? (Default: https://api.openai.com/v1) (y/N) 
[SUCCESS] OPENAI_API_KEY is configured
[SUCCESS] API key in configuration.yml appears to be configured
[SUCCESS] Database credentials in configuration.yml appear to be configured
[INFO] Pulling and starting MemMachine services...
[INFO] Pulling latest images...
[+] Pulling 34/34
 ✔ postgres Pulled                                                                                                                                                                                                  7.3s 
   ✔ 1adabd6b0d6b Pull complete                                                                                                                                                                                     1.7s 
   ✔ 799548af46de Pull complete                                                                                                                                                                                     1.7s 
   ✔ 7b697787d5d2 Pull complete                                                                                                                                                                                     1.8s 
   ✔ 861643ce2817 Pull complete                                                                                                                                                                                     1.8s 
   ✔ cdfd017c753d Pull complete                                                                                                                                                                                     2.0s 
   ✔ 974175074a8f Pull complete                                                                                                                                                                                     2.0s 
   ✔ 0dac5f77c330 Pull complete                                                                                                                                                                                     2.0s 
   ✔ 5e83761a8bfc Pull complete                                                                                                                                                                                     2.0s 
   ✔ db8bf9a4f43b Pull complete                                                                                                                                                                                     5.7s 
   ✔ 72ba653f834d Pull complete                                                                                                                                                                                     5.7s 
   ✔ 961aa0039c0e Pull complete                                                                                                                                                                                     5.8s 
   ✔ 856e25603442 Pull complete                                                                                                                                                                                     5.8s 
   ✔ d78bd8cc905b Pull complete                                                                                                                                                                                     5.8s 
   ✔ 5f7f7c5eac2d Pull complete                                                                                                                                                                                     5.8s 
   ✔ e8069270a9dc Pull complete                                                                                                                                                                                     5.8s 
   ✔ 4ee83278762e Pull complete                                                                                                                                                                                     6.4s 
 ✔ neo4j Pulled                                                                                                                                                                                                    13.3s 
   ✔ fa0650a893c2 Pull complete                                                                                                                                                                                     3.8s 
   ✔ c7d935cee01c Pull complete                                                                                                                                                                                    11.9s 
   ✔ 9c34f444a073 Pull complete                                                                                                                                                                                    11.9s 
   ✔ 25b3a5a8ff93 Pull complete                                                                                                                                                                                    11.9s 
   ✔ a0ade805ded6 Pull complete                                                                                                                                                                                    12.4s 
   ✔ 4f4fb700ef54 Pull complete                                                                                                                                                                                    12.4s 
 ✔ memmachine Pulled                                                                                                                                                                                               14.1s 
   ✔ 0e4bc2bd6656 Already exists                                                                                                                                                                                    0.0s 
   ✔ 490b9a1c25e4 Already exists                                                                                                                                                                                    0.0s 
   ✔ 0674d14a155c Already exists                                                                                                                                                                                    0.0s 
   ✔ b7ba6d2a1fc7 Already exists                                                                                                                                                                                    0.0s 
   ✔ 5b94093499cf Pull complete                                                                                                                                                                                     5.4s 
   ✔ acf23cb4265e Pull complete                                                                                                                                                                                     6.3s 
   ✔ b43281e94d7c Pull complete                                                                                                                                                                                     6.9s 
   ✔ f5c38b9d93db Pull complete                                                                                                                                                                                    13.1s 
   ✔ eebf29402586 Pull complete                                                                                                                                                                                    13.2s 
[INFO] Starting containers...
WARN[0000] Found orphan containers ([memmachine-alloy]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 4/4
 ✔ Network memmachine-network     Created                                                                                                                                                                           0.1s 
 ✔ Container memmachine-postgres  Healthy                                                                                                                                                                           6.3s 
 ✔ Container memmachine-neo4j     Healthy                                                                                                                                                                          21.8s 
 ✔ Container memmachine-app       Started                                                                                                                                                                          21.3s 
[SUCCESS] Services started successfully!
[INFO] Waiting for services to be healthy...
NAME                  IMAGE                    COMMAND                  SERVICE      CREATED          STATUS                                     PORTS
memmachine-app        memmachine/memmachine    "sh -c memmachine-se…"   memmachine   22 seconds ago   Up Less than a second (health: starting)   0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
memmachine-neo4j      neo4j:5.23-community     "tini -g -- /startup…"   neo4j        22 seconds ago   Up 21 seconds (healthy)                    0.0.0.0:7473-7474->7473-7474/tcp, [::]:7473-7474->7473-7474/tcp, 0.0.0.0:7687->7687/tcp, [::]:7687->7687/tcp
memmachine-postgres   pgvector/pgvector:pg16   "docker-entrypoint.s…"   postgres     22 seconds ago   Up 21 seconds (healthy)                    0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp
[INFO] Checking service health...
[INFO] Waiting for PostgreSQL to be ready...
/var/run/postgresql:5432 - accepting connections
[SUCCESS] PostgreSQL is ready
[INFO] Waiting for Neo4j to be ready...
[SUCCESS] Neo4j is ready
[INFO] Waiting for MemMachine to be ready...
[SUCCESS] MemMachine is ready
[SUCCESS] 🎉 MemMachine is now running!

Service URLs:
  📊 MemMachine API: http://localhost:8080
  🗄️  Neo4j Browser: http://localhost:7474
  📈 Health Check: http://localhost:8080/health
  📊 Metrics: http://localhost:8080/metrics

Database Access:
  🐘 PostgreSQL: localhost:5432 (user: memmachine, db: memmachine)
  🔗 Neo4j Bolt: localhost:7687 (user: neo4j)

Useful Commands:
  📋 View logs: docker-compose logs -f
  🛑 Stop services: docker-compose down
  🔄 Restart: docker-compose restart
  🧹 Clean up: docker-compose down -v

List of Docker Images

$ docker image ls
REPOSITORY              TAG              IMAGE ID       CREATED          SIZE
memmachine/memmachine   latest-gpu       e98a32560813   17 minutes ago   7.64GB
memmachine/memmachine   v0.2.0-rc1-gpu   e98a32560813   17 minutes ago   7.64GB
memmachine/memmachine   latest           d5e97eed5846   19 minutes ago   421MB
memmachine/memmachine   v0.2.0-rc1-cpu   d5e97eed5846   19 minutes ago   421MB
memmachine/memmachine   latest-cpu       a3e6521dfc6a   5 days ago       377MB
pgvector/pgvector       pg16             68f823d56bc9   2 weeks ago      507MB
neo4j                   5.23-community   d6c2c1adfcb5   15 months ago    506MB
moby/buildkit           v0.12.0          869c7038a926   2 years ago      172MB

Confirm the image ID

$ docker inspect -f '{{ .Image }}'  0b99d7d73e6a
sha256:d5e97eed58463463e09bec1ae0b1233fdb7b20239285e2f73f2c3fd92a58b405

@sscargal sscargal mentioned this pull request Dec 1, 2025
@sscargal sscargal requested a review from o-love December 1, 2025 21:21
Copy link
Contributor

@jgong jgong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Steve!

@sscargal sscargal merged commit cc8268e into MemMachine:main Dec 2, 2025
32 checks passed
@sscargal sscargal deleted the bugfix/637 branch December 2, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: v0.2.0 'memmachine-compose.sh build' and build-docker.sh fails

3 participants