This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Document how to use VTK/vtki in Docker containers & Travis #155
Comments
You’ll have to set up the headless display and some other dependencies. First check out my answer to this question:
Then head over to this repository and try to copy some of my set up scripts there. Before long, I’m going to try to set up all the examples on MyBinder, so stayed tuned for that! |
Perhaps this is something that would make sense to have a reusable setup script? I’m thinking this might be something to put in https://github.com/fatiando/continuous-integration or maybe we should make our own repo of setup scripts related to viz? What do you think @leouieda? |
For now, I have made a section in the docs under installation on how to set up |
Update: to make life even easier, I've created a cookie cutter to quickly make a MyBinder project: https://github.com/vtkiorg/cookiecutter-vtki-binder |
The sample binder looks awesome! |
Once the dependencies for #144 get released, we can have fully interactive rendering on web examples like this!! That way people can get to using |
It's going to be a game changer. Being able to have vtki run in a binder instance is already cool, but having it interactive means anyone will be able to interactively view vtki results. It's going to really bring it to the masses. |
Hopefully, this gets it started: Now all examples from the gallery are available on MyBinder 🎉 🎉 |
Thank you so much! You've been so helpful. I was having trouble propagating environment var def activate_virtual_framebuffer():
'''
Activates a virtual (headless) framebuffer for rendering 3D
scenes via VTK.
Most critically, this function is useful when this code is being run
in a Dockerized notebook, or over a server without X forwarding.
* Requires the following packages:
* `sudo apt-get install libgl1-mesa-dev xvfb`
'''
import subprocess
import vtki
vtki.OFFSCREEN = True
os.environ['DISPLAY']=':99.0'
commands = ['Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &',
'sleep 3',
'exec "$@"']
for command in commands:
subprocess.call(command,shell=True) And then, on module import, I check if I'm in the Docker container (in a rather inelegant way...) and run the function from there: if os.path.isdir('/home/jovyan'):
activate_virtual_framebuffer() Thank you again! |
@banesullivan that's a good point. I'm not sure. Is this issue exclusive to VTK? Are there fixes for Windows and Mac (not using containers)? |
@banesullivan does this mean that the same code won't work to generate the docs and run in the user's computer? If so, I would recommend allowing this to be set through an environment variable as well so that no changes to the code are required. |
Actually no, the setup for this is well documented in the Travis docs and it’s for anything graphics related where a headless display is needed.
Windows has caused me many headaches in this regard... not sure. If running on a local machine with a display none of this is an issue
We definitely overlooked this - yes. Currently, we set I think adding an environmental variable in the start script and having |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Trying to run any VTKI rendering within a Dockerized Jupyter notebook causes a kernel crash, with the message:
I believe this is a more fundamental issue than VTKI (I have a VTK issue open here), but I am hoping that someone else using VTKI has experienced this and has a workaround, or that there is a way to run VTKI in 'headless' (virtual framebuffer) mode.
The text was updated successfully, but these errors were encountered: