Ops
  • Introduction
  • Getting Started
  • Basic Usage
  • Configuration
  • Examples
  • Images
  • Instances
  • Volumes
  • Networking
  • Packages
  • Klibs
  • GPU
  • Hardware Acceleration
  • Clouds
    • Azure
    • AWS
    • Digital Ocean
    • Google Cloud Integration
    • IBM
    • Linode
    • OCI
    • UpCloud
    • Vultr
  • Hypervisors
    • Bhyve
    • Compose
    • Docker
    • Firecracker
    • OpenVMM
    • Hyper-V
    • Onprem
    • OpenStack
    • ProxMox
    • Virtual Box
    • VSphere
    • WorkStation
    • Terraform
    • Kubernetes
    • Bare Metal
    • Integrations
    • Debugging
    • CrossBuilding
    • MacOS
    • Deploy
    • FAQ
    • Benchmarking
  • Tools
    • Visual Studio Code Extension
  • Developer
    • Env Setup
    • Install from Source
Powered by GitBook
On this page
  • Pre-requisites
  • Image Operations
  • Create Image
  • List Images
  • Delete Image
  • Instance Operations
  • Create Instance
  • List Instances
  • Get Logs for Instance
  • Delete Instance

Was this helpful?

  1. Clouds

Digital Ocean

PreviousAWSNextGoogle Cloud Integration

Last updated 3 years ago

Was this helpful?

Ops can integrate with your existing Digital Ocean account.

Pre-requisites

  1. Create an account in ;

  2. Access :

    • Generate a token and export the value to the environment variable DO_TOKEN.

    • Generate space access keys and export the key and the secret to the environment variables SPACES_KEY and SPACES_SECRET.

  3. Access and create a space;

  4. Set your bucket name with the space name and set the region name where the space was created in the configuration file;

Configuration example.

{
  "CloudConfig": {
    "BucketName": "ops",
    "Zone": "sfo3"
  }
}

Image Operations

Create Image

You can create an image in Digital Ocean with the following command.

$ ops image create <elf_file|program> -t do -c config.json

For creating an image using a particular package, you need to provide the package name to ops image create command with -p option.

$ ops image create -c config.json -p node_v14.2.0 -a ex.js -i <image name> -t do -c config.json

List Images

You can list existing images on Digital Ocean with ops image list -t do -c config.json.

$ ops image list -t do -c config.json
+--------------------------------------+------------------------+--------+---------+------------------+
|                 UUID                 |          NAME          | STATUS |  SIZE   |    CREATEDAT     |
+--------------------------------------+------------------------+--------+---------+------------------+
| 01071a8d-eb59-49c1-aa69-028f84cc6d06 | nanos-main-image       | online | 10.0 GB | 3 days ago       |
+--------------------------------------+------------------------+--------+---------+------------------+
| 01c5bd28-aa19-4883-a4c9-31f3ff9fd061 | nanos-node-image       | online | 10.0 GB | 1 month ago      |
+--------------------------------------+------------------------+--------+---------+------------------+
| 01cd3190-df52-47e8-b5c3-b05f7107819e | nanos-server-image     | online | 10.0 GB | 1 year ago       |
+--------------------------------------+------------------------+--------+---------+------------------+

Delete Image

ops image delete <imagename> can be used to delete an image from Digital Ocean.

$ ops delete image nanos-main-image -t do -c config.json

Instance Operations

Create Instance

After the successful creation of an image in Digital Ocean, we can create an instance from an existing image.

$ ops instance create -t do -c config.json -i <image_name>

List Instances

You can list instance on Digital Ocean using ops instance list command.

$ ops instance list -t do -c config.json
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+
|                  ID                  |          NAME          | STATUS  | PRIVATE IPS |               PUBLIC IPS                |
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+
| 00d954cc-9603-43a0-915b-5c2ae75772b6 | nanos-main-image-15566 | stopped | 10.8.3.63   | 209.151.144.166                         |
+--------------------------------------+------------------------+---------+-------------+-----------------------------------------+

Get Logs for Instance

Work in progress.

Delete Instance

ops instance delete command can be used to delete instance on Digital Ocean.

$ ops instance delete my-instance-running -t do -c config.json
Digital Ocean
Application & API page
Spaces page