Hosting a Genie Application

Introduction

In this tutorial, we demonstrate how to deploy a dashboard using Genie along its associated Stipple framework for interactive applications.

genie-iris-snapshot

Getting Started

The most important step is to first have a functioning Genie app. The Official Genie resources page provides further details on the various tools available to assist in the development.

For this tutorial, we will start with an existing app GenieAppTutorial available here.

To kickoff a new project, Genie provides various helper functions. GenieAppTutorial was initiated with:

using Genie
Genie.newapp("GenieAppTutorial")
Genie.newcontroller("dashboards")

Genie.newapp("GenieAppTutorial") here acts in a similar way to Pkg.generate(): it setups of new a Julia package and includes all the required scripts to get a functional app skeleton.

Deploying on JuliaHub

Like for any other JuliaHub custom application, making a new app requires to provide a path to a git repo that contains a Julia package in which a script bin/main.jl acts as an entry point.

Genie provides builtin support to directly generate a JuliaHub startup script:

Genie.Deploy.JuliaHub.mainjl()

When launching the app, a port has to be specified, which should be set at 8000 by default:

genie-launch

App accessibility

Once the app is started, anyone can now access the newly deployed dashboard using the link appearing in the job status.

If REST API entry points were made available, they can also be accessed, for example from the browser:

genie-API

Or programmatically:

using HTTP
HTTP.get("http://APP-URL/api?n=120")

Here the endpoint simply returns the data from observation #n.

Next steps

Congratulations on completing this tutorial! You now know how to run an interactive application powered by Genie on JuliaHub.