Reputation: 17676
Google colab is great for the notebook - however, I want to access the user interface of a running process such as mlflow or spark from my local machine.
For the example case of spark:
!pip install pyspark
import pyspark
from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local[2]").getOrCreate()
spark
The URI to the spark UI: http://5eb11567e012:4040/ cannot be resolved in my browser.
I guess some sort of port forwarding should do the trick? A) is there a better option and B) if not, how to set up the port forwarding?
Notice: I have read some tutorials which mount the google colab directory into google drive and that one locally - but this is NOT a desired solution (and in the case of spark would not work anyways).
Upvotes: 4
Views: 3926
Reputation: 29337
One option is to use output
:
from google.colab import output
output.serve_kernel_port_as_window(4040, path='/jobs/index.html')
Check also my answer to a similar question.
Upvotes: -1