Incode Labs Application Platform

Welcome to the Incode Labs Application Platform. This site provides templates and resources for deploying applications to the Incode Labs environment.

View Example Application running

View Example Application source code

Getting Started

To create and deploy a new application to the Incode Labs environment, follow these steps:

1. Create a new repository

Start by creating a new GitHub repository for your application.

2. Set up the required files

You'll need three key files to deploy your application:

  • Dockerfile - Create your own Dockerfile based on your application's requirements
  • labspec.yaml - Configures your application deployment (template provided)
  • GitHub Actions workflow - Automates the deployment process (template provided)

3. Download the templates

Use this script to set up the template files:

#!/bin/bash

# Create directories
mkdir -p .github/workflows

# Download templates
curl -L https://bootstrap.labs.incode.com/templates/labspec.yaml -o labspec.yaml
curl -L https://bootstrap.labs.incode.com/templates/github-workflows/deploy.yml -o .github/workflows/deploy.yml

echo "Templates downloaded successfully!"
View Detailed Instructions

Example Application: See a complete working example at github.com/IncodeTechnologies/incode-labs-demoapp

4. Customize your application

Update the templates with your application's specific details:

  • Create a Dockerfile that builds your application
  • Edit labspec.yaml with your application name, image name, and port
  • Add any repository variables to your GitHub repository. They will be automatically exported to environment variables for the deployed application.
  • Add any required secrets to your GitHub repository. They will be transferred to AWS Secrets Manager during deployment.

5. Deploy your application

Commit and push your changes to the main branch. The GitHub Actions workflow will automatically:

  • Build and push your Docker image to ECR
  • Export your GitHub secrets to AWS Secrets Manager
  • Deploy your application using Terraform

Your application will be available at https://{app_name}.labs.incode.com

Available Resources

Application Templates

Templates to help you quickly set up new applications:

  • labspec.yaml - Configuration for your application deployment
  • deploy.yml - GitHub Actions workflow for automated deployment

Terraform Modules

Modules used by the deployment process:

Managing Your Application

Instance Sizes

You can configure the CPU and memory resources for your application using the instance_size field in your labspec.yaml:

Size CPU Memory Use Case
small (default) 0.25 vCPU 512 MB Simple APIs, lightweight services
medium 0.5 vCPU 1 GB Moderate workloads
large 1 vCPU 2 GB Heavier processing
xlarge 2 vCPU 4 GB Video processing, ML inference
xxlarge 4 vCPU 8 GB Heavy compute workloads

Example:

app_name: video-processor
image: video-processor
container_port: 8080
instance_size: xlarge  # 2 vCPU, 4GB RAM for video processing

Note: Larger instance sizes will incur higher AWS costs.

Destroying an Application

When you no longer need your application, you can destroy all its resources:

  1. Edit your labspec.yaml file and add destroy-app: true
  2. Commit and push your changes to the main branch
  3. The GitHub Actions workflow will automatically destroy all resources

Example:

app_name: myapp
image: myapp-image
container_port: 8080
destroy-app: true  # This will trigger destruction of the application stack

Troubleshooting

If you encounter issues with your deployment:

  1. Check the GitHub Actions workflow logs for errors
  2. Verify that your Dockerfile builds successfully
  3. Ensure that your application is listening on the port specified in labspec.yaml
  4. Confirm that all required secrets are added to your GitHub repository