AI-Planning / cloud-solver

Repository that lets you run an automated planner as a service on heroku.
26 stars 7 forks source link

Add full support for Python3.x. #3

Closed Vol0kin closed 4 years ago

Vol0kin commented 4 years ago

I am trying to create a Docker container where the solver could be run. This container uses the latest version of both Python and NodeJS, which are Python 3.8 and NodeJS 12 iirc.

As you already know, the preprocess_solution.py script has to be run after the planner has completed its execution. However, the script is executed using the python binary, which is a symbolic link to the Python interpreter. This symbolic link may point to python2 or python3, depending on whether Python2.x is installed or not in the OS by default. This means that new OS which don't have python2 installed would have an issue when trying to run the script, and consequently, there would be a problem while trying to run the solver. This happens because of the following reasons:

  1. The way that Python2 and Python3 handle exceptions is different.
  2. The map function returns map object instead of a list in Python3.
  3. Relative imports work differently in both versions.

These issues can be solved while keeping the compatibility between both versions of the language. As a matter of fact, I have already made some modifications to the fork that I have of this repo. I can create a PR so you can review the changes, and then you could decide if you want to integrate them to the project.

haz commented 4 years ago

So there are a few things to note here...

Thanks!

Vol0kin commented 4 years ago

On another note, I've already made a container which runs the solver. I can also add it so you can use it as a baseline for the next iteration. If that is the case, I could open another issue where we could discuss this topic so that we don't end up mixing topics in this one :laughing:.

haz commented 4 years ago

Great! Well if you wanted to contribute (which would be awesome), what I would advocate is that you check out the existing Docker setup that we'll build off of...

...and the issue created for the solver environment...

...and the discussion that captures how it's going to look...

There's also a WIP PR for it, but that's mainly empty for now while I pick away at the new manifest for plackages.

haz commented 4 years ago

Closing for now (thanks for the PR!), but feel free to join the conversation on the Docker extension either in the issue listed above or the slack org.

Vol0kin commented 4 years ago

No problem! As far as I have understood, the goal is to create an environment in which multiple planners can be run and run the cloud-solver on top of that environment, right? That way, as stated in issue #1, the solver will be able to use multiple planners.

haz commented 4 years ago

The goal is multi-faceted. But what you include is certainly in there, yep. And the cloud-solver project will wrap many planners / planner services (like generating domains/problems). There will be a new meta-data defined for the solvers, which is reflected in the cloud-solver API automatically, and it will be hosted somewhere with a bit beefier resources (so more than one simultaneous solve can take place).