From 01f57c1e44c6b256a9a822fc5b42b4ac6af95e12 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 5 Mar 2020 14:08:32 +0200 Subject: [PATCH] Create missing queues when starting the AWS dynamic cluster management service --- examples/dynamic_cloud_cluster.ipynb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/dynamic_cloud_cluster.ipynb b/examples/dynamic_cloud_cluster.ipynb index a32ad21..6928c71 100644 --- a/examples/dynamic_cloud_cluster.ipynb +++ b/examples/dynamic_cloud_cluster.ipynb @@ -444,6 +444,12 @@ " os.environ[\"TRAINS_API_SECRET_KEY\"] = TRAINS_SECRET_KEY\n", " api_client = APIClient()\n", "\n", + " # Verify the requested queues exist and create those that doesn't exist\n", + " all_queues = [q.name for q in list(api_client.queues.get_all())]\n", + " missing_queues = [q for q in QUEUES if q not in all_queues]\n", + " for q in missing_queues:\n", + " api_client.queues.create(q)\n", + "\n", " idle_workers = {}\n", " while True:\n", " queue_name_to_id = {\n",