{"id":25007817,"url":"https://github.com/mjtechguy/do-gpu-terraform","last_synced_at":"2026-05-01T14:34:16.299Z","repository":{"id":274128848,"uuid":"922005033","full_name":"mjtechguy/do-gpu-terraform","owner":"mjtechguy","description":"Terraform code to deploy and configure a DigitalOcean GPU node","archived":false,"fork":false,"pushed_at":"2025-01-25T20:37:15.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T07:03:03.981Z","etag":null,"topics":["ai","artificial-intelligence","digitalocean","inference-engine","ollama","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjtechguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-25T04:17:40.000Z","updated_at":"2025-01-25T20:37:18.000Z","dependencies_parsed_at":"2025-01-25T05:19:09.548Z","dependency_job_id":"d091e5ac-9de3-4531-b9a4-6df6faf75c18","html_url":"https://github.com/mjtechguy/do-gpu-terraform","commit_stats":null,"previous_names":["mjtechguy/do-gpu-terraform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mjtechguy/do-gpu-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjtechguy%2Fdo-gpu-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjtechguy%2Fdo-gpu-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjtechguy%2Fdo-gpu-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjtechguy%2Fdo-gpu-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjtechguy","download_url":"https://codeload.github.com/mjtechguy/do-gpu-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjtechguy%2Fdo-gpu-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32501403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","digitalocean","inference-engine","ollama","terraform"],"created_at":"2025-02-05T02:38:04.463Z","updated_at":"2026-05-01T14:34:16.255Z","avatar_url":"https://github.com/mjtechguy.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digital Ocean GPU With Terraform\n\nThis project utilizes Terraform to deploy a GPU-optimized Droplet on DigitalOcean, configured with essential packages and tools for performance monitoring and system management. The deployment is automated using a cloud-init script to streamline the setup process.\n\n## Prerequisites\n\nBefore you begin, ensure you have the following:\n\n- Terraform: Installed on your local machine.\n- DigitalOcean Account: Access to create Droplets and manage resources.\n- DigitalOcean API Token: Generate a personal access token from your DigitalOcean account.\n- Account approved for GPU usage: Ensure your account is approved for GPU usage on DigitalOcean. Contact support if you need to enable GPU access.\n\n## Cloud-Init Script\n\nThe `cloud-init.yaml` script is used to automate the initial configuration of the Droplet. It performs the following actions:\n\n- Updates and upgrades existing packages\n- Installs essential packages: htop, tar, git, wget, curl, nano, unzip, and nvtop\n- Downloads and installs btop for resource monitoring. (which inlcudes the option to monitor GPU usage)\n- Optional: Uncomment lines to install ollama and pull llama3.3 for inferencing\n\n## Firewall Configuration\n\nThe `firewall.tf` file configures the DigitalOcean firewall to restrict access to the Droplet. By default, only the IP addresses specified in the `allowed_ips` variable are allowed to access all ports on the Droplet.\n\n## Variables\n\nThe following table outlines the variables in the `terraform.tfvars` file used in this project:\n\n| Variable             | Description                                           | Type   | Default                  | Required |\n|----------------------|-------------------------------------------------------|--------|--------------------------|----------|\n| `do_token`           | DigitalOcean API token                                | string |                          | yes      |\n| `project_name`       | Name of the project where Droplet will be created     | string | `gpu-terraform`          | yes      |\n| `droplet_name`       | Name of the Droplet                                   | string | `gpu-droplet`            | no       |\n| `region`             | Region to deploy the Droplet                          | string | `nyc2`                   | no       |\n| `size`               | Droplet size slug                                     | string | `gpu-h100x1-80gb`        | no       |\n| `image`              | Droplet image slug                                    | string | `gpu-h100x1-base`        | no       |\n| `ssh_key_name`       | Name for the SSH key                                  | string | `my-custom-key`          | no       |\n| `allowed_ips`        | List of IPs allowed to access all ports               | list   | `[\"192.0.2.1/32\"]`       | no       |\n| `enable_destroy_cron`| Enable or disable the creation of the delete cronjob  | bool   | `false`                  | no       |\n| `destroy_after_minutes`| Time in minutes before the Droplet is destroyed     | number | `60`                     | no       |\n\nNote: Replace the default values with your specific configurations as needed. Also, uncomment the lines for `enabled_destroy_cron` and `destroy_after_minutes` if you wish to enable the automatic deletion of the Droplet. This only works on Linux systems.\n\n## Usage\n\n1. Clone the repository and navigate to the project directory\n2. Copy the `terraform.tfvars.example` file to `terraform.tfvars` and update the variables with your configurations.\n3. Initialize Terraform: Run `terraform init` to initialize the project and download necessary providers.\n4. Plan the Deployment: Execute `terraform plan` to review the resources that will be created.\n5. Apply the Configuration: Run `terraform apply` to create the Droplet and associated resources.\n6. Access the Droplet: Use the provided SSH command output to connect to your Droplet.\n\n## Outputs\n\nAfter applying the configuration, Terraform will provide the following outputs:\n\n- id_rsa: The private SSH key for connecting to the Droplet.\n- id_rsa.pub: The public SSH key for connecting to the Droplet.\n- ssh_command: The SSH command to connect to the Droplet.\n\n## Security Considerations\n\n- Ensure that your do_token is kept secure and not exposed in version control systems.\n- Only include trusted IP addresses in the allowed_ips variable to maintain security.\n\n## Cleanup\n\nTo destroy the resources created by this project, run:\n\n`terraform destroy`\n\nThis command will remove all resources defined in your Terraform configuration.\n\nOr, if you enabled the destroy cronjob, the Droplet will be automatically deleted at the specified time. (Linux support only)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjtechguy%2Fdo-gpu-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjtechguy%2Fdo-gpu-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjtechguy%2Fdo-gpu-terraform/lists"}