Git Product home page Git Product logo

clouda's Introduction

☁️ Cloud

⚠️ Deprecated

This project is deprecated. Please see ✨ stencila/sparkla which provides compute sessions that are faster to start, more secure, and have finer grained control, and real-time user notifications, for resource usage.

💭 Purpose

In Stencila, execution Contexts are provided by a Host (if you are familiar with Jupyter, then Stencila Contexts are like Jupyter kernels and a Host is like a kernel gateway). In addition to providing Contexts, Hosts can also provide execution Environments (which have one or more Contexts with in them e.g. PythonContext, RContext) plus language specific packages (e.g. pandas, ggplot2). There is a Host HTTP API (currently in draft) available here.

This package, stencila/cloud, implements the Stencila Host API for running alternative execution Environments as Docker containers within a Kubernetes cluster. It is intended as a way of providing users of Stencila with an easy way to render Stencila documents withing alternative execution environments, without having to install packages themselves, or install and run Docker.

An example of a document using a RContext, hosted within the stencila/core execution environment, provided by stencila/cloud.

📦 Install and deploy

See the Dockerfile for building a container and deploy.yaml and minikube.yaml for example Kubernetes deployments.

🛠️ Develop

Quickstart:

git clone https://github.com/stencila/cloud.git
cd cloud
npm install

Most development tasks can be run directly from npm or via make recipes.

Task npm make
Install dependencies npm install make setup
Check for lint npm run lint make lint
Run with Minikube NODE_ENV='development' npm start make run-with-minikube
Run inside Minikube make run-inside-minikube

🏃 Run with Minikube

You can run the sever locally but get it to create new session pods within an Minikube cluster.

Install minikube and kubectl. Then start the Minikube cluster,

minikube start
make run-with-minikube

The server will be available on http://localhost:2000 but will create new pods on Minikube. e.g. Create a new session using HTTPie

http PUT :2000/execute environment:='{"id":"alpine"}'

Use minikube dashboard or kubectl get pods to confirm that the session pods are getting created.

🏃 Run inside Minikube

You can run the server inside Minikube and create new session pods there too.

Deploy stencila/cloud to the Minikube cluster,

minikube start
make run-inside-minikube

Check the Deployment is ready (the dashboard can be useful for this too: minikube dashboard),

kubectl get deployments

NAME                        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
stencila-cloud-deployment   1         1         1            0           1d

You can then get the URL of the host:

minikube service stencila-cloud-server --url

And check that it responds:

curl $(minikube service stencila-cloud-server --url)

If you're developing the Docker images in the stencila/images repo you can save time (and bandwidth) by not pushing/pulling images to/from the Docker Hub registry and the Minikube cluster. To do that, configure your local Docker client to use the Docker engine running inside the Minikube cluster:

eval $(minikube docker-env)

clouda's People

Contributors

ahmetcetin avatar beneboy avatar finlay avatar hamishmack avatar nokome avatar yoshuawuyts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hamishmack

clouda's Issues

"Orphaned" cell after deleting the column

After deleting the column which contained a cell with some content, the cell becomes "orphaned" floating outside of the sheet. Probably both interface and cloud issue.

image

The cell with =library(tidyverse) was previously in column N.

image

TypeError: this._pods has not been instantiated.

Sentry Issue: CLOUD-2

TypeError: this._pods has not been instantiated.
  File "/home/cloud/dist/KubernetesCluster.js", line 118, in KubernetesCluster.list
    throw new TypeError('this._pods has not been instantiated.');
  File "/home/cloud/dist/KubernetesCluster.js", line 146, in KubernetesCluster.get
    const sessions = await this.list();
  File "/home/cloud/dist/KubernetesCluster.js", line 247, in KubernetesCluster.resolve
    const pod = await this.get(sessionId);
  File "/home/cloud/dist/serve.js", line 32, in app.all
    const podUrl = await cluster.resolve(req.params.sessionId);
...
(5 additional frame(s) were not displayed)

TypeError: this._pods has not been instantiated.

Use macaroons instead of JWTs

Currently server.js uses JWT (JSON web tokens) for routing to container sessions. Macaroons are a more secure alternative.

401 error trying to reload a tab after inactivity

After about 30 min inactivity on the Hub, when reloading the tab with an open project I get the following error:

ERROR:An error occurred with request "GET http://cloud-test.stenci.la/v1/sessions!/stencila-cloud-233563f82b21ab0bc2200243/manifest"

Developer console:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.