From 268af148ce6bbc064611f3cdaaf9b6c4d23c3a36 Mon Sep 17 00:00:00 2001 From: Jona Date: Sat, 4 Nov 2023 00:35:01 -0400 Subject: [PATCH] oops D: --- .../cloud_run_orchestrator/handler.py | 2 - notebooks/run_sr_on_scene_ids.ipynb | 50 ++++++++++++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/cerulean_cloud/cloud_run_orchestrator/handler.py b/cerulean_cloud/cloud_run_orchestrator/handler.py index d0ad3daf..c2a5aeec 100644 --- a/cerulean_cloud/cloud_run_orchestrator/handler.py +++ b/cerulean_cloud/cloud_run_orchestrator/handler.py @@ -383,14 +383,12 @@ async def _orchestrate( base_tiles_inference = await perform_inference( base_tiles, cloud_run_inference.get_base_tile_inference, - 100, "base tiles", ) offset_tiles_inference = await perform_inference( offset_tiles_bounds, cloud_run_inference.get_offset_tile_inference, - 100, "offset tiles", ) diff --git a/notebooks/run_sr_on_scene_ids.ipynb b/notebooks/run_sr_on_scene_ids.ipynb index c9ba40a8..0d18a912 100644 --- a/notebooks/run_sr_on_scene_ids.ipynb +++ b/notebooks/run_sr_on_scene_ids.ipynb @@ -264,7 +264,7 @@ "source": [ "import httpx\n", "import json\n", - "def stage(scene_ids, API_KEY):\n", + "def stage(scene_ids, API_KEY=\"\"):\n", " URL = \"https://europe-west1-cerulean-338116.cloudfunctions.net/cerulean-cloud-staging-cloud-function-sr\"\n", " payload = {\n", " \"Records\": [{\n", @@ -279,13 +279,59 @@ " json=payload,\n", " timeout=100,\n", " headers={\"Authorization\": f\"Bearer {API_KEY}\", \"Content-Type\": \"application/json\"})\n", + " print(orchestrator_result)\n", + "def test(scene_ids, API_KEY=\"\"):\n", + " URL = \"https://europe-west1-cerulean-338116.cloudfunctions.net/cerulean-cloud-test-cloud-function-sr\"\n", + " payload = {\n", + " \"Records\": [{\n", + " \"Sns\": {\n", + " \"Message\": json.dumps({\n", + " \"id\": s,\n", + " \"footprint\": {\"coordinates\": [[[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]]}})}}\n", + " for s in scene_ids]}\n", + "\n", + " orchestrator_result = httpx.post(\n", + " URL,\n", + " json=payload,\n", + " timeout=100,\n", + " headers={\"Authorization\": f\"Bearer {API_KEY}\", \"Content-Type\": \"application/json\"})\n", " print(orchestrator_result)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "test(slicks)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { + "kernelspec": { + "display_name": "pulumi_env", + "language": "python", + "name": "python3" + }, "language_info": { - "name": "python" + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.18" } }, "nbformat": 4,