talis

module
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2025 License: Apache-2.0

README

Talis 🦍

Talis is a multi-cloud infrastructure provisioning and configuration project that uses:

  • Hypervisor (VitFusion) API to create and manage cloud instances
  • Ansible for initial system configuration and package installation

Overview

  • Multi-cloud: With a single codebase, you can choose which cloud provider to use (currently supporting DigitalOcean, with more providers coming soon) (This is done through the hypervisor API)
  • Ansible: Provides initial system configuration and package installation
  • Extensive Testing: Comprehensive test coverage for all cloud provider operations

Requirements

  • Go (1.24 or higher)
  • Ansible (2.9 or higher)
  • SSH key pair for instance access
  • Cloud Credentials: (To Be Updated for Hypervisor API)

Project Structure

See architecture doc

Setup

  1. Copy .env.example to .env:
cp .env.example .env
  1. Add your DigitalOcean Personal Access Token to the .env file:
echo "DIGITALOCEAN_TOKEN=your_digitalocean_token_here" >> .env

Alternatively, you can set it as an environment variable directly.

  1. Ensure your SSH key is available:
# The default path is ~/.ssh/id_rsa
# You can specify a different path in the request

Usage

Using the CLI

If this is your first time using talis you will need to initialize a user and a project.

# Create a user
make run-cli ARGS="users create --username my-user"

# Create a project
make run-cli ARGS="projects create --name my-project --owner-id <user-id>"

Now you can create a configuration file and use it to create infrastructure.

# Copy and modify the example create configuration
cp create.json_example create.json

# Create infrastructure using your configuration
make run-cli ARGS="infra create --file create.json"
# A delete file (e.g., delete_create.json if your input file was create.json) will be automatically generated after successful creation

# Delete infrastructure using the auto-generated file
make run-cli ARGS="infra delete --file delete.json"
Example Configuration Files

See the create.json_example and delete.json_example files for more information.

Using the Go API Client

For programmatic access to the Talis API using Go, refer to the Go API Client Usage documentation.

Extensibility

Adding New Providers

TODO: add documentation for hypervisor API

Customizing Ansible

Modify files in ansible/:

  • main.yml: Main Ansible configuration
  • stages/setup.yml: Initial system setup and configuration
  • vars/main.yml: Variable definitions
  • Add new stages in ansible/stages/ for additional configurations

Upcoming Features

  • 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

Development

Running Tests
# Run all tests
make test
Code Quality

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

Directories

Path Synopsis
cmd
Package main provides the entry point for the server application @title Talis API @version 1.0 @description API for Talis - Web3 infrastructure management service @host localhost:8080 @BasePath /api/v1
Package main provides the entry point for the server application @title Talis API @version 1.0 @description API for Talis - Web3 infrastructure management service @host localhost:8080 @BasePath /api/v1
cli command
Package main provides the entry point for the CLI application
Package main provides the entry point for the CLI application
cli/commands
Package commands implements the CLI commands for the application
Package commands implements the CLI commands for the application
docs
swagger
Package swagger Code generated by swaggo/swag at 2025-05-16 15:12:50.571981 +0200 CEST m=+0.961850126.
Package swagger Code generated by swaggo/swag at 2025-05-16 15:12:50.571981 +0200 CEST m=+0.961850126.
internal
compute
Package compute provides infrastructure provider implementations.
Package compute provides infrastructure provider implementations.
compute/types
Package types provides interface definitions for compute providers
Package types provides interface definitions for compute providers
db
Package db provides database connectivity and operations
Package db provides database connectivity and operations
db/models
Package models contains database models and related utility functions
Package models contains database models and related utility functions
db/repos
Package repos provides repository implementations for database operations
Package repos provides repository implementations for database operations
logger
Package logger provides structured logging functionality for the application
Package logger provides structured logging functionality for the application
services
Package services provides business logic implementation for the API
Package services provides business logic implementation for the API
types
Package types provides type definitions for the application
Package types provides type definitions for the application
validation
Package validation provides validation functions for various parts of the application
Package validation provides validation functions for various parts of the application
pkg
api/v1/client
Package client provides a comprehensive API client for interacting with the Talis API.
Package client provides a comprehensive API client for interacting with the Talis API.
api/v1/handlers
Package handlers provides HTTP request handling
Package handlers provides HTTP request handling
api/v1/routes
Package routes defines the API routes and URL structure
Package routes defines the API routes and URL structure
db/models
Package models contains PUBLIC aliases for database models and related types.
Package models contains PUBLIC aliases for database models and related types.
types
Package types contains PUBLIC aliases for internal request/response structs.
Package types contains PUBLIC aliases for internal request/response structs.
Package test provides utilities for setting up and running tests
Package test provides utilities for setting up and running tests
mocks
Package mocks provides mock implementations for external services and APIs used in testing
Package mocks provides mock implementations for external services and APIs used in testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL