From f1ebfa2b54046443e66ad5a7151278c9196dc83f Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 22 Feb 2023 17:44:19 +0300 Subject: [PATCH 1/2] Providing correct http response code with the errors in deploy_beam cloud function --- gcp/src/main/python/deploy_beam/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcp/src/main/python/deploy_beam/main.py b/gcp/src/main/python/deploy_beam/main.py index 9d462cc6a5d..91f59cf2cf5 100644 --- a/gcp/src/main/python/deploy_beam/main.py +++ b/gcp/src/main/python/deploy_beam/main.py @@ -48,7 +48,7 @@ def create_beam_instance(request): return escape("No instance type provided"), 400 instance_cores, instance_memory = find_instance_cores_and_memory(instance_type) if not instance_memory: - return escape(f"Instance type '{instance_type}' is not supported") + return escape(f"Instance type '{instance_type}' is not supported"), 400 max_ram = request_payload['forced_max_ram'] if parameter_is_not_specified(max_ram): max_ram = calculate_heap_size(instance_cores, instance_memory) @@ -126,7 +126,7 @@ def create_beam_instance(request): error = f"{error_head['code']}, {error_head['location']}, {error_head['message']}" if error: - return escape(f"operation id: {operation_id}, status: {operation_status}, error: {error}") + return escape(f"operation id: {operation_id}, status: {operation_status}, error: {error}"), 500 else: return escape(f'Started batch: {batch_uid}' f' with run name: {run_name}' From cb7adfbe6dfea4d89125a6185327bd7001d6b2ca Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Mon, 27 Feb 2023 12:11:43 +0300 Subject: [PATCH 2/2] Default cloud init script url is pointed to the develop branch --- gcp/src/main/python/deploy_beam/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/src/main/python/deploy_beam/main.py b/gcp/src/main/python/deploy_beam/main.py index 91f59cf2cf5..fbe9a73ac40 100644 --- a/gcp/src/main/python/deploy_beam/main.py +++ b/gcp/src/main/python/deploy_beam/main.py @@ -70,7 +70,7 @@ def create_beam_instance(request): disk_image_name = f"projects/{project}/global/images/beam-box" cloud_init_script_url = os.environ.get('CLOUD_INIT_SCRIPT_URL') if not cloud_init_script_url: - cloud_init_script_url = "https://raw.githubusercontent.com/LBNL-UCB-STI/beam/do/%233652-execute-beam-on-google-cloud-compute/gcp/src/main/bash/cloud-init.sh" + cloud_init_script_url = "https://raw.githubusercontent.com/LBNL-UCB-STI/beam/develop/gcp/src/main/bash/cloud-init.sh" log(f"cloud_init_script_url: {cloud_init_script_url}") startup_script = """ #!/bin/sh