This project aims to build a Rust micro-server that image classification. The project is based on onnx resnet model to classify images. The project is built with Rust, libtorch, and hugging-face pretrained models. The project is deployed on kubernetes.
- Develop my Rust micro-service with kubernetes
- Use Github Codespaces and Copilot
- Integrate libtorch and 'hugging-face pretrained models' into a Rust web project
- go to the directory
K8s
cd K8s
- create the namespace
resume-prod
kubectl create namespace resume-prod
- apply the yaml files
kubectl apply -f .
- This repo main branch is automatically published to Dockerhub with CI/CD, you can pull the image from here
docker pull szheng3/sz-rust-ml:latest
- Run the docker image.
docker run -d -p 8000:8000 szheng3/sz-rust-ml:latest
- Run the docker image with GPU.
docker run -d -p 8000:8000 szheng3/sz-rust-ml:latest-gpu
- Install rust via rustup
- node
- Build frontend
make web
- Run, you can run the rust web app.
make run
- Release
make releasex86
- Bench
make benchx86
Github Actions configured in .github/workflows
The binary could be downloaded from the release pages. release
CPU | GPU |
---|---|
![]() |
![]() |
- Configure Github Codespaces.
- Initialise Rust project with pretrained model from hugging-face
- CI/CD with Github Actions
- Tag and Releases
- Benchmark
- kubernetes deployment
- logging