Remove some low-hanging TODOs (#6839)

This commit is contained in:
Michael Vines
2019-11-08 16:41:36 -07:00
committed by GitHub
parent 151adab739
commit 9c00ad9ff2
7 changed files with 23 additions and 31 deletions

View File

@ -5,7 +5,8 @@
# Utilities for working with Colo instances
#
declare COLO_TODO_PARALLELIZE=false
# COLO_PARALLELIZE is not ready for use, disable it
declare COLO_PARALLELIZE=false
__cloud_colo_here="$(dirname "${BASH_SOURCE[0]}")"
# shellcheck source=net/scripts/colo-utils.sh
@ -40,7 +41,7 @@ __cloud_FindInstances() {
declare filter=$1
instances=()
if ! $COLO_TODO_PARALLELIZE; then
if ! $COLO_PARALLELIZE; then
colo_load_resources
colo_load_availability false
fi
@ -110,7 +111,7 @@ cloud_Initialize() {
# networkName=$1 # unused
# zone=$2 #unused
colo_load_resources
if $COLO_TODO_PARALLELIZE; then
if $COLO_PARALLELIZE; then
colo_load_availability
fi
}
@ -166,7 +167,7 @@ cloud_CreateInstances() {
done
fi
if $COLO_TODO_PARALLELIZE; then
if $COLO_PARALLELIZE; then
declare HOST_NAME IP PRIV_IP STATUS ZONE LOCK_USER INSTNAME INDEX RES LINE
declare -a AVAILABLE
declare AVAILABLE_TEXT
@ -270,7 +271,7 @@ cloud_FetchFile() {
cloud_StatusAll() {
declare HOST_NAME IP PRIV_IP STATUS ZONE LOCK_USER INSTNAME
if ! $COLO_TODO_PARALLELIZE; then
if ! $COLO_PARALLELIZE; then
colo_load_resources
colo_load_availability false
fi

View File

@ -178,9 +178,9 @@ colo_node_status_all() {
done < <(colo_instance_run_foreach "$(__colo_node_status_script)")
}
# TODO: As part of COLO_TOOD_PARALLELIZE this list will need to be maintained
# in a lockfile to work around `cloud_CreateInstance` being called in the
# background for validators
# Note: As part of enabling COLO_PARALLELIZE, this list will need to be maintained in a
# lockfile to work around `cloud_CreateInstance` being called in the background
# for validators
export COLO_RES_REQUISITIONED=()
colo_node_requisition() {
declare IP=$1

View File

@ -19,9 +19,7 @@ __cloud_GetRegion() {
echo "$region"
}
# sshPrivateKey should be globally defined whenever this function is called.
#
# TODO: Remove usage of the sshPrivateKey global
# Note: sshPrivateKey should be globally defined whenever this function is called.
__cloud_SshPrivateKeyCheck() {
# shellcheck disable=SC2154
if [[ -z $sshPrivateKey ]]; then
@ -174,8 +172,8 @@ cloud_CreateInstances() {
#
# Custom Ubuntu 18.04 LTS image with CUDA 9.2 and CUDA 10.0 installed
#
# TODO: Unfortunately these AMIs are not public. When this becomes an issue,
# use the stock Ubuntu 18.04 image and programmatically install CUDA after the
# Unfortunately these AMIs are not public. When this becomes an issue, use
# the stock Ubuntu 18.04 image and programmatically install CUDA after the
# instance boots
#
case $region in
@ -287,9 +285,10 @@ cloud_CreateInstances() {
IFS=: read -r instanceId publicIp privateIp zone < <(echo "${instances[0]}")
(
set -x
# TODO: Poll that the instance has moved to the 'running' state instead of
# blindly sleeping for 30 seconds...
# It would be better to poll that the instance has moved to the 'running'
# state instead of blindly sleeping for 30 seconds...
sleep 30
declare region=
region=$(__cloud_GetRegion "$zone")
aws ec2 associate-address \