jan-dolejsi / vscode-pddl

Planning Domain Description Language (PDDL) grammar, syntax highlighting, code snippets, parser and planner integration for Visual Studio Code.
MIT License
84 stars 22 forks source link

Problem Using Server with VS Code PDDL Extension #177

Open delislice opened 8 months ago

delislice commented 8 months ago

Hello. This is a wonderful project, but I am struggling to figure out how to integrate the planutils server with the VS Code PDDL extension. In the extension you are allowed to specify a configuration for a planner such as:

    "pddl.planners": [
        {
            "title": "LAMA",
            "kind": "lama",
            "url": "http://localhost:5555/solve",
            "canConfigure": true,
            "syntax": "$(planner) $(domain) $(problem) $(options) "
        }
    ],
    "pddl.selectedPlanner": "LAMA"

I understand that planner endpoints are configured in the manifest.json files that come with every planner such as lama, but I am always getting a 404 from the server when I try to generate a plan using my configuration. Could anyone provide an example of how to use the planutils server with either the VS Code PDDL extension or just a generic client? An example would help me a lot. Thank you!

delislice commented 8 months ago

cc @jan-dolejsi

haz commented 8 months ago

Did you start the planutils server separately on your own machine?

delislice commented 8 months ago

Yes, I started the planutils server on my machine with the following configuration:

Docker:

FROM aiplanning/planutils:latest

# Install solvers and tools
RUN planutils install -y val
RUN planutils install -y planning.domains
RUN planutils install -y popf
RUN planutils install -y optic
RUN planutils install -y smtplan
RUN planutils install -y tfd

RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y python3-dev python3-pip
RUN python3 -m pip install flask

# Start server
EXPOSE 5555
CMD planutils server --port 5555 --host 0.0.0.0

Bash

docker run \
  --name $CONTAINER_NAME \
  --rm --init --privileged -p 5555:5555 \
  -t $IMAGE_NAME 

I see responses in the Docker terminal like this:

[28/Dec/2023 21:13:31] "GET /solve HTTP/1.1" 404 -
haz commented 8 months ago

Ah, I see. That's using the old solver interface. It should be the planning as a service interface used with planutils

delislice commented 8 months ago

Oh! I didn't even realize this was outdated, haha. I will give planning as a service a shot. Thank you!