From 2f8f0159f8d0f2ffcc80513b58ec01a9a61e88c1 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 23 Apr 2014 16:14:50 -0700 Subject: [PATCH] maint(*): Delete special case code for amd64-generic --- build_image | 5 ----- build_library/set_lsb_release | 4 ---- oem/ami/build_ebs_on_ec2.sh | 18 ++++-------------- oem/ami/copy_ami.sh | 18 ++++-------------- oem/ami/test_ami.sh | 29 +++++++---------------------- oem/ami/upload_ami_txt.sh | 18 ++++-------------- 6 files changed, 19 insertions(+), 73 deletions(-) diff --git a/build_image b/build_image index ed280e56c8..4ff43f4c90 100755 --- a/build_image +++ b/build_image @@ -134,11 +134,6 @@ mkdir -p "${BUILD_DIR}" DISK_LAYOUT_SUFFIX=$(portageq-$BOARD envvar COREOS_DISK_LAYOUT_SUFFIX) DISK_LAYOUT="${FLAGS_disk_layout:-base}${DISK_LAYOUT_SUFFIX}" -# Temporary hack until generic images are completely deleted -if [[ "${FLAGS_group}" == "alpha" && "$BOARD" == "amd64-generic" ]]; then - FLAGS_group="dev-channel" -fi - # Create the base image. create_base_image "${PRISTINE_IMAGE_NAME}" "${DISK_LAYOUT}" "${FLAGS_group}" if should_build_image ${PRISTINE_IMAGE_NAME}; then diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index c4651541b3..1a2d7552d1 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -28,11 +28,7 @@ ROOT_FS_DIR="$FLAGS_root" COREOS_VERSION_NAME="CoreOS" COREOS_VERSION_AUSERVER="" if [[ -n "${FLAGS_group}" ]]; then - if [[ "${FLAGS_board}" == "amd64-usr" ]]; then COREOS_VERSION_AUSERVER="https://public.update.core-os.net/v1/update/" - elif [[ "${FLAGS_board}" == "amd64-generic" ]]; then - COREOS_VERSION_AUSERVER="https://api.core-os.net/v1/update/" - fi fi # DISTRIB_* are the standard lsb-release names diff --git a/oem/ami/build_ebs_on_ec2.sh b/oem/ami/build_ebs_on_ec2.sh index d86e459e5c..2d74c1b4ab 100755 --- a/oem/ami/build_ebs_on_ec2.sh +++ b/oem/ami/build_ebs_on_ec2.sh @@ -25,8 +25,8 @@ AKI["sa-east-1"]=aki-c88f51d5 readonly COREOS_EPOCH=1372636800 VERSION="master" -BOARD="amd64-generic" -GROUP="" +BOARD="amd64-usr" +GROUP="alpha" IMAGE="coreos_production_ami_image.bin.bz2" URL_FMT="http://storage.core-os.net/coreos/%s/%s/$IMAGE" IMG_URL="" @@ -35,8 +35,8 @@ IMG_PATH="" USAGE="Usage: $0 [-V 1.2.3] [-p path/image.bz2 | -u http://foo/image.bz2] Options: -V VERSION Set the version of this AMI, default is 'master' - -b BOARD Set to the board name, amd64-usr or amd64-generic - -g GROUP Set the update group, default is based on BOARD + -b BOARD Set to the board name, default is amd64-usr + -g GROUP Set the update group, default is alpha or master -p PATH Path to compressed disk image, overrides -u -u URL URL to compressed disk image, derived from -V if unset. -K KEY Path to Amazon API private key. @@ -92,16 +92,6 @@ if [[ "$VERSION" == "master" ]]; then GROUP="master" fi -if [[ -z "$GROUP" ]]; then - if [[ "$BOARD" == "amd64-generic" ]]; then - GROUP="dev-channel" - elif [[ "$BOARD" == "amd64-usr" ]]; then - GROUP="alpha" - else - GROUP="$BOARD" - fi -fi - # Size of AMI file system # TODO: Perhaps define size and arch in a metadata file image_to_vm creates? size=8 # GB diff --git a/oem/ami/copy_ami.sh b/oem/ami/copy_ami.sh index 37500002d9..3b3dbe1fbc 100755 --- a/oem/ami/copy_ami.sh +++ b/oem/ami/copy_ami.sh @@ -26,8 +26,8 @@ AKI["sa-east-1"]=aki-c88f51d5 USAGE="Usage: $0 -a ami-id -a ami-id ID of the AMI to be coppied. -V VERSION Find AMI by CoreOS version. - -b BOARD Set to the board name, amd64-usr or amd64-generic - -g GROUP Set the update group, default is based on BOARD + -b BOARD Set to the board name, default is amd64-usr + -g GROUP Set the update group, default is alpha -K KEY Path to Amazon API private key. -C CERT Path to Amazon API key certificate. -h this ;-) @@ -38,8 +38,8 @@ This script must be run from an ec2 host with the ec2 tools installed. AMI= VER= -BOARD="amd64-generic" -GROUP="" +BOARD="amd64-usr" +GROUP="alpha" while getopts "a:V:b:g:K:C:hv" OPTION do @@ -66,16 +66,6 @@ if [[ -z "$VER" ]]; then exit 1 fi -if [[ -z "$GROUP" ]]; then - if [[ "$BOARD" == "amd64-generic" ]]; then - GROUP="dev-channel" - elif [[ "$BOARD" == "amd64-usr" ]]; then - GROUP="alpha" - else - GROUP="$BOARD" - fi -fi - if [[ -z "$AMI" ]]; then AMI=$(ec2-describe-images -F name="CoreOS-$GROUP-$VER" | grep -m1 ^IMAGE \ | cut -f2) || true # Don't die silently, error messages are good diff --git a/oem/ami/test_ami.sh b/oem/ami/test_ami.sh index 9261b0dd0b..3f31e7468f 100755 --- a/oem/ami/test_ami.sh +++ b/oem/ami/test_ami.sh @@ -14,8 +14,8 @@ set -e -o pipefail USAGE="Usage: $0 -a ami-id -a ami-id ID of the AMI to be tests -V VERSION Find AMI by CoreOS version. - -b BOARD Set to the board name, amd64-usr or amd64-generic - -g GROUP Set the update group, default is based on BOARD + -b BOARD Set to the board name, default is amd64-usr + -g GROUP Set the update group, default is alpha -K KEY Path to Amazon API private key. -C CERT Path to Amazon API key certificate. -h this ;-) @@ -27,8 +27,8 @@ This script must be run from an ec2 host with the ec2 tools installed. AMI= VER= -BOARD="amd64-generic" -GROUP="" +BOARD="amd64-usr" +GROUP="alpha" while getopts "a:V:b:g:K:C:hv" OPTION do @@ -50,16 +50,6 @@ if [[ $(id -u) -eq 0 ]]; then exit 1 fi -if [[ -z "$GROUP" ]]; then - if [[ "$BOARD" == "amd64-generic" ]]; then - GROUP="dev-channel" - elif [[ "$BOARD" == "amd64-usr" ]]; then - GROUP="alpha" - else - GROUP="$BOARD" - fi -fi - if [[ -z "$AMI" && -n "$VER" ]]; then AMI=$(ec2-describe-images -F name="CoreOS-$GROUP-$VER" | grep -m1 ^IMAGE \ | cut -f2) || true # Don't die silently, error messages are good @@ -96,13 +86,8 @@ echo "OK ($key_name)" zoneurl=http://instance-data/latest/meta-data/placement/availability-zone zone=$(curl --fail -s $zoneurl) region=$(echo $zone | sed 's/.$//') - -token=$(uuidgen) -if [[ "$BOARD" == "amd64-generic" ]]; then - userdata="$token" -else - discovery=$(curl --fail -s https://discovery.etcd.io/new) - userdata="#cloud-config +discovery=$(curl --fail -s https://discovery.etcd.io/new) +userdata="#cloud-config coreos: etcd: @@ -115,7 +100,6 @@ coreos: - name: fleet.service command: start " -fi echo -n "Booting instances... " instances=$(ec2-run-instances \ @@ -157,6 +141,7 @@ echo "OK" echo -n "Testing etcd... " test_key="v1/keys/test" +token=$(uuidgen) # XXX: the sleep *should never* be required, this is a bug in etcd sleep 5 curl --fail -s -L "${ips[0]}:4001/$test_key" -d value="$token" > /dev/null diff --git a/oem/ami/upload_ami_txt.sh b/oem/ami/upload_ami_txt.sh index f2be924822..de25e0239d 100755 --- a/oem/ami/upload_ami_txt.sh +++ b/oem/ami/upload_ami_txt.sh @@ -18,8 +18,8 @@ AKI["sa-east-1"]=aki-c88f51d5 USAGE="Usage: $0 -V 100.0.0 -V VERSION Find AMI by CoreOS version. (required) - -b BOARD Set to the board name, amd64-usr or amd64-generic - -g GROUP Set the update group, default is based on BOARD + -b BOARD Set to the board name, default is amd64-usr + -g GROUP Set the update group, default is alpha -K KEY Path to Amazon API private key. -C CERT Path to Amazon API key certificate. -h this ;-) @@ -32,8 +32,8 @@ IMAGE="coreos_production_ami" URL_FMT="gs://storage.core-os.net/coreos/%s/%s/${IMAGE}_%s.txt" AMI= VER= -BOARD="amd64-generic" -GROUP="" +BOARD="amd64-usr" +GROUP="alpha" while getopts "V:b:g:K:C:hv" OPTION do @@ -60,16 +60,6 @@ if [[ ! -n "$VER" ]]; then exit 1 fi -if [[ -z "$GROUP" ]]; then - if [[ "$BOARD" == "amd64-generic" ]]; then - GROUP="dev-channel" - elif [[ "$BOARD" == "amd64-usr" ]]; then - GROUP="alpha" - else - GROUP="$BOARD" - fi -fi - declare -A AMIS for r in "${!AKI[@]}"; do AMI=$(ec2-describe-images --region=${r} -F name="CoreOS-$GROUP-$VER" \