Custom Applications on Edge
Above: various scientific applications displayed on the Edge workbench.
Why Edge for applications?
Deploying web apps in the cloud is a complex and time-consuming process that requires specialized skills and expertise. Typically, it involves multiple steps, such as setting up a cloud environment, configuring networks, and establishing access management. This complexity can lead to delays, extra costs, and potential risks for R&D teams who want to focus on the science rather than software engineering.
With Edge, all of this is reduced to a simple three-step process:
- Write your application, and package it as an industry-standard OCI (Docker) container image.
- Create an application entry in Edge; providing a title, icon, and the name of the container image.
- When a user clicks the icon to launch the app, Edge automatically downloads the image, provisions all compute resources (CPU, memory, even a GPU if enabled), and launches a private, secure instance of the app.
Edge's pre-configured and secure cloud environment eliminates the need for you to set up and configure your own environment. Edge also streamlines the deployment process by handling all aspects of app deployment, including authentication, compute scaling, and data encryption.
Finally, Edge automates the monitoring and management of your deployed apps, ensuring your cloud costs are optimized and under control.
What applications can run on Edge?
Virtually anything you can fit in a Docker container.
Common use cases include scientific visualization and analysis apps. These benefit from Edge's architecture, in which each user gets their own private instance of the app. That makes it easy to write compute-heavy apps without worrying about scaling or job management. And yes, this includes AI and machine-learning tasks which need a GPU.
In the online examples gallery we provide examples for some common toolkits:
- Streamlit, an easy-to-use framework for building data apps. (official docs)
- Panel, a data-exploration and web-app framework for Python. (official docs)
- Plotly Dash, a low-code framework for rapidly building data apps in Python. (official docs)
- React, the industry standard for building responsive web applications. (official docs)
Below: example app for feature detection, developed using the React framework.
Before diving in to the process of developing an app, it's important that we review the basic architecture of how apps work on Edge. Working through the examples will be much easier if you keep this in mind.
As we mentioned above, part of what makes Edge apps special is that each user gets their own running instance of the app. This is in contrast to a traditional web service, where one server is shared among many users. Some things which are difficult or impossible on a shared server become straightforward in Edge. For example, you can run compute-intensive tasks or write to local storage.
There is also no need for user management, handling a sign-in flow, permissions, etc., because Edge makes sure that only the user who launched the app can access it. This is enforced by a combination of Edge's own proxy layer, and a (completely automatic) OAuth exchange between the app and Edge.
The image above is a highly-simplified version of the Edge architecture. First you define an app (as we'll see in the next section, by making an app version record). This definition includes the app name, icon, and a link to the Docker image. Then, when a user logs in and launches the app, they get their own private instance.
Importantly, from the user's perspective, they only have to go to the Edge server and log in. Edge hides all the complexity of proxying, different ports, security, and so on. That includes making sure the app is served over SSL/TLS.
The next chapter will walk you through the process of creating a new application.