Skip to main content

Introduction to App Deployment

Creating new Application

To allow Lyrid to be able to recognize what type of application you have, we would need to set up .lyrid-definition.yml in your project's root directory.

Example Lyrid Definition

name: <Application Name>
description: <Application Description>
ignoreFiles: .git .next node_modules .husky .eslintrc.js yarn.lock package-lock.json
modules:
- name: <Module Name>
language: nodejs16.x
web: nextjs
description: <Module Description>
functions:
- name: fn
entry: entry.js
description: <Function Description>

This is a sample lyrid definition to deploy a Next.js project using node 16.
Your project's file structure should look something like this:

projectRoot
|__ .lyrid-definition.yml
|__ etc
|__ ...
note
  • To view supported libraries, you can go to LyridInc's Github and look for your library's template for .lyrid-definition.yml
  • Depending on your project's library, you could require some restructuring of your main function. See the github for some reference.
  • Some libraries may not be supported as a template yet, in order to use Lyrid's platform, you can use the Docker definition for .lyrid-definition.yml
  • Here is a more in depth breakdown of the yml file

Types of Deployments

Lyrid's deployments can be separated into two types:

  1. Serverless

    • Serverless mode operates utilizing the Knative framework as its underlying infrastructure. In this serverless mode, predefined configurations and setups for various web frameworks are integrated.
    • Auto scaling will be automatically managed with Lyrid's AI, optimizing resources used for deployment in Serverless Mode

    Example:

    name: <Application Name>
    description: <Application Description>
    ignoreFiles: .git .next node_modules .husky .eslintrc.js yarn.lock package-lock.json
    modules:
    - name: <Module Name>
    language: nodejs16.x
    web: nextjs
    description: <Module Description>
    functions:
    - name: fn
    entry: entry.js
    description: <Function Description>
    • This deployment of a Next.js project set up with node 16 will be deployed with a predefined configuration as a Serverless Mode.

  2. Docker

    • Using a predefined Dockerfile, Lyrid wraps your code into a single container and executes the Dockerfile on Lyrid's platform. Docker mode is equivalent to running a single docker container.
    • This feature can we used for deploying a customized startup script for running a container within Lyrid.

    Example:

    name: <Application Name>
    description: <Application Description>
    ignoreFiles: .git venv __pycache__
    modules:
    - name: <Module Name>
    language: docker
    description: <Module Description>
    functions:
    - name: <Function Name>
    description: <Function Description>
    ports:
    - alias: "http"
    port: 80
    • This deployment of a Django or Flask project set up with a Dockerfile. Your project directory structure should look something like this:
    projectRoot
    |__ .lyrid-definition.yml
    |__ Dockerfile --- *IMPORTANT
    |__ etc
    |__ ...
    • This will be deployed into Lyrid's platform and will execute the commands within this Dockerfile.

Environment Variable

Environment variable is how the user can pass information into the system and retrieve it by using the environment variable calls. You will be able to get these string variables by calling:

Restricted Variable

Some of the variables are reserved by the platform. The Lyrid platform will automatically update these following values at the time of build:

  • CLOUD_ENV ------------- The current execution cloud framework.

    Possible Values : LYR (Lyrid), Local

  • TEMP_DIR ------------- File system writable temporary directory.

    Possible Values : .


Start Deploying

To start deploying at the speed of light!

To start deploying your individual project or code!