Compare commits

...

2 Commits

Author SHA1 Message Date
Ben Grant
b08544927a fair play graphite 2025-06-04 15:43:07 -07:00
Ben Grant
c87182b51f Add ci-ec2.sh 2025-06-04 15:28:00 -07:00
3 changed files with 63 additions and 0 deletions

View File

@@ -341,6 +341,8 @@ function getZigAgent(platform, options) {
}
/**
* Get the instance type to use for running tests. Keep synced with ci-ec2.sh.
*
* @param {Platform} platform
* @param {PipelineOptions} options
* @returns {Agent}

View File

@@ -251,6 +251,14 @@ check_features() {
gcc_version="13"
print "GCC 13: enabled"
;;
*--clone*)
clone_bun=1
print "Clone Bun: enabled"
;;
*--xterm-256color*)
xterm_256color=1
print "Set TERM=xterm-256color: enabled"
;;
esac
done
}
@@ -1345,6 +1353,24 @@ clean_system() {
done
}
clone_bun() {
if ! [ "$clone_bun" = "1" ]; then
return
fi
print "Cloning Bun..."
execute_as_user sh -c "cd && git clone https://github.com/oven-sh/bun.git"
}
set_term() {
if ! [ "$xterm_256color" = "1" ]; then
return
fi
print "Setting TERM=xterm-256color..."
append_to_profile "export TERM=xterm-256color"
}
main() {
check_features "$@"
check_operating_system
@@ -1357,6 +1383,8 @@ main() {
install_build_essentials
install_chromium
install_fuse_python
clone_bun
set_term
clean_system
}

33
scripts/ci-ec2.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# wrapper for machine.mjs that makes it easier to create an EC2 box matching our CI test runners
# usage: ./scripts/ci-ec2.sh <distro> <release> <x64|aarch64>
distro="$1"
release="$2"
arch="$3"
shift 3
if [ "$distro" = windows ]; then
os=windows
else
os=linux
fi
if [ "$arch" = x64 ]; then
if [ "$os" = windows ]; then
instance_type=c7i.2xlarge
else
instance_type=c7i.xlarge
fi
else
instance_type=c8g.xlarge
fi
if [ "$TERM" = "xterm-ghostty" ]; then
ghostty_flag="--feature=xterm-256color"
else
ghostty_flag=""
fi
# TODO this should be able to use a published image instead of running bootstrap
exec bun scripts/machine.mjs ssh --cloud=aws --os=$os --distro=$distro --release=$release --arch=$arch --instance-type=$instance_type --feature=clone $ghostty_flag $@