SlapOS Home SlapOS

    Deploy Software on Theia

    Document showing how to deploy software on the SlapOS Theia
    • Last Update:2021-02-19
    • Version:001
    • Language:en

    Deploy Software on Theia

    This presentation aims to demonstrate how to deploy a software release on a SlapOS Theia. The process can be used for any software available on the SlapOS repository. Note, that the SlapOS Theia is an extensible platform to develop multi-language Cloud & Desktop IDEs with state-of-the-art web technologies. Instantiating a SlapOS thus means, creating a smaller encapsulated system for then deploying another software inside. This is a useful approach for developing or hosting simple software releases.

    Table of Content

    • Before You Start
    • Deployment of Software Release: helloworld
      • (1/4) slapos supply [software] [node]
      • (2/4) slapos node software
      • (3/4) slapos request "instance_name" [software]
      • (4/4) slapos node instance

    We’ll show how to deploy a "helloworld" software release on a SlapOS Theia in this presentation. 

    We will clarify the prerequisites in order to start the presentation. Then, we progress to show the steps to deploy "helloworld" software release on SlapOS Theia.

    Before you start

    This deployment tutorial is based on Prepare For The Deployment of Software on Theia. You are expected to finish the last tutorial and have your software located on SlapOS Theia to get started.

    Deploy Helloworld Software

    • (1/4) slapos supply [software] [node]
    • (2/4) slapos node software
    • (3/4) slapos request "instance_name" [software]
    • (4/4) slapos node instance

    From terminal, we can use slapos command line. To deploy a software, we should basically type these 4 commands. Don't be afraid of these strange commands. You will understand how it works practically through the 4 steps in a quarter.  

    The information below may help you:

    • Client commands(slapos supply, slapos request) talking to the master as a human and requesting installation/deployment of services
    • Node commands(slapos node) talking to the master and doing the job of compiling the software and launching the services
    • There is also an Understanding SlapOS Architecture you can refer to

     

    (1/4) slapos supply [software] [node]

    slapos supply: ask the master to supply a software to a given node.

    slapos supply $PWD/slapos/software/helloworld/software.cfg slaprunner

    In our case, the software is helloworld, located in /srv/slapgrid/slappart49/srv/project/slapos/software/helloworld/software.cfg, for example. The path can be copied by right-clicking the exact file (software.cfg) -> Copy Path. And Node is named slaprunner here. You could either type slapos supply $PWD/slapos/software/helloworld/software.cfg slaprunner in your terminal, or replace $PWD/slapos/software/helloworld/software.cfg with the full path of the software.cfg of helloworld (something like slapos supply /srv/slapgrid/slappartX/srv/project/slapos/software/helloworld/software.cfg slaprunner).

    When you are inside theia, you are actually talking to a slapproxy (small slapos master) dedicated to your Theia. 

    (1/4) slapos supply [software] [node]

    Software Supplied!

    When you get a similar result on your terminal, the master knows that helloworld software needs to be compiled in the node.

    (2/4) slapos node software

    slapos node software: this isthe command a node is launching to actually compile/remove the softwares

    • Command line:

      slapos node software

    or

    • Terminal -> Run Task : slapos node software

    You can run slapos node software in Terminal to compile the software. Or there is a task configured with the same label (Terminal -> Run Task, if there is an error, hit Run task again).

    Noteslapos node software will compile the software locally in the node. The compilation directory will be used later to instantiate your service . Your instance will be deployed totally from the software installation directory (no more access to internet).

    (2/4) slapos node software

    Task is building in terminal

    Task starts the build in a new terminal. If you close that terminal process will be terminated.

    Compilation can take anywhere from a few minutes (simple software, already compiled) to several hours. The log will inform of any errors or warnings encountered during compilation.

    (2/4) slapos node software

    Connection Error

     

    Sometimes external errors such as network errors happen and in that case we can retry the compilation.

    (2/4) slapos node software

    Software installed! 

    By re-running the task, you can have your software compiled successfully. Now we can say, we have prepared everything from the software configuration file, and it can be used for instantiating an instance without network. Before having the instance with helloworld software, we are supposed to request an instance firstly. 

    (3/4) slapos request "instance_name" [software]

    slapos request: request the allocation of an instance to the master. This commands also get status and parameters of the instance if it has any (the command is meant to be run multiple time until you get the status).

    Enter the following command in your terminal to start requesting:

    slapos request "hello world instance" $PWD/slapos/software/helloworld/software.cfg

    In order to deploy a service, you use slapos request to ask the master to allocate an instance for you. Since the slapproxy (small master in Theia) only knows a local node, you are sure the master will allocate the software to your local node. “instance_name” is up to you, and [software] must be exactly the same path you supplied earlier.

    (3/4) slapos request "instance_name" [software]

    Instance requested! 

    request is the command to:

    • create the service if it’s not yet created
    • get parameters from a service

    You will need this information for your next tutorial.

    (4/4) slapos node instance

    slapos node instance: run instance deployment on the node 

    • Command line:

      slapos node instance

    or

    • Terminal -> Run Task : slapos node instance

    Now we come to the last step of deployment. After have an instance requested, you can run slapos node instance in Terminal to instantiate your software. This is the command actually deploying the service in the node. Or there is a task configured with the same label (Terminal -> Run Task, if there is a connection error, hit Run task again)

    (4/4) slapos node instance

    Software applied to instance! 

    Congrats! The helloworld software has been deployed.

    You might want to verify the deployment. We will inspect the services and relevant connection parameters in the next tutorial.

    Thank You

    Image Nexedi Office
    • Nexedi SA
    • 147 Rue du Ballon
    • 59110 La Madeleine
    • France