Deploying Your First App on Acorn

Nov 14, 2023 by Luc Juggery
Deploying Your First App on Acorn

Acorn has recently announced the launch of its cloud platform available for everyone at https://acorn.io. This platform offers users a sandbox environment where they can deploy Acorn applications for free. In this guide, we will outline the steps to deploy a simple application within this sandbox.

Login into Acorn

Visit https://acorn.io where you can log in just using your GitHub Account

Acorn Home Page

Upon clicking the Login button, you’ll be directed to the authentication page.

Signin Page

After logging in, you’ll reach the Acorn dashboard, presenting you with several options:

  • deploy an existing Acorn into the Sandbox
  • explore the Acornfile format in the playground
  • browse Acorn related documentation

Dashboard

This article will focus on deploying an existing Acorn.

Deploying an application using the UI

We will demonstrate this using the VotingApp, a straightforward microservice application. We have used this application in a series of introductory articles on Acorn and in this self-paced Acorn workshop. To learn more about the VotingApp, you can review the code in Gitlab.

From the Acorn dashboard, start by selecting the Already have an Acorn option.

Menu Selection

Next, choose From Acorn Image since we are deploying an already existing Acorn image from an OCI registry. Then, enter the image details:

  • Name: VotingApp
  • Retain the region of the default Acorn project
  • Image path: docker.io/lucj/voting:v#.#.#

Image Selection

Note: the path of this Acorn image docker.io/lucj/voting:v#.#.# specifies the image available in the Docker Hub OCI registry. The format v#.#.# enables Acorn to automatically update the application when a new tag appears in the registry.

Image in DockerHub

After entering the information, click Deploy. The application will be created in the Pending state.

Application Created

The status will shift to Provisioning, and additional details will be displayed, indicating the status of the application’s components.

Application provisioning

Once all the application’s container are up and running, the status will change to Running.

Application running

Two contextual menus are accessible on the right:

The bottom icon leads to the application’s endpoints, the URL through which users can access web interfaces exposed to the outside:

vote_menu-endpoints.png

Two HTTP endpoints are provided in this example:

  • voteui:80 is a link towards the vote-ui interface where users can vote
  • resultui:80 is a link towards the result-ui interface where users can get the results of the vote

Clicking these links opens the interfaces in new tabs.

Vote UI

Result UI

The top icon toggles a menu offering several application management actions:

  • visualize the Acornfile that defines the app
  • starting / stopping the app
  • redeploying the app
  • accessing a shell in one of the running containers
  • deleting the app

vote_menu-app.png

For example, to view the application logs, click View logs from this menu. A panel will appear at the bottom of the screen as shown below, displaying the logs of all the application’s containers.

Application Logs

A menu at the bottom allows you to select the container’s replica and to filter the logs.

Application Logs

Clicking the application name displays the main information:

  • resource usage
  • endpoints
  • Acornfile (which can be opened in a dedicated tab for more clarity)

vote_app_details.png

Also, clicking the “plus” sign next to the application name expands the app and reveals details about its components:

  • containers
  • jobs
  • volumes
  • secrets

vote_app-running-expanded.png

Selecting a component opens a new panel providing detailed information such as:

  • resource usage
  • image id
  • mounted directories
  • environment variables

The example below is an illustration for the result container:

Container

More details are available for other components as well. The screenshot below shows the details of the volume backing the Postgres database, a 1GB AWS EBS. The volume backing the Redis database would show the same characteristics.

Volume

Similarly you can inspect the db-creds secrets which content was automatically generated when the application was deployed.

Secret

Once finished using the application, we can remove it using the Remove option in the application contextual menu.

Deploy an application using the quick path

In the previous part we explored some Acorn Cloud main features and saw the application deployment process through the UI. You can quickly deploy the application in your Acorn sandbox clicking the button below:

run-in-acorn.png

Note: you will be requested to authenticate first

Key takeaways

As we saw in this tutorial, deploying an existing application in the Acorn sandbox is straightforward. All you need is a GitHub account, the application’s image and you’r good to go. An application running in the Sandbox will automatically shut down after 2 hours, For continuous operation and extra features, you might consider upgrading to the Acorn Pro plan.

You can also deploy applications directly using the Acorn CLI, which provides the same functionality from the command line.