Notebook Servers: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Created page with "Basically Jupyter already runs as a server on your local machine, but now there are a bunch of other ways to run "notebooks". I am looking at alternatives to the ArcGIS Note..."
 
Brian Wilson (talk | contribs)
mNo edit summary
Line 14: Line 14:
I need to be able to schedule jobs to run.
I need to be able to schedule jobs to run.


I just decided to look at Zeppelin first.
I just decided to look at Deepnote first. It's running already on someone else's server.
 
== Zeppelin ==
 
https://zeppelin.apache.org/
 
docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.10.0
 
Okay now what -- that worked. I can type Python in a browser window and run it.
 


== Deepnote ==
== Deepnote ==
Line 52: Line 43:
from arcgis import gis as GIS
from arcgis import gis as GIS
gis = GIS(portal="", username="", password="")
gis = GIS(portal="", username="", password="")
cm = gis.content
maps = cm.search("", item_type='Web Map', outside_org=False,max_items=-1)
thismap = 0
for map in maps:
    thismap += 1
    print(f"{thismap}: {map.title}")
</pre>
</pre>
Okay, so that took all of 10 minutes.
Point goes to Deepnote.
=== What about scheduling? ===
Yes, another point for Deepnote.
See [https://docs.deepnote.com/features/scheduling How to schedule a notebook]
=== Running locally ===
In theory I can [https://stackoverflow.com/questions/65151990/installing-conda-on-deepnote run in a Docker],
but I have to set up access to the Google docker repos.
Put this in a Dockerfile
<pre>
FROM gcr.io/deepnote-200602/templates/deepnote
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
RUN bash ~/miniconda.sh -b -p $HOME/miniconda
ENV PATH $HOME/miniconda/bin:$PATH
RUN conda install python=3.7 ipykernel -y
RUN conda install <insert packages here> -y
RUN python -m ipykernel install --user --name=conda
ENV DEFAULT_KERNEL_NAME "conda"
</pre>
docker build -t deepnote .
It fails because I don't have access to the Google data.
== Zeppelin ==
https://zeppelin.apache.org/
docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.10.0
Okay now what -- that worked. I can type Python in a browser window and run it.

Revision as of 22:01, 28 July 2022

Basically Jupyter already runs as a server on your local machine, but now there are a bunch of other ways to run "notebooks".

I am looking at alternatives to the ArcGIS Notebook Server because it's $20000 + $5000/year for what appears to be basically a Docker manager. Esri uses the commercial version of Docker, that means they have to license it from Mirantis.

I've never had a need to license Docker, I just use the community version.

I started making a list of options but then I found https://datasciencenotebook.org/ which was created by someone at the Deepnote project.

I need a notebook server that supports Conda so that I can try installing arcgis.

I need to be able to schedule jobs to run.

I just decided to look at Deepnote first. It's running already on someone else's server.

Deepnote

They don't charge for it, so does it do what I need? I used my brian32768@github account to access it.

Install conda:

# 1. Install Conda and make Conda packages available in current environment

!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!sudo bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local

import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')

Install a package:

!sudo conda install -y arcgis -c esri

Use it:

from arcgis import gis as GIS
gis = GIS(portal="", username="", password="")
cm = gis.content
maps = cm.search("", item_type='Web Map', outside_org=False,max_items=-1)
thismap = 0
for map in maps:
    thismap += 1
    print(f"{thismap}: {map.title}")

Okay, so that took all of 10 minutes.

Point goes to Deepnote.

What about scheduling?

Yes, another point for Deepnote. See How to schedule a notebook

Running locally

In theory I can run in a Docker, but I have to set up access to the Google docker repos.

Put this in a Dockerfile

FROM gcr.io/deepnote-200602/templates/deepnote
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
RUN bash ~/miniconda.sh -b -p $HOME/miniconda
ENV PATH $HOME/miniconda/bin:$PATH
RUN conda install python=3.7 ipykernel -y
RUN conda install <insert packages here> -y
RUN python -m ipykernel install --user --name=conda
ENV DEFAULT_KERNEL_NAME "conda"

docker build -t deepnote .

It fails because I don't have access to the Google data.

Zeppelin

https://zeppelin.apache.org/

docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.10.0

Okay now what -- that worked. I can type Python in a browser window and run it.