truffle

command module
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 1 Imported by: 0

README

truffle

CI Go Report Card codecov Go Reference

Find EC2 instance types, compare spot prices, check quotas.

All discovery commands require AWS credentials (configured via aws configure, environment variables, or IAM role). Only truffle app list and truffle version work without credentials.

Installation

macOS / Linux (Homebrew)

brew install spore-host/tap/truffle

Windows (Scoop)

scoop bucket add spore-host https://github.com/spore-host/scoop-bucket
scoop install truffle

Debian / Ubuntu

curl -LO https://github.com/spore-host/truffle/releases/latest/download/truffle_linux_amd64.deb
sudo dpkg -i truffle_linux_amd64.deb

RHEL / Fedora

sudo rpm -i https://github.com/spore-host/truffle/releases/latest/download/truffle_linux_amd64.rpm

Direct download — pre-built binaries for Linux, macOS, and Windows (amd64/arm64) on the releases page.

Build from source

git clone https://github.com/spore-host/truffle
cd truffle && make build && sudo make install

Quick Start

# Search instance types (glob or regex)
truffle search "m7i*"                         # glob: all m7i sizes
truffle search "c[6-8]i\.large"               # regex: c6i/c7i/c8i large

# Compare spot prices
truffle spot m7i.large --regions us-east-1 --show-savings
truffle spot "c6a*" --sort-by-price --lookback-hours 24

# Find by natural language
truffle find "h200 8gpu efa"
truffle find "amd turin 32 cores 64gb" --exact
truffle find graviton --regions us-east-1

# Check EC2 quotas
truffle quotas --regions us-east-1 --family P
truffle quotas --regions us-east-1 -o json

# Check SageMaker quotas
truffle quotas --service sagemaker --family g5 --regions us-west-2

# Discover SageMaker ml.* instance types (specs, pricing, managed-spot eligibility)
truffle find "ml.g5.*" --service sagemaker --regions us-east-1
truffle find "ml.g5.*" --service sagemaker --show-quota --regions us-east-1

# Find available capacity reservations
truffle capacity --gpu-only

# Output formats (all commands)
truffle search "m7i*" -o json
truffle find "intel 8 vcpu" -o csv

Commands

Command Description
search <pattern> Search by glob (m7i*) or regex (c[6-8]i\.large); --service sagemaker for ml.* types
find <query> Natural language search (amd epyc 32 cores 64gb); --service sagemaker for ml.* types
spot <pattern> Spot pricing with savings vs on-demand
az <pattern> AZ-first availability view
capacity On-demand capacity reservations (ODCRs)
capacity-blocks Discover purchasable EC2 Capacity Block for ML offerings
list List instance families or sizes
quotas EC2 and SageMaker service quotas
app list Browse application catalog (no credentials needed)
version Show version, build info, and project URL
Global Flags
Flag Description
-o, --output Output format: table, json, yaml, csv
-r, --regions Filter by regions (comma-separated)
--no-emoji Disable emoji in output
--no-color Disable colorized output
--lang Language: en, es, fr, de, ja, pt

Go Library

import "github.com/spore-host/truffle/pkg/aws"

client, _ := aws.NewClient(ctx)
results, _ := client.SearchInstanceTypes(ctx, regions, matcher, opts)

// On-demand rate for one type (live AWS Price List, cached)
rate, _ := client.HourlyRate(ctx, "c6i.4xlarge", "us-east-1", "on-demand")

// Spot prices with on-demand comparison populated
prices, _ := client.GetSpotPricing(ctx, results, aws.SpotOptions{ShowSavings: true})
Testing with awsmock

The aws.Finder interface allows downstream projects to mock truffle's discovery layer:

import (
    "github.com/spore-host/truffle/pkg/aws"
    "github.com/spore-host/truffle/pkg/aws/awsmock"
)

mock := awsmock.New(
    awsmock.WithRegions([]string{"us-east-1"}),
    awsmock.WithInstances([]aws.InstanceTypeResult{
        {InstanceType: "m7i.large", Region: "us-east-1", VCPUs: 2, MemoryMiB: 8192},
    }),
    awsmock.WithOnDemandPrices(map[string]float64{"m7i.large/us-east-1": 0.1008}),
)
// Use mock anywhere an aws.Finder is accepted.

Python

Use the spore-host SDK (pip install spore-host) for Python access — spore.truffle.find(...) wraps truffle's discovery via the hosted REST API.

(An earlier native-CGO binding experiment was never completed; its design notes live in docs/design/native-cgo-binding/ — not an installable package. See truffle#76.)

Documentation

Full reference at spore.host/docs.

License

Apache 2.0 — Copyright 2025-2026 Scott Friedman.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
aws
Package aws provides EC2 capacity discovery for the truffle tool.
Package aws provides EC2 capacity discovery for the truffle tool.
aws/awsmock
Package awsmock provides a configurable mock implementation of aws.Finder for unit testing downstream consumers of truffle's instance discovery API.
Package awsmock provides a configurable mock implementation of aws.Finder for unit testing downstream consumers of truffle's instance discovery API.
find
Package find implements the natural language EC2 instance search pipeline used by the truffle tool.
Package find implements the natural language EC2 instance search pipeline used by the truffle tool.
quotas
Package quotas queries AWS Service Quotas and current EC2 usage to determine whether a given instance type can be launched under an account's limits.
Package quotas queries AWS Service Quotas and current EC2 usage to determine whether a given instance type can be launched under an account's limits.
testutil
Package testutil provides shared test helpers for truffle packages.
Package testutil provides shared test helpers for truffle packages.

Jump to

Keyboard shortcuts

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