Thetaform is a Terraform provider for Theta EdgeCloud. It lets you manage your Theta Network infrastructure as code using Terraform configuration files, bringing standard DevOps enterprise best practices to the Theta distributed compute network.
Here is a Theta Hackathon 2024 submission page on DevPost deatailing the project: https://devpost.com/software/thetaform
Check out the landing page for more info: https://thetaform.cloud
Watch a 5-minute walthrough of basic Thetaform usage:
- Infrastructure as Code: Define and provision your Theta EdgeCloud resources using Terraform configuration files.
- Automation: Use Terraform’s automation capabilities to manage, update, and destroy your Theta Network infrastructure.
- Consistency: Ensure consistent deployment and management of your Theta infrastructure across different environments.
- Terraform: You need Terraform installed on your local machine -> Install Terraform.
- Golang: Install Golang compiler, since you'll need to build Thetaform locally -> Install Golang.
Quick way (if running Ubuntu): use the script local_setup.sh in the root of this repo.
Before executing it make sure to set the $ARCH variable to your system architecture "arm64/amd64" and insert your Theta account credentials.
Executing the script will install Terraform, Golang, clone the repo, configure the provider for local running, and execute "terraform apply" once.
If you with to skip some steps or you are not running Ubuntu, please follow steps bellow.
-
Clone the Repository
git clone https://github.com/igorperic17/thetaform.git cd thetaform
-
Configure Terraform for local provider install
Since Thetaform is (yet!) not a part of the official HashiCorp set of providers, you will have to "trick" Terrafrom to look for a provider named "theta" in a custom path on your system, namely ~/go/bin. To do that, you'll have to add this content to your ~/.terraformrc file:
provider_installation {
dev_overrides {
"hashicorp.com/edu/theta" = "~/go/bin"
}
direct {}
}
The path does not support "~", so make sure to provide absolute path (/User/<username> on Mac or /home/<username> on Linux).
- Configure Theta account credential
Create a file "local.tfvars" in the root of the repo with the following content:
email = "<your_theta_account_email>"
password = "<your_theta_account_password>"
hf_token = "<your_hf_token>"
Make sure you leave the quotes in when replacing placeholders.
- Deploy
Technically you are ready to deploy, the only caveat is your provider is not built!
To do that you would have to run
go mod tidy
go install .
This will build and install Thetaform provider into ~/go/bin, after which you are ready to run
terraform apply --var-file=local.tfvars
If everything went well you should see the link to your new IPython Notebook at the end of the successful deployment in your terminal.
There are 4 example Terraform configuration files in the root of the repo, out of which the first three have .txt extension to prevent Terraform to apply all of them and cause conflicts. If you wish to test out other files or write your own, be aware that Terraform will apply ALL of the *.tf files in the current working directory.
- Organizations and Projects have only data (read-only) resources
- Video resource is not yet implemented
We welcome contributions to Thetaform! If you have any improvements or bug fixes, please submit a pull request or open an issue.
Thetaform is licensed under the MIT License.
For any questions or support, please contact me at igorperic@live.com.