serverlessworkflow / synapse

Serverless Workflow Management System (WFMS)
https://serverlessworkflow.io
Apache License 2.0
225 stars 35 forks source link

Docker Build and Compose Up not working #418

Open gmillinger opened 2 days ago

gmillinger commented 2 days ago

Follow the instructions found on https://github.com/serverlessworkflow/synapse

What happened: executed in the terminal: docker-compose build ERROR: The Compose file './docker-compose.yml' is invalid because: services.api.environment.SYNAPSE_DASHBOARD_SERVE contains true, which is an invalid type, it should be a string, number, or a null services.operator.environment.SYNAPSE_RUNNER_LIFECYCLE_EVENTS contains true, which is an invalid type, it should be a string, number, or a null

executed in the terminal: docker-compose up received the following error Creating network "synapse" with the default driver Creating volume "docker-compose_garnet_data" with local driver Pulling garnet (ghcr.io/microsoft/garnet:)... latest: Pulling from microsoft/garnet a2318d6c47ec: Pull complete 6e2e0959c9eb: Pull complete ca6981920ae5: Pull complete 4dc62e745685: Pull complete f63d9359ee11: Pull complete c12a56a98221: Pull complete 4e52e63f81ba: Pull complete 4f4fb700ef54: Pull complete 34d664a13f48: Pull complete Digest: sha256:2757c394b569a5f0d5ea5699b5f0657cb9a8331796245a59aae01350e835b3f8 Status: Downloaded newer image for ghcr.io/microsoft/garnet:latest Pulling api (ghcr.io/serverlessworkflow/synapse/api:)... ERROR: manifest unknown

Environment: Latest update of Ubuntu 22.04 docker-compose version 1.29.2, build unknown

bvandewe commented 2 days ago

Try setting SYNAPSE_DASHBOARD_SERVE: "true" and pull the images separately before starting the stack? Works for me :) ...

Here's a working docker-compose (on MacOS though):

name: synapse
services:
  garnet:
    image: ghcr.io/microsoft/garnet
    volumes:
      - garnet_data:/data

  # http://localhost:8080
  api:
    image: ghcr.io/serverlessworkflow/synapse/api:1.0.0-alpha1
    environment:
      CONNECTIONSTRINGS__REDIS: ${GARNET_URI}
      SYNAPSE_DASHBOARD_SERVE: "true"
      SYNAPSE_API_AUTH_TOKEN_FILE: /app/tokens.yaml
      SYNAPSE_API_JWT_AUTHORITY: http://api:8080
    volumes:
      - ./config/tokens.yaml:/app/tokens.yaml
    ports:
      - 8080:8080
    depends_on:
      - garnet

  operator:
    image: ghcr.io/serverlessworkflow/synapse/operator:1.0.0-alpha1
    environment:
      CONNECTIONSTRINGS__REDIS: ${GARNET_URI}
      SYNAPSE_OPERATOR_NAMESPACE: default
      SYNAPSE_OPERATOR_NAME: operator-1
      SYNAPSE_OPERATOR_RUNNER_API: http://api:8080
      DOCKER_HOST: unix:///var/run/docker.sock
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    user: root
    depends_on:
      - garnet

  correlator:
    image: ghcr.io/serverlessworkflow/synapse/correlator:1.0.0-alpha1
    environment:
      CONNECTIONSTRINGS__REDIS: ${GARNET_URI}
      SYNAPSE_CORRELATOR_NAMESPACE: default
      SYNAPSE_CORRELATOR_NAME: correlator-1
    ports:
      - 8081:8080
    depends_on:
      - garnet

  # shell:
  #   image: alpine:3.20.2
  #   tty: true
  #   stdin_open: true
  #   command: sh -c "apk update && apk add iputils nano curl jq && sh"

volumes:
  garnet_data:
    driver: local

networks:
  default:
    name: synapse

HTH!

gmillinger commented 2 days ago

Thank for your response and my apologies I am new to docker. Fixed the "true" The big different between your docker-compose.yml and what is found in the repo is the image: value

your file ghcr.io/serverlessworkflow/synapse/api:1.0.0-alpha1

repo file api: image: ghcr.io/serverlessworkflow/synapse/api

It is the version value. Same for the operator: and correlator:

cdavernas commented 2 days ago

@gmillinger Yes, you are right, sorry about that! The problem originates from the fact that alpha 1 and 2 were published as prerelease, which results in them not being tagged latest.

When using containers, when you do not specify the version of an image, the latest version is assumed and, because alpha versions were published as prerelease, there is no latest version. As you found out, versioning the image solves it. It is anyway a (strongly recommended) best practice.

You can find more info about container image versioning here.