Oracle Developers
Published in

Oracle Developers

Running your JuPyTeR notebooks on the cloud

Introduction

Signing up

Setup

Actions to get on the cloud

$ oci --helpUsage: oci [OPTIONS] COMMAND [ARGS]...Oracle Cloud Infrastructure command line interface, with support for
Audit, Block Volume, Compute, Database, IAM, Load Balancing, Networking, DNS, File Storage, Email Delivery and Object Storage Services.
Most commands must specify a service, followed by a resource type and then an action. For example, to list users (where $T contains the OCID of the current tenant):oci iam user list --compartment-id $TOutput is in JSON format.For information on configuration, see
https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm.
Options:
<-- snipped -->
Commands:
<-- snipped -->
### Oracle Linux and CentOS images, user name: opc
### the Ubuntu image, user name: ubuntu
$ ssh -i ~/.ssh/id_rsa ubuntu@132.145.78.136or$ ssh ubuntu@132.145.78.136

Running Jupyter Notebooks

$ git clone https://github.com/neomatrix369/awesome-ai-ml-dl
$ cd awesome-ai-ml-dl/examples/JuPyteR
$ cd build-docker-image
$ ./installDocker.sh
$ cd build-docker-image
$ sudo ./buildDockerImage.sh
$ cd [back into the project root folder]
$ sudo ./runDockerContainer.sh
<--- snipped --->OpenJDK Runtime Environment (build 9.0.4+11)
OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)
PATH=/home/jupyter/.local/bin:/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
~~~ JDK9, Linux only: We are enabling JVMCI flags (enabling Graal as Tier-2 compiler) ~~~
~~~ Graal setting: please check docs for higher versions of Java and for other platforms ~~~
JAVA_OPTS=-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
Available kernels:
python2 /home/jupyter/.local/share/jupyter/kernels/python2
java /usr/share/jupyter/kernels/java
[I 13:39:35.993 NotebookApp] Writing notebook server cookie secret to /home/jupyter/.local/share/jupyter/runtime/notebook_cookie_secret
[I 13:39:36.293 NotebookApp] Serving notebooks from local directory: /home/jupyter
[I 13:39:36.294 NotebookApp] The Jupyter Notebook is running at:
[I 13:39:36.295 NotebookApp] http://(81dde8675279 or 127.0.0.1):8888/?token=bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48
[I 13:39:36.297 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:39:36.310 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/jupyter/.local/share/jupyter/runtime/nbserver-28-open.html
Or copy and paste one of these URLs:
http://(81dde8675279 or 127.0.0.1):8888/?token=bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48
http://132.145.78.136:8888/?token=bb0c81ef7e9f3932355b953163702aa2d9f75e18005e6e48

Installing Jupyter on a bare-metal or VM environment

$ cd build-docker-image
$ [install Java 9 SDK and set the PATH and JAVA_HOME]
$ ./install-jupyter-notebooks.sh
$ ./install-java-kernel.sh
$ ./runLocal.sh

Create custom image for reuse

Power-user

Signing off

Conclusion

Resources

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mani Sarkar

Java/JVM dev, Software Crafter, @GraalVM, VMs, Dev. communities, DevOps, containers, JS, speaker, blogs @theNeomatrix369 https://www.linkedin.com/in/mani-sarkar