TUTORIALS

TutorialsCLI Quickstart Guide Arukas with Python

CLI Quickstart Guide Arukas with Python


1. Introduction

This CLI quickstart guide has you deploying a simple Hello-world-ish Python application ( powered by Flask ) on Arukas with CLI tool.

Prerequisites:

2. Deploy an application to Arukas

There are basically two ways for now.

2.1. Deploy a Python application to Arukas with Arukas CLI Tool

Step One – Get you own API key

Deployment using Arukas CLI Tool is completed through key authentication.
Once you have an Arukas account, you can issue your API key in here.

  • API_TOKEN
  • SECRET_KEY

Step Two – Deploy a simple Python application

Now it’s time to deploy a Python application on Arukas.
We’ll use a dockerlized CLI in this quickstart guide instead of the binary version provided in here.



$ docker run --rm \
      -e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
      -e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
          arukasio/arukas run \
              --instances=1 \
              --mem=512 \
              --app-name="quickstart-python" \
              --ports=80:tcp \
                  arukasio/quickstart-python

Parameters:

  • instances: The number of instances
  • mem:The Size of memory
  • app-name: The name of application
  • ports: Port number

Step Three – Check the applications you are running on Arukas

Let’s see if the deployment is completed.
ps command returns information about your running applications.


$ docker run --rm \
      -e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
      -e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
          arukasio/arukas ps

Table column:

  • CONTAINER ID: Container id
  • IMAGE: Image name
  • COMMAND: Command executed to run an application
  • CREATED: The date an application is created
  • STATUS: Status
  • NAME: Status of an application
  • ENDPOINT: Domain name for the endpoint

Ex.


CONTAINER ID    IMAGE   COMMAND CREATED STATUS  NAME    ENDPOINT
0df30faa-ba63-49f5-a50f-efb27f899d26    arukasio/quickstart-python      2016-05-20T10:31:17.897+09:00   running drunk-shaw-8524 drunk-shaw-8524.arukascloud.io

Step Four – Access to the endpoint

Finally you can access to the endpoint.


$ curl https://<ENDPOINT>

It will return “Hello World!“.

If you visit User control panel, there will be an application name “quickstart-python”.

Other commands:

  • start [OPTIONS] IMAGE
  • stop [OPTIONS] IMAGE
  • rm [OPTIONS] IMAGE

They are all self-explanatory, so we don’t get into the details.
More informations can be found by help command.


$ docker run --rm \
      -e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
      -e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
          arukasio/arukas help

3. What’s next?

Now you’ve deployed your very first application on Arukas.
If you already have your own Docker images, go ahead and just deploy them as we did so far. It’s basically the same thing.

We also provide different types of simple Hello-world-ish images on Docker Hub.

For more on Docker, visit the official documentation page. The scripts used in this quickstart guide are hosted on this GitHub page.

Other CLI quickstart guides