Skip to content

Commit

Permalink
Pre v0.0.4 - Slightly reframing Python Environment section (#22)
Browse files Browse the repository at this point in the history
* Slightly reframing Python Environment section

* Bump version number

* Update changelog
  • Loading branch information
Xing Han Lu authored Feb 9, 2021
1 parent 5dd3238 commit 859e6a6
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashVtk
Title: React based declarative usage of vtk.js for Dash
Version: 0.0.3
Version: 0.0.4
Description: React based declarative usage of vtk.js for Dash
Depends: R (>= 3.0.2)
Imports:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "DashVtk"
uuid = "1b08a953-4be3-4667-9a23-818b1eccd4c7"
authors = ["Kitware Inc <sebastien.jourdain@kitware.com> and Plotly Technologies <xinghan@plot.ly>"]
version = "0.0.3"
version = "0.0.4"

[deps]
Dash = "1b08a953-4be3-4667-9a23-3db579824955"
Expand Down
4 changes: 2 additions & 2 deletions R/internal.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.dashVtk_js_metadata <- function() {
deps_metadata <- list(`dash_vtk` = structure(list(name = "dash_vtk",
version = "0.0.3", src = list(href = NULL,
version = "0.0.4", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'dash_vtk.min.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk",
all_files = FALSE), class = "html_dependency"),
`dash_vtk` = structure(list(name = "dash_vtk",
version = "0.0.3", src = list(href = NULL,
version = "0.0.4", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'dash_vtk.min.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk",
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,27 @@ python app.py

Depending on your Python environment, you may run into deployment issue related to the vtk version that get pulled in.

Ideally we want a version of vtk equal or newer than 9. When using such version of VTK, dash-vtk won't even try to load the rendering module of VTK and if OpenGL is not available on your system everything will still be fine.
Ideally we want a version of vtk equal or newer than 9. When using such version of VTK, `dash-vtk` won't even try to load the rendering module of VTK and if OpenGL is not available on your system everything will still be fine.

On the other hand, if you are running Python 3.6 or less and you don't upgrade your pip version you will get vtk 8. With vtk 8, there is no way to prevent the loading of the GL library which means that you will have to install libGL on your system. The way [Heroku](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt) and [dash-enterprise](https://github.com/plotly/dash-sample-apps/blob/master/apps/dash-vtk-explorer/apt-packages) handle it is slightly different but technically you will have to install `libgl1-mesa-glx` via some `apt` infrastructure.
On the other hand, if you are running python-3.6 and/or pip-18 or less and you don't upgrade your pip version, you will only be able to use `vtk<=8.1.2`. With vtk 8, there is no way to prevent the loading of the GL library which means that you will have to install libGL on your system, or you will run into errors like this:

```
File ".../python/lib/python3.6/site-packages/vtkmodules/all.py", line 29, in <module>
from .vtkRenderingOpenGL2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
[2021-02-08 18:36:15 +0000] [10] [INFO] Worker exiting (pid: 10)
```

or this:
```
File ".../python3.7/site-packages/vtk/__init__.py", line 12, in <module>
from .vtkOpenGLKit import *
File ".../python3.7/site-packages/vtk/vtkOpenGLKit.py", line 9, in <module>
from vtkOpenGLKitPython import *
ModuleNotFoundError: No module named 'vtkOpenGLKitPython'
```

Heroku and Dash Enterprise handle it is slightly different because you will have to install `libgl1-mesa-glx` via some `apt` files. In the case of Heroku, you will have to use a [buildpack](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt) and add `libgl1-mesa-glx` to a `Aptfile` located in the root of your project. In the case of Dash Enterprise, you do not need to change the buildpack (it is handled automatically) but you will need to add `libgl1-mesa-glx` to a `apt-packages` file instead of `Aptfile`; see [this app](https://github.com/plotly/dash-sample-apps/blob/master/apps/dash-vtk-explorer/apt-packages) as an example.

## References

Expand Down
2 changes: 1 addition & 1 deletion dash_vtk/package-info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash_vtk",
"version": "0.0.3",
"version": "0.0.4",
"description": "React based declarative usage of vtk.js for Dash",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.4] - 2021-02-08

### Changed
* Added section about deployment in `README.md`
* `dash_vtk.utils`: Will try to import `vtkmodules` (`>=9.0.1`) before falling back to `vtk` (`<=8.1.2`) to avoid requiring `libGL`.

## [0.0.3] - 2021-02-04

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash_vtk",
"version": "0.0.3",
"version": "0.0.4",
"description": "React based declarative usage of vtk.js for Dash",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/DashVtk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module DashVtk
using Dash

const resources_path = realpath(joinpath( @__DIR__, "..", "deps"))
const version = "0.0.3"
const version = "0.0.4"

include("vtk_algorithm.jl")
include("vtk_calculator.jl")
Expand Down Expand Up @@ -34,14 +34,14 @@ function __init__()
[
DashBase.Resource(
relative_package_path = "dash_vtk.min.js",
external_url = "https://unpkg.com/dash_vtk@0.0.3/dash_vtk/dash_vtk.min.js",
external_url = "https://unpkg.com/dash_vtk@0.0.4/dash_vtk/dash_vtk.min.js",
dynamic = nothing,
async = nothing,
type = :js
),
DashBase.Resource(
relative_package_path = "dash_vtk.min.js.map",
external_url = "https://unpkg.com/dash_vtk@0.0.3/dash_vtk/dash_vtk.min.js.map",
external_url = "https://unpkg.com/dash_vtk@0.0.4/dash_vtk/dash_vtk.min.js.map",
dynamic = true,
async = nothing,
type = :js
Expand Down

0 comments on commit 859e6a6

Please sign in to comment.