vscode-pddl icon indicating copy to clipboard operation
vscode-pddl copied to clipboard

Problem Using Server with VS Code PDDL Extension

Open delislice opened this issue 1 year ago • 5 comments

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 avatar Dec 28 '23 20:12 delislice

cc @jan-dolejsi

delislice avatar Dec 28 '23 20:12 delislice

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

haz avatar Dec 28 '23 20:12 haz

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 -

delislice avatar Dec 28 '23 22:12 delislice

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

haz avatar Dec 28 '23 22:12 haz

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

delislice avatar Dec 28 '23 22:12 delislice