Last active 1759069875

dch's Avatar dch revised this gist 1759069874. Go to revision

1 file changed, 14 insertions, 10 deletions

oci-launch-arm64.fish

@@ -1,4 +1,4 @@
1 - function oci-launch-arm64
1 + function oci-launch-zfs-arm64
2 2 set -l USERDATA (mktemp -t oci)
3 3 echo '#!/bin/sh -eux
4 4 set -o pipefail
@@ -7,27 +7,31 @@ sed -i"" -E -e "s/.*ssh-/ssh-/" /root/.ssh/authorized_keys
7 7 # https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm
8 8 curl --fail -H Authorization:\ Bearer\ Oracle -s \
9 9 http://169.254.169.254/opc/v2/instance \
10 - | jq . > /var/run/oci_metadata.json
10 + | jq . > /var/run/oci.json
11 11 mkdir -p /usr/local/etc/pkg/repos
12 12 sed -E -e s/quarterly/latest/ /etc/pkg/FreeBSD.conf \
13 13 | tee /usr/local/etc/pkg/repos/FreeBSD.conf
14 14 pkg upgrade -yr FreeBSD
15 15 pkg install -Uyr FreeBSD \
16 16 devel/git@tiny \
17 + devel/ninja \
17 18 devel/oci-cli \
18 - sysutils/fd \
19 - shells/fish \
20 - sysutils/htop \
21 - net/mosh \
22 19 editors/neovim \
20 + net/mosh \
23 21 net/ngrep \
24 - devel/ninja \
25 - textproc/ripgrep \
26 22 net/rsync \
27 - security/sudo \
23 + security/doas \
24 + shells/fish \
25 + sysutils/fd \
26 + sysutils/htop \
27 + sysutils/podman-compose \
28 + sysutils/podman-suite \
28 29 sysutils/tmux
30 + textproc/go-yq \
31 + textproc/ripgrep \
29 32 ' | tee $USERDATA
30 - # FreeBSD-14.3-RELEASE-arm64-zfs
33 + set -l OCI_CLI_PROFILE eubsd
34 + # FreeBSD 14.3-RELEASE arm64 zfs
31 35 set -l IMAGE_OCID 'ocid1.image.oc1..aaaaaaaakcp6qvubkpqzprnfca6hpgencllptvuu5cw7tr6thnublyj6vcla'
32 36 set -l SUBNET_OCID 'ocid1.subnet.oc1....'
33 37 set -l TENANCY_OCID 'ocid1.tenancy.oc1.....'

dch's Avatar dch revised this gist 1759069673. Go to revision

1 file changed, 56 insertions

oci-launch-arm64.fish(file created)

@@ -0,0 +1,56 @@
1 + function oci-launch-arm64
2 + set -l USERDATA (mktemp -t oci)
3 + echo '#!/bin/sh -eux
4 + set -o pipefail
5 + touch /var/run/cloud_script_was_here
6 + sed -i"" -E -e "s/.*ssh-/ssh-/" /root/.ssh/authorized_keys
7 + # https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm
8 + curl --fail -H Authorization:\ Bearer\ Oracle -s \
9 + http://169.254.169.254/opc/v2/instance \
10 + | jq . > /var/run/oci_metadata.json
11 + mkdir -p /usr/local/etc/pkg/repos
12 + sed -E -e s/quarterly/latest/ /etc/pkg/FreeBSD.conf \
13 + | tee /usr/local/etc/pkg/repos/FreeBSD.conf
14 + pkg upgrade -yr FreeBSD
15 + pkg install -Uyr FreeBSD \
16 + devel/git@tiny \
17 + devel/oci-cli \
18 + sysutils/fd \
19 + shells/fish \
20 + sysutils/htop \
21 + net/mosh \
22 + editors/neovim \
23 + net/ngrep \
24 + devel/ninja \
25 + textproc/ripgrep \
26 + net/rsync \
27 + security/sudo \
28 + sysutils/tmux
29 + ' | tee $USERDATA
30 + # FreeBSD-14.3-RELEASE-arm64-zfs
31 + set -l IMAGE_OCID 'ocid1.image.oc1..aaaaaaaakcp6qvubkpqzprnfca6hpgencllptvuu5cw7tr6thnublyj6vcla'
32 + set -l SUBNET_OCID 'ocid1.subnet.oc1....'
33 + set -l TENANCY_OCID 'ocid1.tenancy.oc1.....'
34 + set -l COMPARTMENT_OCID $TENANCY_OCID
35 + set -l AVAILABILITY_DOMAIN 'hENZ:EU-FRANKFURT-1-AD-3'
36 +
37 + # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/compute/instance/launch.html#cmdoption-shape
38 + set -l SHAPE 'VM.Standard.A1.Flex'
39 + set -l SHAPE_CONFIG '{"memoryInGBs": 6, "ocpus": 2}'
40 + set -l TAGS '{"GIT_REPO":"https://git.sr.ht/~dch/src", "GIT_REF":"13.2-oci", "IMG_ARCH":"arm64", "IMG_NAME": "FreeBSD-13.2-RELEASE-20230411-1455-99eb544-amd64-amd64.img"}'
41 + oci compute instance launch \
42 + --availability-domain $AVAILABILITY_DOMAIN \
43 + --compartment-id $COMPARTMENT_OCID \
44 + --image-id $IMAGE_OCID \
45 + --subnet-id $SUBNET_OCID \
46 + --shape $SHAPE \
47 + --shape-config $SHAPE_CONFIG \
48 + --boot-volume-size-in-gbs 50 \
49 + --ssh-authorized-keys-file ~/.ssh/id_ed25519.pub \
50 + --wait-for-state RUNNING \
51 + --display-name $argv[1] \
52 + --hostname-label $argv[1] \
53 + --freeform-tags $TAGS \
54 + --user-data-file $USERDATA
55 + rm -f $USERDATA
56 + end
Newer Older