oct-cloud

Crates.iooct-cloud
lib.rsoct-cloud
version0.4.1
created_at2025-08-22 05:21:12.597221+00
updated_at2025-08-22 05:21:12.597221+00
descriptionopencloudtool (oct)
homepagehttps://opencloudtool.com
repositoryhttps://github.com/opencloudtool/opencloudtool
max_upload_size
id1805928
size306,777
Vladimir Minev (minev-dev)

documentation

https://opencloudtool.com/docs

README

Header

opencloudtool

Actions status codecov

A tool to hide the complexity of the cloud.

Install oct-cli

curl -LsSf https://repo.opencloudtool.com/install.sh | sh

or

wget -qO- https://repo.opencloudtool.com/install.sh | sh

Log in to AWS

Basic login (docs):

aws configure

Using AWS SSO (docs):

aws configure sso

Deployment Examples

High Level Design

OpenCloudTool Design

Versions Design

Each version of OpenCloudTool has a mini-project to prove the design and implementation.

v0.5.0 "Refactor: Deployment speed and scalability"

v0.5.0

Development

Command examples

Install pre-commit hooks

pre-commit install

Build project

 cargo build

Run deploy command

 cd dir/with/oct.toml
 cargo run -p oct-cli deploy

Run destroy command

 cargo run -p oct-cli destroy

Show all available commands

 cargo run -p oct-cli --help

Show all available parameters for command

 cargo run -p oct-cli command --help

For example:

 cargo run -p oct-cli deploy --help

Writing tests

[WIP] Main principles:

  • Each module provides its own mocks in a public mocks module
...main code...

pub mod mocks {
    ...mocks...
}

#[cfg(test)]
mod tests {
    ...tests...
}
  • Each module tests cover only the functionality in the module
  • If a module uses external modules, they are mocked using mocks provided by the imported module's mocks module
...other imports...

#[cfg(test)]
use module::mocks::MockModule as Module;
#[cfg(not(test))]
use module::Module;

...main code...

Imports ordering

When importing modules, the following order should be used:

  • Standard library imports
  • Third-party imports
  • Local crate imports
use std::fs;

use serde::{Deserialize, Serialize};

use crate::aws::types::InstanceType;

Dev tools

Machete

Removes unused dependencies

cargo install cargo-machete
cargo machete

Cargo Features Manager

Removes unused features

cargo install cargo-features-manager
cargo features prune

Profile building time

Produces HTML file with building time report. Can be found in target/cargo-timings.html

cargo build -p PACKAGE_NAME --release --timings

Pricing comparison

This section compares the cost of running a set of services in a cloud with different approaches which do not require the end user to manage underlying infrastructure (serverless).

Note that OpenCloudTool is a free to use open-source tool and there is no charge for using it.

Simple REST service

Main components:

  • Django REST service (0.5 vCPU, 1GB RAM)
  • Celery worker (0.5 vCPU, 1GB RAM)
  • Redis (0.5 vCPU, 1GB RAM)
  • Postgres (0.5 vCPU, 1GB RAM)
  • Load Balancer (nginx, ELB, etc.)

AWS ECS Fargate

  • 2 vCPU (1 vCPU per hour - $0.04048) - $61.5 per month
  • 4 GB RAM (1 GB RAM per hour - $0.004445) - $13.5 per month
  • Load Balancer ($0.0225 per hour) - $17 per month

Total: $92 per month

Single EC2 instance managed by OpenCloudTool

  • 1 EC2 t4g.medium instance ($0.0336 per hour): $25.5 per month

Total: $25.5 per month

Commit count: 376

cargo fmt