You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+89-19Lines changed: 89 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,29 +268,99 @@ To build just the installer image
268
268
./earthly.sh +iso --ARCH=amd64
269
269
```
270
270
271
-
To build public cloud images(currently only aws is supported)
272
-
aws cloud credentials should be passed in the `.secret` file on the repo dir
273
-
example:
274
-
```shell
275
-
/workspace/spectrocloud/CanvOS$ cat .secret
276
-
AWS_PROFILE=""
277
-
AWS_ACCESS_KEY_ID="xxxxxx"
278
-
AWS_SECRET_ACCESS_KEY="xxxxxxx"
279
-
```
280
-
Also region and bucket details need to be passed in .arg file
281
-
```shell
282
-
#aws cloud
283
-
REGION="us-east-1"
284
-
S3_BUCKET="test-bkp"
285
-
S3_KEY=""
286
-
```
287
-
user-data should be kept under `cloud-images/config/user-data.yaml`
271
+
### Building AWS Cloud Images
272
+
273
+
CanvOS can build Amazon Machine Images (AMIs) for AWS EC2 deployment. The build process converts the raw disk image into an AMI that can be launched directly in AWS.
274
+
275
+
#### Prerequisites
276
+
277
+
1.**AWS Credentials**: Configure AWS credentials in the `.secret` file in the repo directory.
278
+
279
+
**Option 1: Using AWS Profile (Recommended)**
280
+
```shell
281
+
AWS_PROFILE="production"
282
+
```
283
+
284
+
**Option 2: Using Access Keys**
285
+
```shell
286
+
AWS_PROFILE=""
287
+
AWS_ACCESS_KEY_ID="ACCESS_EXAMPLE_KEY"
288
+
AWS_SECRET_ACCESS_KEY="SECRET_EXAMPLE_KEY"
289
+
```
290
+
291
+
2.**AWS Configuration**: Add the following to your `.arg` file:
292
+
```shell
293
+
# AWS Cloud Image Configuration
294
+
REGION="us-east-1"
295
+
S3_BUCKET="my-canvos-images"
296
+
S3_KEY=""# Optional: defaults to raw file name if not set
297
+
```
298
+
299
+
3.**User Data Configuration**: Create or update `user-data` in the CanvOS root directory with your cloud-init configuration:
300
+
```yaml
301
+
#cloud-config
302
+
install:
303
+
device: /dev/sda
304
+
reboot: true
305
+
poweroff: false
306
+
stylus:
307
+
debug: true
308
+
site:
309
+
paletteEndpoint: xxxx.spectrocloud.com
310
+
autoRegister: true
311
+
edgeHostToken: xxxxxxxxxxx
312
+
insecureSkipVerify: false
313
+
```
314
+
315
+
#### Building the AWS Cloud Image
316
+
317
+
Run the following command to build the AWS cloud image:
288
318
289
-
To build AWS cloud image:
290
319
```shell
291
-
./earthly.sh -P +aws-cloud-image --ARCH=amd64
320
+
earthly -P +aws-cloud-image --ARCH=amd64
292
321
```
293
322
323
+
The `-P` flag enables privileged mode (required for Docker-in-Docker operations).
324
+
325
+
#### Build Process
326
+
327
+
The AWS cloud image build consists of two steps:
328
+
329
+
1.**Step 1**: Builds the cloud image (raw disk image) using auroraboot
330
+
- Creates a raw disk image from the installer image
331
+
- Includes user-data configuration
332
+
- Supports content bundles and cluster configs
333
+
334
+
2.**Step 2**: Converts raw image to AMI
335
+
- Uploads raw image to S3 bucket
336
+
- Imports snapshot from S3
337
+
- Registers AMI in EC2
338
+
- Returns AMI ID upon completion
339
+
340
+
#### Output
341
+
342
+
After a successful build, the AMI will be registered in your AWS account. The build output will display:
343
+
- AMI ID (e.g., `ami-0123456789abcdef0`)
344
+
- AMI Name (based on `S3_KEY` or auto-generated)
345
+
- Snapshot ID (created during import)
346
+
347
+
#### IAM Permissions Required
348
+
349
+
The AWS credentials must have the following permissions:
350
+
-`s3:PutObject`, `s3:GetObject`, `s3:ListBucket` on the S3 bucket
0 commit comments