EC2 fleets made easy
Each forge job requires an environment created. This includes an environment yaml and the default user data scripts (optional).
https://github.com/carsdotcom/cars-forge/blob/main/examples/env_yaml_example/example.yaml
user_data
parameter in the environment yaml, you can specify what the default user data script should be if the user does not provide one.echo "$(cat /root/.ssh/authorized_keys | sed 's/^.*ssh-rsa/ssh-rsa/')" > /root/.ssh/authorized_keys
is needed in all user data scripts because Forge runs all commands as root.forge configure -h
Configure env yaml and place it in /home/ec2-user/.local/lib/python3.7/site-packages/forge/config/
mkdir -p /home/ec2-user/.local/lib/python3.7/site-packages/forge/config/example`
forge configure
and fill in all the parameters.user_data
parameter in the environment yaml, you can specify what the default user data script should be if one is not provided.echo "$(cat /root/.ssh/authorized_keys | sed 's/^.*ssh-rsa/ssh-rsa/')" > /root/.ssh/authorized_keys
is needed in all user data scripts because Forge runs all commands as root.forge configure -h
Configure env yaml and place it in /home/ec2-user/.local/lib/python3.7/site-packages/forge/config/
name
you used when you ran forge configure
. ec2_amis:
single:
ami: ami-abcdefghi12345678
disk: 30
disk_device_name: /dev/sda1
cluster:
ami: ami-12345678abcdefghi
disk: 30
disk_device_name: /dev/xvda
single_gpu:
ami: ami-abcdefghi00000000
disk: 90
disk_device_name: /dev/sda1
forge_pem_secret
excluded_ec2s: ["*g.*", "gd.*", "*metal*", "g4ad*"]
ec2_key
is stored{name}
for job name, {date}
for job date, etc.) See the variables page for more details.{name}
for job name, {date}
for job date, etc.) See the variables page for more details. #!/bin/bash
set -x
echo "$(cat /root/.ssh/authorized_keys | sed 's/^.*ssh-rsa/ssh-rsa/')" > /root/.ssh/authorized_keys