Skip to main content
In this tutorial you take a project from the Lab to a runtime cluster and call it from a terminal. You create a release, deploy it to an environment, create an evaluation key in the Admin UI, and run a blueprint with curl. Afterwards, any system that can send an HTTP request can use your blueprint. The tutorial uses the Pizza Pricing Calculator project. Its blueprint Pizza Pricing calculates the price of a pizza from its size, toppings, crust and day of the week. You can follow the same steps with your own project: the names on your screen will be different.

Before you start

  • A Lab account and a project with at least one public blueprint that was never deployed. The Pizza Pricing Calculator project comes from the Leapter examples.
  • The right to deploy to an environment of your runtime cluster, and to create evaluation keys there. Who may do what explains the rights.
  • A terminal with curl.

Steps

1

Open the Deploy dialog

Open the project in the Lab and click Deploy in the toolbar.You should see the Deploy dialog. Version name is filled in with the next version, for example v1. Under Callable on the cluster you see the public blueprints that callers can run.
The Lab's Deploy dialog. Version name is v1, Description is empty, Callable on the cluster lists Pizza Pricing. The Create release button has a green ring.

The Deploy dialog with the version name and Create release.

2

Create the release

Click Create release.You should see Release created and “v1 is ready.” Below it, under Deploy to an environment, the dialog says where the release goes:
  • When your workspace uses only Leapter Cloud, it says Deploys to Leapter Cloud, with the address of the runtime cluster below it, for example https://cluster.example.com.
  • When your workspace has runtime clusters of its own, it shows Runtime Cluster with Choose a cluster. Choose yours in the list, and its address appears below it.
The dialog now says Release created and v1 is ready. Under Deploy to an environment, Runtime Cluster shows Leapter Cloud with the address https://cluster.example.com. The Sign in and deploy button has a green ring.

After Create release, the dialog offers to deploy to the runtime cluster.

3

Sign in to the runtime cluster and deploy

The button below says what it does:
  • Deploy to playground (or another environment): the Lab has already signed you in to the runtime cluster. Click it.
  • Sign in and deploy: click it. A sign-in window opens. If it asks you to allow the runtime cluster to sign you in, click Allow. The window closes by itself. When you are already signed in to the Lab, it can close before you see it.
If you may deploy to only one environment, the Lab deploys to it. On Leapter Cloud the line above the button then names it, for example Deploys to Leapter Cloud · playground. If you may deploy to more than one, choose the one your callers should use in Environment, for example the environment for trying things out (here playground). Then click the button Deploy to with the environment’s name.On Leapter’s own runtime cluster, the Lab first prepares playground for your project, so playground is always in the list there. While it does this, the dialog shows Preparing playground access…. The first deploy of a project to playground gives you the rights on that application in playground, so you need no one to give them to you. If the project’s name is already used in playground by another workspace, the dialog says that the name is already in use and asks you to rename the project. The Lab then sends nothing to playground, but you can still sign in and deploy to another environment.You should see three lines like these:
The end of the Deploy dialog: This project is called pizza-pricing-calculator-180269 there. A green check mark and v1 is deployed to playground. Callers need an evaluation key for playground before they can run it.

The release is deployed. The dialog names the application and says that callers need a key.

Click Create an evaluation key below the last line. The Admin UI of your runtime cluster opens in a new tab.
4

Open your application in the Admin UI

If the Admin UI asks you to sign in, click Sign in with Leapter. Your application’s page opens.If you closed the Lab dialog, open the Admin UI yourself. Its address is the cluster address followed by /runtime-management/ui/, for example https://cluster.example.com/runtime-management/ui/. Click Sign in with Leapter. The Status page opens. At the bottom of the sidebar, choose your environment in the environment list. Your application is in the table. Serving now says “Not served yet: this application has no evaluation key in playground.”, and Drift says Not served. In your application’s row, click Create an evaluation key.
The Admin UI Status page for the playground environment. The row for pizza-pricing-calculator-180269 shows release v1, Not served yet: this application has no evaluation key in playground, and Not served in the Drift column. The Create an evaluation key link has a green ring.

The Status page before the application has a key.

5

Create an evaluation key

On your application’s page, go to the last card, Keys, and click Create key.
The application page of pizza-pricing-calculator-180269. The Keys card says This application has no key in this environment. The Create key button has a green ring.

The Keys card of the application, before it has a key.

In the dialog Create an evaluation key, type the system that will call in Used by, for example pizza-shop. Type why it needs the key in Reason, for example The pizza shop shows prices from this release. Click Create.
The dialog Create an evaluation key with Used by pizza-shop and Reason The pizza shop shows prices from this release. The Create button has a green ring.

Used by names the calling system, Reason says why it needs the key.

6

Copy the key

The dialog Copy this key now shows the start of the key. Click the copy button next to it. Copied appears below the key.
The dialog Copy this key now. The key field shows lk_dev_ followed by dots. The copy button next to it has a green ring, and Copied is shown below the field.

The key is shown only once. The copy button puts it on your clipboard.

Paste the key into a safe place now. The Admin UI never shows it again. Then click Done.
7

Copy the run address

Scroll up to the card Connect to with your application’s name. Under Blueprints, find Pizza Pricing. Next to Run address, click Copy.
The card Connect to pizza-pricing-calculator-180269. Under Blueprints, Pizza Pricing has the run address https://cluster.example.com/runtime/api/v1/playground/pizza-pricing-calculator-180269/models/pizza_pricing/runs. Its Copy button has a green ring.

Each callable blueprint has its own run address.

8

Call the blueprint

In a terminal, store the run address and the key in two variables. Replace the two values with the ones you copied:
Then call the blueprint with a large thin-crust pizza with two toppings on a Friday. The body is a JSON object with the blueprint’s inputs. For your own project, use your blueprint’s inputs: Call a release over REST shows where to read them.
You should see the blueprint’s outputs:
The first key of an application needs about a minute to reach the cluster. Until then, the call answers 404 page not found. Wait a minute and call again.

Result

Release v1 of your project runs in an environment of your runtime cluster, and a system that holds the evaluation key can call it. The total price for the pizza is 20.9. Click Status in the sidebar of the Admin UI: after a short time, Drift for your application says No drift.

What to do next