-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizing memory and cpu specifications for VMs #33
base: main
Are you sure you want to change the base?
Conversation
rework* of parameters |
if if either |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally makes sense to me!
manual-workflows/start.sh
Outdated
;; | ||
--custom-memory*) | ||
if [ ! "$2" ]; then | ||
die 'ERROR: "--custome-memory" requires an argument' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
die 'ERROR: "--custome-memory" requires an argument' | |
die 'ERROR: "--custom-memory" requires an argument' |
manual-workflows/start.sh
Outdated
# optionally add either machine type when neither --custom-memory | ||
# nor --custom-cpu are specified | ||
if [ -z "$MEM" ] || [ -z "$CPU" ]; then | ||
echo "$MEM BLAAAAH $CPU" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like set -x
for debugging shell scripts! (echo
works too 🙂--just a reminder to remove this line before we merge it in.)
manual-workflows/start.sh
Outdated
) | ||
|
||
# optionally add either machine type when neither --custom-memory | ||
# nor --custom-cpu are specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be nitpicky about this comment: we're adding machine type when either --custom-memory or --custom cpu are not specified as well as when neither are specified. (You might say it "add machine type unless --custom-memory and --custom-cpu are specified".)
I could see having it throw an error if only one of the two is specified though.
bash start.sh $GCS_INSTANCE_NAME --server-account $GCS_SERVICE_ACCOUNT --project $GCS_PROJECT --custom-cpu 10 --custom-memory 64G --boot-disk-size=200GB
is ok .... butbash start.sh $GCS_INSTANCE_NAME --server-account $GCS_SERVICE_ACCOUNT --project $GCS_PROJECT --boot-disk-size=200GB --custom-cpu 10 --custom-memory 64G
is notbecause
boot-disk-size
is a param taken in through the@
and at that pointMEM
andCPU
weren't specified soMACHINE_TYPE
was added by default to the list of params.In other words, set the flags that
start.sh
ask for first then add flags accepted by GCP afterwards.I do not think this is new/unique to this case. This is probably just a new finding for me.