Skip to content

Commit d58328e

Browse files
committed
docs: Update README with comprehensive installation, configuration, and usage instructions
1 parent 72a38b4 commit d58328e

File tree

1 file changed

+150
-54
lines changed

1 file changed

+150
-54
lines changed

README.md

+150-54
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,75 @@ Andaime (Poruguese for "scaffolding", pronounced An-Dye-Me) is a command-line to
66

77
## Prerequisites
88

9-
- Go 1.16 or later
10-
- AWS CLI configured with appropriate credentials
11-
- AWS SDK for Go
9+
- Go 1.21 or later
10+
- Cloud Provider CLI (AWS, GCP) configured with appropriate credentials
11+
- Just task runner (recommended)
1212

1313
## Installation and Building
1414

15-
Clone the repository:
15+
### Prerequisites Installation
1616

17+
1. Install Go (1.21+):
1718
```bash
18-
git clone https://github.com/bacalhau-project/andaime.git
19-
cd andaime
19+
# macOS (using Homebrew)
20+
brew install go
21+
22+
# Linux
23+
# Follow official Go installation guide: https://golang.org/doc/install
2024
```
2125

22-
You can build the project with the Go compiler:
26+
2. Install Just task runner:
2327
```bash
24-
go build ./...
28+
# macOS
29+
brew install just
30+
31+
# Linux
32+
# https://github.com/casey/just#installation
2533
```
2634

27-
or, using the `makefile`
35+
### Repository Setup
2836

37+
Clone the repository:
2938
```bash
30-
make build
39+
git clone https://github.com/bacalhau-project/andaime.git
40+
cd andaime
3141
```
3242

33-
If you wish to build for all supported platforms (Linux and macOS on `arm64` and `amd64` arch), you can run the following:
43+
### Building the Project
44+
45+
You have multiple build options:
3446

47+
#### Quick Build
3548
```bash
36-
make release
49+
# Using Go directly
50+
go build ./cmd/andaime
51+
52+
# Using Just (recommended)
53+
just build
3754
```
3855

39-
This will build and tarball Andaime for all of the aforementioned targets in a `./releases` directory with the filenames of `andaime-${OS}-${ARCHITECTURE}.tar.gz`.
56+
#### Multi-Platform Release Build
57+
```bash
58+
# Build release artifacts for Linux, macOS (Intel and Apple Silicon)
59+
just build-release
60+
```
61+
62+
This will create platform-specific binaries in the `dist/` directory:
63+
- `andaime_linux_amd64`
64+
- `andaime_darwin_amd64`
65+
- `andaime_darwin_arm64`
66+
- `andaime_windows_amd64.exe`
67+
68+
### Development Tools
69+
70+
For development, install additional tools:
71+
```bash
72+
# Generate mocks
73+
just genmock
74+
75+
# Generate cloud data
76+
just gencloud
77+
```
4078

4179
## Usage
4280
Commands
@@ -64,66 +102,124 @@ Options
64102
--verbose: Enable verbose logging.
65103
```
66104

67-
## Configuration
68-
You can configure the script using a config.json file in the root directory. The following parameters can be set:
105+
## Configuration and Customization
69106

70-
```
71-
PROJECT_NAME
72-
TARGET_PLATFORM
73-
NUMBER_OF_ORCHESTRATOR_NODES
74-
NUMBER_OF_COMPUTE_NODES
107+
Andaime supports multiple configuration methods to suit different workflows:
75108

76-
```
109+
### 1. Configuration File (config.json)
110+
Create a `config.json` in the project root:
77111

78-
Example config.json:
79112
```json
80113
{
81-
"PROJECT_NAME": "bacalhau-by-andaime",
82-
"TARGET_PLATFORM": "aws",
83-
"NUMBER_OF_ORCHESTRATOR_NODES": 1,
84-
"NUMBER_OF_COMPUTE_NODES": 2
114+
"PROJECT_NAME": "bacalhau-cluster",
115+
"TARGET_PLATFORM": ["aws", "gcp"],
116+
"ORCHESTRATOR_NODES": {
117+
"count": 1,
118+
"instance_type": "t3.medium"
119+
},
120+
"COMPUTE_NODES": {
121+
"count": 3,
122+
"instance_type": "c5.large"
123+
},
124+
"REGIONS": ["us-east-1", "us-west-2", "eu-west-1"]
85125
}
86126
```
87-
## Environment Variables
88-
You can also configure the script using environment variables:
89127

90-
```
91-
PROJECT_NAME
92-
TARGET_PLATFORM
93-
NUMBER_OF_ORCHESTRATOR_NODES
94-
NUMBER_OF_COMPUTE_NODES
95-
AWS_ACCESS_KEY_ID
96-
AWS_SECRET_ACCESS_KEY
97-
```
98-
Example:
128+
### 2. Environment Variables
129+
Override or supplement configuration via environment variables:
99130

100131
```bash
101-
export PROJECT_NAME="bacalhau-by-andaime"
102-
export TARGET_PLATFORM="aws"
103-
export NUMBER_OF_ORCHESTRATOR_NODES=1
104-
export NUMBER_OF_COMPUTE_NODES=2
132+
# Cloud Provider Credentials
133+
export AWS_ACCESS_KEY_ID=your_aws_key
134+
export AWS_SECRET_ACCESS_KEY=your_aws_secret
135+
export GCP_PROJECT_ID=your_gcp_project
136+
137+
# Cluster Configuration
138+
export ANDAIME_PROJECT_NAME="my-bacalhau-cluster"
139+
export ANDAIME_TARGET_PLATFORM="aws"
140+
export ANDAIME_ORCHESTRATOR_NODES=1
141+
export ANDAIME_COMPUTE_NODES=3
105142
```
106143

107-
## Examples
144+
### 3. CLI Flags
145+
Direct CLI configuration for maximum flexibility:
108146

109-
#### Create Resources
110147
```bash
111-
# Create a new network
112-
./andaime create --target-regions "us-east-1,us-west-2" --compute-nodes 3 --orchestrator-nodes=1
148+
# Specify configuration directly
149+
andaime create \
150+
--project-name "bacalhau-cluster" \
151+
--target-platform aws \
152+
--orchestrator-nodes 1 \
153+
--compute-nodes 3 \
154+
--instance-type t3.medium \
155+
--target-regions us-east-1,us-west-2
156+
```
113157

114-
# Create nodes and add them to an existing orchestrator
115-
./andaime create --aws-profile="expanso" --target-regions="us-east-1,us-west-2,eu-west-1,eu-west-2,eu-west-3,ap-southeast-1,ap-southeast-2,sa-east-1,ca-central-1,eu-north-1" --compute-nodes=20 --orchestrator-ip=<ORCHESTRATOR_IP_ADDRESS>
158+
### Configuration Precedence
159+
Andaime resolves configuration in this order:
160+
1. CLI Flags (Highest Priority)
161+
2. Environment Variables
162+
3. Configuration File
163+
4. Default Values
164+
165+
### Supported Cloud Providers
166+
- AWS (Primary)
167+
- GCP (Beta)
168+
- More providers planned
169+
170+
## Workflow Examples
171+
172+
### 1. Basic AWS Cluster Creation
173+
```bash
174+
# Create a simple Bacalhau cluster in us-east-1
175+
andaime create \
176+
--target-platform aws \
177+
--target-regions us-east-1 \
178+
--compute-nodes 3 \
179+
--orchestrator-nodes 1
180+
```
116181

117-
# Create a single node of a specific type, and add them to an orchestrator using environment variables to authenticate with AWS
118-
AWS_ACCESS_KEY_ID=<YOUR_KEY_ID> AWS_SECRET_ACCESS_KEY=<YOUR_ACCESS_KEY> ./andaime --target-regions="us-east-1" --compute-nodes=1 --instance-type="t2.large" --orchestrator-ip=<ORCHESTRATOR_IP_ADDRESS>
182+
### 2. Multi-Region GCP Deployment
183+
```bash
184+
# Deploy a cluster across multiple GCP regions
185+
andaime create \
186+
--target-platform gcp \
187+
--target-regions us-central1,us-west1,europe-west3 \
188+
--compute-nodes 5 \
189+
--orchestrator-nodes 2 \
190+
--instance-type n2-standard-4
191+
```
119192

193+
### 3. Existing Orchestrator Expansion
194+
```bash
195+
# Add compute nodes to an existing orchestrator
196+
andaime create \
197+
--orchestrator-ip 203.0.113.10 \
198+
--compute-nodes 10 \
199+
--target-regions us-east-1,us-west-2
120200
```
121201

122-
#### List Resources
202+
### 4. Resource Management
123203
```bash
124-
./andaime list
204+
# List current Andaime-managed resources
205+
andaime list
206+
207+
# Destroy all resources for the current project
208+
andaime destroy
125209
```
126-
#### Destroy Resources
210+
211+
### 5. Advanced Configuration
127212
```bash
128-
./andaime destroy
129-
```
213+
# Use a specific AWS profile and custom configuration
214+
AWS_PROFILE=my-bacalhau-profile \
215+
andaime create \
216+
--config-file custom_config.json \
217+
--verbose
218+
```
219+
220+
## Troubleshooting
221+
222+
- Ensure cloud provider credentials are correctly configured
223+
- Check network connectivity and firewall rules
224+
- Use `--verbose` flag for detailed logging
225+
- Consult documentation for provider-specific requirements

0 commit comments

Comments
 (0)