Skip to main content

1. Running Locally

This chapter will give a walkthrough of running Quick Start locally.

Prerequisites

To run the DAG locally using Docker or to deploy it to DigitalOcean, you'll need to ensure you have these installed and up-to-date:

  1. Git
  2. Python 3.10+ — To check your version run python3 --version. For installation instructions visit Python 3 Installation & Setup Guide or Managing Multiple Python Versions With pyenv.
  3. pipx — For installation instructions, visit Torque Docs
  4. Docker with Docker Compose — To install Docker (with Docker Compose), visit docker.com/get-started website and follow the instructions. And make sure Docker is up & running by running docker info or by checking a visible Docker image on the MacOS status bar.
  5. Torque CLI - For installation instructions, visit Torque Docs

Step-by-step Guide

  1. Download or clone GitHub repository locally.
git clone https://github.com/torquetech/quick-start-do-k8s.git
  1. Make the cloned repository your working directory.
cd quick-start-do-k82
  1. Make sure you are running Docker locally. You can test if Docker is running with docker info command or by checking a visible Docker icon on the MacOS status bar.

  2. First, we need to build docker images for the two application services. For that, we use:

torque deployment build local
  1. Now, all we need to do is to apply the local deployment. The apply command for local first generates the docker-compose.yaml file and then executes the docker compose command.
torque deployment apply local

If you open the Docker dashboard, you will notice the local-0wr4 deployment with five containers: one container for load balancer (nginx), two containers for two backend services, one container for the database, and one container that initializes the database that should be exited after it runs and initializes the database.

  1. To check the running app execute the following:
curl -H "Host: api.example.com" http://localhost:8080/backend-service

The output should be the current database time.

Database time: 2023-01-09T10:49:30.536818Z%