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:
- Git
- 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. - pipx — For installation instructions, visit Torque Docs
- 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. - Torque CLI - For installation instructions, visit Torque Docs
Step-by-step Guide
- Download or clone GitHub repository locally.
git clone https://github.com/torquetech/quick-start-do-k8s.git
- Make the cloned repository your working directory.
cd quick-start-do-k82
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.First, we need to build docker images for the two application services. For that, we use:
torque deployment build local
- Now, all we need to do is to
apply
thelocal
deployment. Theapply
command forlocal
first generates thedocker-compose.yaml
file and then executes thedocker 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.
- 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%