/Face-recognition-app

Deploy a face recognition app with K8s in huawei cloud

Primary LanguagePython

Face-recognition-app

Using Huawei cloud resources to create an inference model for face recognition.
I have face the issue during installing docker on my Ubuntu 22.04. Here is a method to resolve it Docker Installation.

Example

image

Environment

Environment Version Function
Architecture x86_64
Ubuntu 22.04
python 3.10.12
Docker 27.2.0 Deploy image
Kubectl 4.5.7 For K8s debugging

Resources

  • VPC
  • ELB
  • CCE
  • NAT
  • Redis
  • RDS
  • Function Graph
  • OBS
  • EIP x 3
  • SWR

Resources Explanation

Focus on some complicated service only. Others just follow documentation to create.

CCE: Using for deploying application

  1. Choose any type (I choose CCE Turbo Cluster)
  2. Create nodepool (I choose spec: c7n.4xlarge.2 | 16 vCPUs | 32 GiB)
  3. Create deployment & service in backend_code/README.md

NAT: Bind with CCE's node subnet, provide node with capability to connect public internet for downloading document

  1. Create NAT
  2. Buy EIP
  3. Create SNAT rule and bind with EIP bought just now

SWR: SWR is a service to upload CCE needed image

  1. Copy login cmd from SWR

Workflow

  1. Create Resources
  2. Clone this repository
  3. Update environment variables
  4. Modify push docker image dest
# Build the Docker image
image="swr.ap-southeast-3.myhuaweicloud.com/model-deploy/${name}"
docker build -t ${image}:v${version} .
  1. run script inside backend_code directory and frontend_code directory
./run.sh <image-name> [-v <version>] [-s]
  1. Create workload in CCE (choose correct image and update environment variable) image image

Future work

  1. Generate terraform script for one-step create resources
  2. Generate yaml script for one-step deploy CCE