splintered-reality / py_trees_js

Javascript library for behaviour tree visualisation, demo'd with a qt-js hybrid application
Other
14 stars 4 forks source link

Unable to open devcontainer in WSL2 (probably me) #147

Open jmugan opened 1 year ago

jmugan commented 1 year ago

Hi, when I try to open the devcontainer it just says

Command failed: /home/jmugan/.vscode-server/bin/6c3e3dba23e8fadc360aed75ce363ba185c49794/node /home/jmugan/.vscode-remote-containers/dist/dev-containers-cli-0.304.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-e40d94c9-6993-4d24-a69b-63373eef68c91693356895066 --workspace-folder /home/jmugan/py_trees_js --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu\home\jmugan\py_trees_js --id-label devcontainer.config_file=/home/jmugan/py_trees_js/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/jmugan/py_trees_js/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=/mnt/wslg/runtime-dir/wayland-0,target=/tmp/vscode-wayland-65849148-7d20-472c-8896-2e63c7ec3a0b.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true

Any ideas what I might be doing wrong?

jmugan commented 1 year ago

I couldn't get it running on my mac either. I guess I need more handholding than

$ git clone https://github.com/splintered-reality/py_trees_js
$ code .
# Reopen the project in the devcontainer
$ poetry install
$ poetry shell
$ py-trees-demo-viewer

Maybe the "Reopen the project in the devcontainer" is where I'm doing something wrong. Maybe I'm doing that from the wrong spot. On WSL2, a dialog popped up and I clicked it, which led to the error. On mac, there was no dialog but I could go to the command pallet. But then it asked me which environment to use, so I was probably in the wrong place. I chose Anaconda, and when I got in the container and tried to do poetry install it said that poetry itself wasn't installed. So I probably was in the wrong container and/or in the wrong place and a configuration file was not read.

If someone happens to have a link to run this for dummies I would appreciate it.

stonier commented 1 year ago

If you miss the Reopen in Container dialog on opening the project in vscode, just hit CTRL-SHIFT-P and search for Reopen in Container.

Incidentally, make sure you open vscode in the root of the project otherwise it'll be trying to construct a container for you. If it's asking you about Anaconda, this may have been what happened.

Also, you need to go back farther in the devcontainer log to find the root cause of the error.

Having said all that, the py_trees_js devcontainer requires an nvidia gpu on your PC and the nvidia docker container toolkit installed otherwise the devcontainer will fail at the --runtime=nvidia section in .devcontainer/devcontainer.json. I need to expound on this in the README. If you don't have nvidia, some options:

Additionally, I've never tested this devcontainer workflow on windows (WSL2). It may be another problem getting in the way.

stonier commented 1 year ago
$ git clone https://github.com/splintered-reality/py_trees_js
$ code .

You're definitely not in the root of the repo with those two commands. That means it's not finding the py_trees_js/.devcontainer folder and so it's trying to create a devcontainer for you. You need:

$ git clone https://github.com/splintered-reality/py_trees_js
$ cd py_trees_js
$ code .

My bad, fixing the README for you now.

jmugan commented 1 year ago

Thanks! I'll keep working on it.

craigham commented 8 months ago

@jmugan Were you able to get this to run on your Mac? I cant seem to get it to work.

jmugan commented 8 months ago

No, I wasn't able to get it to work. I'm not familiar with this devcontainer stuff, so I was probably just missing something obvious.

craigham commented 8 months ago

@stonier I am using py-trees for my starcraft 2 ai bot. I was thinking I would like a separate window which could display the state of the tree as i am debugging my bot in a match.

To do this, was thinking I could load up the generic viewer (I did get a viewer to pop up on a Ubuntu VM). Then from my python bot code, stream the tree info to the viewer so I could look at the tree and maybe the blackboard.

Do you think this is doable? It wouldnt matter to me if I used the qt5, but a web app would probably be a little easier long term.