Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jmugan opened this issue Aug 30, 2023 · 7 comments
Open

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

jmugan opened this issue Aug 30, 2023 · 7 comments

Comments

@jmugan
Copy link

jmugan commented Aug 30, 2023

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
Copy link
Author

jmugan commented Aug 30, 2023

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
Copy link
Member

stonier commented Aug 31, 2023

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:

  • Build the project natively without the devcontainer. You'll need poetry and pyqt installed on your system or in a venv.
  • If you just want to try the demo viewer, Just pip install py_trees_js and run it from that
  • Setup your own devcontainer, with something like the desktop-lite feature. That might be sufficient. If you get that working, send me a PR.

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

@stonier
Copy link
Member

stonier commented Aug 31, 2023

$ 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
Copy link
Author

jmugan commented Sep 1, 2023

Thanks! I'll keep working on it.

@craigham
Copy link

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

@jmugan
Copy link
Author

jmugan commented Feb 14, 2024

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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants