Digital Ocean manager with CLI functionality
Project description
DigitalOcean Manager (DOM) CLI
dom is a command-line tool to manage your DigitalOcean resources. From GPU droplets to volumes, it provides an intuitive interface to simplify your cloud management tasks, especially for AI workloads.
Installation
Install dom using pip:
pip install dom-cli
Prerequisites
Before using the dom CLI, you need to set up your DigitalOcean API token.
Export the DIGITALOCEAN_TOKEN environment variable with your token, ensuring it has the following permissions:
- actions: read
- block_storage: read, delete, create
- block_storage_action: read, create
- droplet: read, update, delete, create
- regions: read
- sizes: read
- tag: create, read, delete
- ssh_key: read
Usage
The general syntax of the dom command is:
dom [OPTIONS] COMMAND [ARGS]...
Workflow
-
Installation: Install the CLI tool using pip.
-
Initialize a Project: Create a new project in the current directory using:
dom initThis command will create the following project structure:
├── config.yaml ├── cloud-configs │ └── base.yaml ├── droplets │ ├── cpu-mini.json │ └── nvidia-h100.json └── volumes └── models.json
config.yaml
The config.yaml file contains the main configuration for the project. Below is an example:
# DigitalOcean datacenter region slug (str).
# Full detail here: https://docs.digitalocean.com/platform/regional-availability/
digitalocean_region: nyc2
# List of (int) protected droplets IDs.
# You can't stop/delete a protected droplet.
# You can't detach a volume from a protected droplet.
protected_droplets: []
# List of (str) protected volumes IDs.
# You can't delete a protected volume.
protected_volumes: []
# JSON indentation level (int) for raw outputs.
json_indent: 4
# Action ping interval (float) in seconds.
ping_interval: 1
Project Directories
cloud-configs/: Directory for cloud-init YAML files used to define tasks and configurations for droplets.droplets/: Directory for droplet templates, including configurations for CPUs and GPUs.volumes/: Directory for volume templates, such as those for storing AI models.
Examples
Droplet Management
dom handles GPU droplets and is optimized for managing automated AI tasks on DigitalOcean GPU droplets.
Create a Droplet
Example of droplet creation using the nvidia-h100 template:
dom droplet create nvidia-h100 ai-tasks-01 \
--key [some key id] \
--volume [some volume id] \
--cloud-config name-of-my-cloud-init
The above command creates a droplet with all the configurations and scripts needed for running AI tasks on GPU droplets, using a cloud-init file (name-of-my-cloud-init.yaml) defined under the cloud-configs/ directory.
Volume Management
dom also supports creating and managing volumes for storing data, such as AI models.
Example: Create a Volume
Example using the models.json configuration file:
cat volumes/models.json
{
"name": null,
"size_gigabytes": 100,
"description": "Models volume",
"region": null,
"filesystem_type": "ext4",
"filesystem_label": "models"
}
dom volume create models aimodels
This creates a volume named aimodels with a size of 100GB, formatted with the ext4 filesystem, and labeled as models. The volume can then be shared across multiple droplet instances.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dom_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: dom_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d805ad21f3fdb1a0b7d51649387c4cbe21ad1c2e39704012c10ce39186136681
|
|
| MD5 |
d2b4e1a2475d59d4f91ca4374980425f
|
|
| BLAKE2b-256 |
a4699575de00d45276c2d83847ea6beede077d0fdcd13bbeb4506d56c9975c6f
|