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

iframe is now loaded when using google colab #9

Merged
merged 3 commits into from
Dec 16, 2022

Conversation

jnumainville
Copy link
Collaborator

@jnumainville jnumainville commented Dec 16, 2022

Part of fix for #3

  • Added logic to check if the script is being ran in google colab, then replace the server url with proxied url for the specified port if that is the case
  • Tested in google colab, created a widget and verified that the iframe appeared
!apt-get install openjdk-11-jdk-headless

import os
from google.colab.output import eval_js
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64"

from google.colab import drive
drive.mount('/content/drive')

!pip install --upgrade pip setuptools wheel
!pip install deephaven-core deephaven-server
!pip install '/content/drive/MyDrive/deephaven_ipywidgets-0.2.0-py2.py3-none-any.whl'

import deephaven_server
from deephaven_server import Server
import portpicker
from google.colab.output import eval_js

dh_port = portpicker.pick_unused_port()
s = Server(port=dh_port, jvm_args=["-Xmx4g", "-Dhttp.requireHttp2=false"], dh_args={'http.requireHttp2': False})
s.start()

from google.colab import output
output.enable_custom_widget_manager()

from deephaven import empty_table
t = empty_table(10).update("x=i")

from deephaven_ipywidgets import DeephavenWidget
DeephavenWidget(t)

@jnumainville jnumainville added the bug Something isn't working label Dec 16, 2022
@jnumainville jnumainville self-assigned this Dec 16, 2022
@jnumainville jnumainville merged commit ee39e19 into deephaven:main Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants