Skip to content
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 VM's CPU/RAM instead of setting --machine-type #32

Open
Layth17 opened this issue Mar 6, 2023 · 0 comments · May be fixed by #33
Open

Customizing VM's CPU/RAM instead of setting --machine-type #32

Layth17 opened this issue Mar 6, 2023 · 0 comments · May be fixed by #33

Comments

@Layth17
Copy link
Member

Layth17 commented Mar 6, 2023

The vanilla approach to launch a VM is as follows:

bash start.sh $GCS_INSTANCE_NAME --server-account $GCS_SERVICE_ACCOUNT --project $GCS_PROJECT --boot-disk-size=50GB --boot-disk-type=pd-standard --machine-type=e2-standard-2

However, sometimes we probably want to use --custom-cpu and/or --custom-memory. Using either of those conflicts with using --machine-type. Currently, --machine-type is always invoked:

gcloud compute instances create $INSTANCE_NAME \
       --project $PROJECT \
       --image-family debian-11 \
       --image-project debian-cloud \
       --zone $ZONE \
       --machine-type=$MACHINE_TYPE \
       --service-account=$SERVER_ACCOUNT --scopes=cloud-platform \
       --network=$NETWORK --subnet=$SUBNET \
       --metadata=cromwell-version=71 \
       --metadata-from-file=startup-script=$SRC_DIR/server_startup.py,cromwell-conf=$CROMWELL_CONF,helpers-sh=$SRC_DIR/helpers.sh,cromwell-service=$SRC_DIR/cromwell.service,workflow-options=$WORKFLOW_OPTIONS,persist-artifacts=$SRC_DIR/../scripts/persist_artifacts.py \
       $@

and if $MACHINE_TYPE is empty, then, prior to the block above, machine type is set to the default MACHINE_TYPE=${MACHINE_TYPE:-"e2-standard-2"} making it impossible to avoid.

Which leads to the following error message (gcloud.compute.instances.create) Invalid value for [--machine-type]: Cannot set both [--machine-type] and [--custom-cpu]/[--custom-memory] for the same instance.

Even though the command used, bash start.sh $GCS_INSTANCE_NAME --server-account $GCS_SERVICE_ACCOUNT --project $GCS_PROJECT --boot-disk-size=200GB --custom-memory 64G --custom-cpu 6, did not use the flag --machine-type

For the most part, this is not critical, but could be nice to be add the ability to customize those parameters.

@Layth17 Layth17 linked a pull request Mar 7, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant