AI-Planning / planutils

General library for setting up linux-based environments for developing, running, and evaluating planners.
MIT License
106 stars 30 forks source link

Bug: dual-bfws-ffparser fail in server #82

Open hectorpal opened 2 years ago

hectorpal commented 2 years ago

How to reproduce:

  1. Build docker: environments/server/setup.sh
  2. Start in privileged mode: docker run -p 5555:5555 --privileged -d planutils-server
  3. Try server. For instance, following https://github.com/AI-Planning/planning-as-a-service#example-use
import requests
import time
from pprint import pprint

req_body = {
"domain":"(define (domain BLOCKS) (:requirements :strips) (:predicates (on ?x ?y) (ontable ?x) (clear ?x) (handempty) (holding ?x) ) (:action pick-up :parameters (?x) :precondition (and (clear ?x) (ontable ?x) (handempty)) :effect (and (not (ontable ?x)) (not (clear ?x)) (not (handempty)) (holding ?x))) (:action put-down :parameters (?x) :precondition (holding ?x) :effect (and (not (holding ?x)) (clear ?x) (handempty) (ontable ?x))) (:action stack :parameters (?x ?y) :precondition (and (holding ?x) (clear ?y)) :effect (and (not (holding ?x)) (not (clear ?y)) (clear ?x) (handempty) (on ?x ?y))) (:action unstack :parameters (?x ?y) :precondition (and (on ?x ?y) (clear ?x) (handempty)) :effect (and (holding ?x) (clear ?y) (not (clear ?x)) (not (handempty)) (not (on ?x ?y)))))",
"problem":"(define (problem BLOCKS-4-0) (:domain BLOCKS) (:objects D B A C ) (:INIT (CLEAR C) (CLEAR A) (CLEAR B) (CLEAR D) (ONTABLE C) (ONTABLE A) (ONTABLE B) (ONTABLE D) (HANDEMPTY)) (:goal (AND (ON D C) (ON C B) (ON B A))) )"
}

solve_request=requests.post(f"http://localhost:5555/package/{planner}/solve", json=req_body).json()
print(solve_request)

Returns

{'stderr': '/root/.planutils/packages/dual-bfws-ffparser/run: line 2: lapkt: command not found\n', 'stdout': ''}
haz commented 2 years ago

Hrmz...can you add lapkt to the docker for the server, and let me know if it works?

hectorpal commented 2 years ago

It also failed using this Dockerfile:


# Build the Planutils image and install the selected packages
FROM aiplanning/planutils:latest

# Needed for the server
RUN pip3 install flask

# FD Planner
RUN planutils install -f -y lama-first

RUN planutils install -f -y lapkt

# Satisficing classical planning
RUN planutils install -f -y dual-bfws-ffparser

EXPOSE 5555

CMD planutils server --port 5555 --host 0.0.0.0
hectorpal commented 2 years ago

This might be the issue:

docker run --rm --privileged -ti -v $PWD:/mnt/home aiplanning/planutils
root@56b9d5d7b58d:~# planutils install -f -y dual-bfws-ffparser
dual-bfws-ffparser will be installed.

About to install the following packages: lapkt (184M), dual-bfws-ffparser (0M)
Installing lapkt...
 181.71 MiB / 181.71 MiB [====================================================================================================================================================] 100.00% 6.86 MiB/s 26s
Finished installing lapkt (size: 182M)
Installing dual-bfws-ffparser...
Finished installing dual-bfws-ffparser (size: 24K)
root@56b9d5d7b58d:~# planutils run dual-bfws-ffparser  
/root/.planutils/packages/dual-bfws-ffparser/run: line 2: lapkt: command not found
root@56b9d5d7b58d:~# planutils activate

   Entering planutils environment...

(planutils) root@56b9d5d7b58d:~$ planutils run dual-bfws-ffparser
Error: the required argument for option '--output' is missing

The last one is correct. Sounds like a path issue in case of dependencies.

haz commented 2 years ago

Aha! Right you are. @nirlipo -- want to prefix the laptkt extensions with planutils run to make things work again? Using just lapkt will only work if planutils is activated.