Launch - CERIT-SC/funnel-gdi GitHub Wiki

By default, Funnel runs on default configuration, so this kind of launch would work:

docker run -it -p 8000:8000 funnel:latest server run

At this stage, the application is ready to accept requests:

  • http://localhost:8000/ -> the web-based dashboard
  • Task Execution Service API:
    • (use CURL command to avoid the dashboard)
    • curl http://localhost:8000/service-info -> JSON-formatted service info
    • curl http://localhost:8000/tasks -> list tasks
    • curl http://localhost:8000/tasks/{id} -> get specific task by its ID
    • curl -X POST http://localhost:8000/tasks -> create a new task
    • curl -X POST http://localhost:8000/tasks/{id}:cancel -> cancel a specific task by its ID

However, a in more typical setup, which involves integration with the Docker daemon (by default, it executes tasks using Docker), you would need more customisations for the launch:

docker run -it -p 8000:8000 \
  -v "/opt/funnel/work/:/opt/funnel/work/:rw" \
  -v "/var/run/docker.sock:/var/run/docker.sock" \
  -v "$PWD/my-config.yaml:/opt/funnel/config.yaml:ro" \
  funnel:latest \
  server run -c config.yaml

Equivalent script for Docker Compose:

services:
  funnel:
    container_name: funnel
    image: funnel:latest
    command: [server, run, -c, config.yaml]
    ports:
      - 127.0.0.1:8000:8000
    volumes:
      - /opt/funnel/work:/opt/funnel/work:rw
      - /var/run/docker.sock:/var/run/docker.sock
      - ./docker-config.yaml:/opt/funnel/config.yaml:ro

NOTE: As shown in the examples, the working directory volume path must be the same for both Funnel and Docker daemon. Otherwise, the mismatch will cause errors, as Docker cannot see the input/output files that Funnel downloads/uploads on behalf of the task.

The default working directory inside the container is /opt/funnel/, and the entry-point is /app/funnel.
The command executed inside the container for the previous docker command example is /app/funnel server run -f config.yaml.

Please refer to the configuration section for fine-tuning the setup.