3 releases (breaking)
Uses new Rust 2024
| new 0.4.0 | Dec 11, 2025 |
|---|---|
| 0.2.0 | Oct 26, 2025 |
| 0.1.0 | Oct 8, 2025 |
#1786 in Network programming
19KB
gcp-client-rust
A simple gcp client that makes a google cloud client SDK call with the Rust SDK
Project Overview
A simple gcp client that makes a google cloud client SDK call with the Rust SDK
Key Technologies
- Language: Rust
- Web Framework: Hyper
- Containerization: Docker
- Deployment: Google Cloud Run
- CI/CD: Google Cloud Build
Getting Started
This project uses a Makefile to simplify common development tasks.
Prerequisites
Initial Setup
-
Install Dependencies:
cargo build -
Run the application locally:
make runThe server will start on port
8080.
Development Workflow
The Makefile provides targets for common development tasks.
Building the Project
- Development Build:
make build - Release Build:
make release
Running Locally
make run
Code Quality
- Formatting:
make format - Linting:
make clippy
Testing
make test
Deployment
Deployment is handled by Google Cloud Build and defined in cloudbuild.yaml.
Manual Deployment
To manually trigger a deployment, run:
make deploy
This command submits a build to Google Cloud Build, which will:
- Build the Docker image (as defined in
Dockerfile). - Push the image to Google Container Registry (GCR).
- Deploy the new image to the
cloudrun-rustservice in theus-central1region.
Deployment Process
Dockerfile: A multi-stage Dockerfile is used to create a minimal, secure production image.- Builder Stage: The Rust code is compiled in a
rustbuilder image. - Final Stage: The compiled binary is copied to a minimal
gcr.io/distroless/cc-debian12image.
- Builder Stage: The Rust code is compiled in a
cloudbuild.yaml: This file defines the Cloud Build pipeline. It takes care of building, pushing, and deploying the container image.
Dependencies
~27–44MB
~728K SLoC