Skip to content

Commit 6a233ca

Browse files
dragarciadarora
authored andcommitted
chore: first pass at adding details to the docs
1 parent fc741e2 commit 6a233ca

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

qemu_artifact.md

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,56 @@ Given the size of the image, the first VM using it on a node might take a while
1010

1111
## Creating a bare-metal instance
1212

13-
We launch an Ubuntu 22 bare-metal instance; we're using the `c6g.metal` instance type in this case, but any ARM instance type is sufficient for our purposes.
13+
We launch an Ubuntu 22 bare-metal instance; we're using the `c6g.metal` instance type in this case, but any ARM instance type is sufficient for our purposes. In the example below the region used is: `ap-south-1`.
1414

15-
aws ec2 create-security-group --group-name "launch-wizard-1" --description "launch-wizard-1 created 2024-11-26T00:32:56.039Z" --vpc-id "vpc-0fbfcc428751ce76b"
16-
aws ec2 authorize-security-group-ingress --group-id "sg-preview-1" --ip-permissions '{"IpProtocol":"tcp","FromPort":22,"ToPort":22,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}'
17-
aws ec2 run-instances --image-id "ami-0a87daabd88e93b1f" --instance-type "c6g.metal" --key-name "darora-aps1" --block-device-mappings '{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":false,"DeleteOnTermination":true,"Iops":3000,"SnapshotId":"snap-0fe84a34403e3da8b","VolumeSize":200,"VolumeType":"gp3","Throughput":125}}' --network-interfaces '{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Groups":["sg-preview-1"]}' --tag-specifications '{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"darora-pg-image"}]}' --metadata-options '{"HttpEndpoint":"enabled","HttpPutResponseHopLimit":2,"HttpTokens":"required"}' --private-dns-name-options '{"HostnameType":"ip-name","EnableResourceNameDnsARecord":true,"EnableResourceNameDnsAAAARecord":false}' --count "1"
15+
```bash
1816

17+
aws ec2 create-security-group --group-name "launch-wizard-1" --description "launch-wizard-1 created 2024-11-26T00:32:56.039Z" --vpc-id "insert-vpc-id"
18+
19+
aws ec2 authorize-security-group-ingress --group-id "insert-sg-group" --ip-permissions '{"IpProtocol":"tcp","FromPort":22,"ToPort":22,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}'
20+
21+
aws ec2 run-instances \
22+
--image-id "ami-0a87daabd88e93b1f" \
23+
--instance-type "c6g.metal" \
24+
--key-name "insert-key-pair" \
25+
--block-device-mappings '{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":false,"DeleteOnTermination":true,"Iops":3000,"SnapshotId":"snap-0fe84a34403e3da8b","VolumeSize":200,"VolumeType":"gp3","Throughput":125}}' \
26+
--network-interfaces '{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Groups":["insert-sg-group"]}' \
27+
--tag-specifications '{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"qemu-pg-image"}]}' \
28+
--metadata-options '{"HttpEndpoint":"enabled","HttpPutResponseHopLimit":2,"HttpTokens":"required"}' \
29+
--private-dns-name-options '{"HostnameType":"ip-name","EnableResourceNameDnsARecord":true,"EnableResourceNameDnsAAAARecord":false}' \
30+
--count "1"
31+
32+
```
1933
## Install deps
2034

2135
On the instance, install the dependencies we require for producing QEMU artifacts:
2236

23-
sudo apt-get update
24-
sudo apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli
25-
sudo usermod -aG kvm ubuntu
26-
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
27-
sudo apt-add-repository "deb [arch=arm64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
28-
sudo apt-get update && sudo apt-get install packer=1.11.2-1
29-
sudo apt-get install -y docker.io
30-
37+
```bash
38+
sudo apt-get update
39+
sudo apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli
40+
sudo usermod -aG kvm ubuntu
41+
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
42+
sudo apt-add-repository "deb [arch=arm64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
43+
sudo apt-get update && sudo apt-get install packer=1.11.2-1
44+
sudo apt-get install -y docker.io
45+
```
3146

3247
Some dev deps that might be useful:
3348

34-
sudo apt-get install -y emacs ripgrep vim-tiny byobu
35-
49+
```bash
50+
sudo apt-get install -y emacs ripgrep vim-tiny byobu
51+
```
3652

3753
## Clone repo and build
3854

3955
Logout/login first to pick up new group memberships!
4056

41-
git clone https://github.com/supabase/postgres.git
42-
cd postgres
43-
git checkout da/qemu-rebasing # choose appropriate branch here
44-
make init container-disk-image
57+
``` bash
58+
git clone https://github.com/supabase/postgres.git
59+
cd postgres
60+
git checkout da/qemu-rebasing # choose appropriate branch here
61+
make init container-disk-image
62+
```
4563

4664
### Build process
4765

@@ -67,8 +85,7 @@ b. packer build (`qemu-arm64-nix.pkr.hcl`)
6785

6886
## Publish image for later use
6987

70-
Publish the built image to a registry of your choosing, and use the published image with KubeVirt.
71-
88+
Following `make init container-disk-image`, the generated image should be found in: `/path/to/postgres/output-cloudimg`. For portability the image is also bundled up as a docker image with the name: `supabase-postgres-test` . Publish the built docker image to a registry of your choosing, and use the published image with KubeVirt.
7289

7390
# Iterating on the QEMU artifact
7491

0 commit comments

Comments
 (0)