Talis is a multi-cloud infrastructure provisioning and configuration project that uses:
- Direct Cloud Provider APIs to create and manage cloud instances
- Ansible for initial system configuration and package installation
- Multi-cloud: With a single codebase, you can choose which cloud provider to use (currently supporting DigitalOcean, with more providers coming soon)
- Direct API Integration: Uses cloud provider APIs directly for better control and reliability
- Ansible: Provides initial system configuration and package installation
- Extensive Testing: Comprehensive test coverage for all cloud provider operations
- Go (1.24 or higher)
- Ansible (2.9 or higher)
- SSH key pair for instance access
- Cloud Credentials:
- For DigitalOcean: Personal Access Token in
DIGITALOCEAN_TOKEN
environment variable - For Linode: Coming soon
- For Vultr: Coming soon
- For DataPacket: Coming soon
- For DigitalOcean: Personal Access Token in
See architecture doc
- Copy
.env.example
to.env
:
cp .env.example .env
- Configure environment variables:
# DigitalOcean
DIGITALOCEAN_TOKEN=your_digitalocean_token_here
- Ensure your SSH key is available:
# The default path is ~/.ssh/id_rsa
# You can specify a different path in the request
# Build the CLI
make build-cli
# Create a project
./bin/talis-cli project create -n my-project
# Copy and modify the example create configuration
cp create.json_example create.json
# Create infrastructure using your configuration
./bin/talis-cli infra create -f create.json
# A delete.json file will be automatically generated after successful creation
# Delete infrastructure using the auto-generated file
./bin/talis-cli infra delete -f delete.json
{
"instance_name": "talis",
"project_name": "talis-test",
"instances": [
{
"provider": "do",
"number_of_instances": 1,
"provision": true,
"region": "nyc3",
"size": "s-1vcpu-1gb",
"image": "ubuntu-22-04-x64",
"tags": ["talis-do-instance"],
"ssh_key_name": "your-ssh-key-name",
"volumes": [
{
"name": "talis-volume",
"size_gb": 15,
"mount_point": "/mnt/data"
}
]
},
{
"provider": "do",
"name": "talis-validator",
"number_of_instances": 1,
"provision": true,
"region": "nyc3",
"size": "s-2vcpu-2gb",
"image": "ubuntu-22-04-x64",
"tags": ["talis-validator"],
"ssh_key_name": "your-ssh-key-name",
"volumes": [
{
"name": "talis-volume",
"size_gb": 15,
"mount_point": "/mnt/data"
}
]
}
]
}
The delete configuration will be automatically generated after a successful creation. It will include all necessary information to delete the created resources:
The instance_name
field is used as a base name for instances. Each instance gets a suffix that is incremented starting from 0 (e.g., "talis-0"). Individual instances can have custom names by specifying the name
field in the instance object, as shown in the example above with "talis-validator".
Example configuration (delete.json_example):
This file is automatically generated after a successful creation. It contains all the information needed to delete the created resources:
{
"id": 10,
"instance_name": "talis",
"project_name": "talis-test",
"instances": [
{
"provider": "do",
"number_of_instances": 1,
"region": "nyc3"
},
{
"provider": "do",
"name": "talis-validator",
"region": "nyc3"
}
]
}
When deleting instances, you can specify which instances to delete by providing the name
field in the instance object. If no specific names are provided, instances are deleted in FIFO order (oldest first).
- Create new file in
internal/compute/
(e.g.,aws.go
) - Implement the
ComputeProvider
interface:type ComputeProvider interface { ValidateCredentials() error GetEnvironmentVars() map[string]string ConfigureProvider(stack interface{}) error CreateInstance(ctx context.Context, name string, config InstanceConfig) ([]InstanceInfo, error) DeleteInstance(ctx context.Context, name string, region string) error }
- Add the provider in
NewComputeProvider
inprovider.go
- Add comprehensive tests following the pattern in
digitalocean_test.go
Modify files in ansible/
:
main.yml
: Main Ansible configurationstages/setup.yml
: Initial system setup and configurationvars/main.yml
: Variable definitions- Add new stages in
ansible/stages/
for additional configurations
- AWS provider implementation
- Linode provider implementation
- Vultr provider implementation
- DataPacket provider implementation
- Webhook notification system
- Enhanced job management and monitoring
- 100 Light Nodes deployment support
# Run all tests
make test
# Run tests with coverage
make test-coverage
# Run specific tests
go test ./internal/compute -run TestDigitalOceanProvider
The project uses:
- golangci-lint for code quality
- go test for unit and integration testing
- yamllint for YAML file validation
Run the linters:
make lint