Create a node template
Cloud-init
Pass a startup script or cloud-config YAML file via--cloud-init. The file is stored with the
template and applied to every node created from it. Maximum size is 64 KB.
startup.sh
Reusable node configurations for deployments
sf node-templates create \
--name prod-worker \
--image ubuntu-22.04.5-cuda-12.7 \
--cloud-init ./startup.sh
--cloud-init. The file is stored with the
template and applied to every node created from it. Maximum size is 64 KB.
#!/bin/bash
mkdir -p /root/.ssh
cat >>/root/.ssh/authorized_keys <<"EOF"
ssh-ed25519 AAAA... you@example.com
EOF
sf node-templates create --name ssh-ready \
--image ubuntu-22.04.5-cuda-12.7 --cloud-init ./startup.sh
sf node-templates list
NAME IMAGE CLOUD-INIT CREATED
prod-ubuntu ubuntu-22.04.5-cuda-12.7 yes Mar 23, 4:40pm
dev-debian debian-12-cuda-12.7 - Mar 26, 2:00pm
staging-base ubuntu-22.04.5-cuda-12.7 yes Mar 27, 2:00pm
sf node-templates get prod-ubuntu
│ ID ntmpl_Gw5rT8mKn2Pj4Lx9Qf7Y
│ NAME prod-ubuntu
│ IMAGE ubuntu-22.04.5-cuda-12.7 (image_TQiHEBzCA18ToAQqBtOr_)
│ CLOUD-INIT yes
└ CREATED Mar 23, 4:40pm UTC
sf node-templates delete prod-ubuntu