python-3.xartificial-intelligencehaystack

Install local version of Haystack's Annotation Tool


Although the instructions in Haystack describe how to install the annotation tool locally using Docker, all attempts have failed. Unfortunately, the website does not contain any more details.

Has anyone been able to get this to work? If so, what am I missing?

Reproduction scenario:

Contents of yml file (see here):

version: "3"
services:
  backend:
    image: deepset/haystack-annotation:latest
    environment:
      NODE_ENV: "production"
      DB_HOSTNAME: "db"
      DB_NAME: "databasename"
      DB_USERNAME: "somesafeuser"
      DB_PASSWORD: "somesafepassword"
      # IMPORTANT: please configure credentials with secure strings.
      DEFAULT_ADMIN_EMAIL: "example@example.com"
      DEFAULT_ADMIN_PASSWORD: "DEMO_PASSWORD"
      COOKIE_KEYS: "somesafecookiekeys"
      JWT_SECRET: "somesafesecret"
      DOMAIN_WHITELIST: "*"
    ports:
      - "7001:7001"
    links:
      - "db:database"
    depends_on:
      - db
    networks:
      - app-network
    restart: unless-stopped

  db:
    image: "postgres:12"
    environment:
      POSTGRES_USER: "somesafeuser"
      POSTGRES_PASSWORD: "somesafepassword"
      POSTGRES_DB: "databasename"
    ports:
      - "5432:5432"
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    networks:
      - app-network
    healthcheck:
      test: "pg_isready --username=somesafeuser --dbname=databasename && psql --username=somesafeuser --list"
      timeout: 3s
      retries: 5
    restart: unless-stopped

networks:
  app-network:
    driver: bridge

Results (screenshots):

Unable to open the page: Unable to open the page Docker is running: Docker is running


Solution

  • All credits to @Stefano Fiorucci - anakin87 for the solution to this problem.

    The complete steps are:

    1. git clone https://github.com/deepset-ai/haystack.git
    2. cd ./haystack
    3. python -m pip install -e '.[all]' or '.[all-gpu]' # Use the latest version to develop the project and checkout to the latest 1x release to use the annotation tool.
    4. git checkout v1.26.x # Do NOT execute python -m pip install again.
    5. cd ./annotation_tool/
    6. edit docker-compose.yml # Configure the credentials and the database in ./haystack/annotation_tool/docker-compose.yml (see OP link for the original version of the file). In this case I left everything as is, but uncommented lines 12 - 16.
    7. Add a new user group to the annotation/ directory, in windows, so that Docker can have the privileges to create directories and files. Follow these steps here.
    8. docker-compose pull # execute this command inside the annotation_tool/ directory.
    9. docker-compose up
    10. Chrome browser: http://localhost:7001

    Results: enter image description here