Notes: Running Julia/Pluto on Raspberry Pi Kubernetes cluster

Photo by Markus Winkler on Unsplash

Recently I have been interested in setting up Raspberry Pi based Kubernetes cluster for a variety of use cases from IoT sensor data monitoring to setting up data analytics / ML components such as TensorFlow and Julia. I have talked about some of these use cases in my previous posts and I have linked one of them below. This post is a high level summary of steps I took to setup Julia based Pluto notebooks that are commonly used for exploratory data analytics, linear algebra computations and visualizing plots.

The setup is currently ephemeral and does not retain previous data in case of node reboot or pod crash. Essentially, the steps involve setting up julia container, installing required packages and running pluto commands to invoke the notebook. Finally, we can expose the endpoint as a service and access it using port-forward. These are all very basic and simple steps, nevertheless, I like to document these for my own reference. Assuming that the Kubernetes cluster is setup correctly, the manifest to deploy julia and pluto is as follows:

Once deployed, it will trigger julia commands as shown in the deployment spec above, which can take several minutes on a Raspberry Pi. Make sure that everything went fine by checking the pod logs as follows:

└─ $ ▶ kubectl --namespace=julia-system logs -f deployments.apps/julia<redacted many lines...>Go to http://0.0.0.0:1234/ in your browser to start writing ~ have fun!Press Ctrl+C in this terminal to stop Pluto

The service can now be accessed on `127.0.0.1:8080` using port-forwarding:

└─ $ ▶ kubectl --namespace=julia-system port-forward svc/julia 8080:80 
Forwarding from 127.0.0.1:8080 -> 1234
Forwarding from [::1]:8080 -> 1234
Sample screenshot of Julia/Pluto notebook
another screenshot showing matrix calculations

That’s all for this post… I’ll leave the discussion on securing this endpoint, serving behind an ingress controller and adding storage/persistence to it for future.

--

--

--

Software engineer and entrepreneur currently building Kubernetes infrastructure and cloud native stack for edge/IoT and ML workflows.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Bitbucket + Bitrise: Configuring Continuous Integration for an iOS app

CS373 Fall 2021 Entry 7: Justin Lee

Using Agile Methodology for ERP System Implementation

Sapir-Whorf and You

Building a resilient Anomaly Detection pipeline with Apache Airflow

How to Write a Perfect Essay on Computer Programming

2D Shooter: Stopping a Swarm when the Player Dies

Introducing Command Line Interface for Databricks Developers

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
Saurabh Deoras

Saurabh Deoras

Software engineer and entrepreneur currently building Kubernetes infrastructure and cloud native stack for edge/IoT and ML workflows.

More from Medium

Au!tomating — Clustering your home

The fat docker container

Improving Application Availability with Pod Readiness Gates

How To Host Your Own Docker Registry