Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

4.2 KB
Raw Blame
# docker-compose.standalone.yml — Remote install (no repo checkout needed)
#
# Used by: curl -fsSL .../install.sh | bash
# Location when installed: ~/.ix/backend/docker-compose.yml
#
# Uses published Docker images — no local build step required.

services:
  arangodb:
    # PINNED to an exact patch, deliberately. The rolling `3.12` tag let a
    # `docker pull` move the engine under a live data volume, and ArangoDB's
    # vector index leaves a one-way footprint: once `VectorIndex` is in the
    # RocksDB MANIFEST, any arangod that does not register that column family
    # refuses to open the database at all --
    #   FATAL [fe3df] unable to initialize RocksDB engine:
    #                 Invalid argument: Column families not opened: VectorIndex
    # -- which with `restart: unless-stopped` is a fatal loop, not a degraded
    # start, and takes memory-layer down with it via `service_healthy`. Ix#614.
    image: arangodb:3.12.12
    networks:
      - backend
    # No host port. ArangoDB runs without authentication, so a published port
    # let any local process read or wipe the graph without going through the
    # memory layer. Only memory-layer reaches it, over the compose network.
    # For the web UI, publish it yourself in docker-compose.override.yml next
    # to this file (`ix docker` applies that file); see docs/prerequisites.md.
    environment:
      ARANGO_NO_AUTH: "1"
    # `--vector-index` is the current name; it was `--experimental-vector-index`
    # before 3.12.11, which still accepts the old spelling but only as a renamed
    # alias and warns. Pinning the image above is what makes it safe to state
    # one spelling here.
    #
    # Cache caps. Left alone, arangod sizes its caches from the host's RAM (on
    # a 30 GB machine: a ~9 GB block cache, not enforced by default, a ~7.6 GB
    # edge/document cache and ~12 GB of write buffers), fills them, and keeps
    # the memory after workspaces are dropped. The defaults below served repos
    # up to ~30k files with no slowdown in `ix map`. They cap caches only, not
    # the process: there is deliberately no container memory limit or query
    # memory limit, which could kill the backend on a large repo.
    #   --rocksdb.block-cache-size                512 MB  RocksDB block cache
    #   --rocksdb.enforce-block-cache-size-limit  true    hold it to that size
    #   --rocksdb.total-write-buffer-size         256 MB  all memtables together
    #   --cache.size                              128 MB  edge/document cache
    # To raise one, set its IX_ARANGO_* variable (bytes) in the .env next to
    # this file, e.g. IX_ARANGO_BLOCK_CACHE_SIZE=2147483648, then run
    # `ix docker stop` and `ix docker start` to recreate the container. The
    # data volume is kept. See docs/prerequisites.md.
    command:
      - arangod
      - --server.endpoint
      - tcp://0.0.0.0:8529
      - --vector-index
      - "true"
      - --rocksdb.block-cache-size=${IX_ARANGO_BLOCK_CACHE_SIZE:-536870912}
      - --rocksdb.enforce-block-cache-size-limit=${IX_ARANGO_ENFORCE_BLOCK_CACHE_LIMIT:-true}
      - --rocksdb.total-write-buffer-size=${IX_ARANGO_WRITE_BUFFER_SIZE:-268435456}
      - --cache.size=${IX_ARANGO_CACHE_SIZE:-134217728}
    volumes:
      - arangodb-data:/var/lib/arangodb3
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8529/_api/version || exit 1"]
      interval: 5s
      timeout: 5s
      start_period: 60s
      retries: 15
    restart: unless-stopped

  memory-layer:
    image: ghcr.io/ix-infrastructure/ix-memory-layer:latest
    networks:
      - backend
    ports:
      - "127.0.0.1:8090:8090"
    environment:
      ARANGO_HOST: arangodb
      ARANGO_PORT: "8529"
      ARANGO_DATABASE: ix_memory
      ARANGO_USER: root
      ARANGO_PASSWORD: ""
      PORT: "8090"
      # Empty: the backend requires no token. `ix docker start --local-token`
      # writes one into .env next to this file and the CLI sends it.
      IX_LOCAL_TOKEN: ${IX_LOCAL_TOKEN:-}
    depends_on:
      arangodb:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:8090/v1/health"]
      interval: 10s
      timeout: 3s
      start_period: 15s
      retries: 5
    restart: unless-stopped

volumes:
  arangodb-data:

networks:
  backend: