|
25 | 25 | " <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
|
26 | 26 | " <div>\n",
|
27 | 27 | " <p><b>Note</b></p>\n",
|
28 |
| - " <p>This notebook is in preview and requires your Organization to have access to the Migrate Virtual Workspace Feature. Please reach out to us if you'd like to request access.</p>\n", |
| 28 | + " <p>This notebook is in preview and requires your Organization to have access to the Migrate Shared Deployment Feature. Please reach out to us if you'd like to request access.</p>\n", |
29 | 29 | " <p>This notebook should be run on any shared deployment (including on a Free Starter Workspace) in an Organization whose plan allow for the creation of a new dedicated deployment.</p>\n",
|
30 | 30 | " <p>To create a Free Starter Workspace navigate to <tt>Start</tt> using the left nav.</p>\n",
|
31 | 31 | " </div>\n",
|
|
57 | 57 | " <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
|
58 | 58 | " <div>\n",
|
59 | 59 | " <p><b>Warning</b></p>\n",
|
60 |
| - " <p>During the migration process data writen to the shared deployment may not be moved to the new Workspace in the dedicated deployment. The shared deployment will remain available during (and after) the migration process, however any writes to the shared deployment after the migration process begins may not be reflected on the new workspace.</p>\n", |
61 |
| - " <p>The migration process will copy your data to the new deployment and, by default, move any jobs you had scheduled for your shared deployemnt to the new deployment. If you do not wish to move your scheduled jobs, You will be prompeted to not do it. You can manually move them later from the Jobs page.</p>\n", |
62 |
| - " <p>While your migrated data will also remain available on your shared deployment, after the migration, the scheduled jobs will only be one the new deployment, please account for this when migrating.</p>\n", |
| 60 | + " <p>During the migration process data written to the shared deployment may not be moved to the new dedicated deployment. The shared deployment will remain available during (and after) the migration process, however any writes to the shared deployment after the migration process begins may not be reflected on the new deployment.</p>\n", |
| 61 | + " <p>The migration process will copy your data to the new deployment and, by default, move any jobs you had scheduled for your shared deployment to the new deployment. You can elect not to move your scheduled jobs. If You do so, You can manually move them later from the Jobs page.</p>\n", |
| 62 | + " <p>While your migrated data will also remain available on your shared deployment, after the migration, the scheduled jobs will only be one the new deployment.</p>\n", |
63 | 63 | " <p></p>\n",
|
64 |
| - " <p>Please account for this behaviour when migrating.</p>\n", |
| 64 | + " <p>Please account for this behavior when migrating.</p>\n", |
65 | 65 | " </div>\n",
|
66 | 66 | "</div>"
|
67 | 67 | ]
|
|
72 | 72 | "id": "f3dfd325",
|
73 | 73 | "metadata": {},
|
74 | 74 | "source": [
|
75 |
| - "## Choose a Region for the new workspace group\n", |
76 |
| - "Please select the Region you desire your new Workspace Group to be created on from the dropdown after the next cell." |
| 75 | + "## Choose a Region for the new deployment\n", |
| 76 | + "Please select the Region you desire your new deployment to be created on from the dropdown after the next cell." |
77 | 77 | ]
|
78 | 78 | },
|
79 | 79 | {
|
|
87 | 87 | "from ipywidgets import widgets\n",
|
88 | 88 | "\n",
|
89 | 89 | "api_url = os.environ['SINGLESTOREDB_MANAGEMENT_BASE_URL']\n",
|
90 |
| - "region_response = requests.get('{}/v1/regions'.format(api_url), headers={'Authorization': 'Bearer {}'.format(connection_password)})\n", |
91 |
| - "regions = [[f\"{r['provider']}: {r['region']}\", r['regionID']] for r in region_response.json()]\n", |
| 90 | + "region_response = requests.get('{}/v2/regions'.format(api_url), headers={'Authorization': 'Bearer {}'.format(connection_password)})\n", |
| 91 | + "regions = [[f\"{r['region']} : {r['provider']} - {r['regionName']}\", [r['provider'], ['regionName']]] for r in region_response.json()]\n", |
92 | 92 | "region_dropdown = widgets.Dropdown(\n",
|
93 | 93 | " options = regions,\n",
|
94 | 94 | " value = regions[0][1],\n",
|
|
163 | 163 | "source": [
|
164 | 164 | "## Choose the size for the new workspace\n",
|
165 | 165 | "Please insert the size for your new Workspace in text box after the next cell.\n",
|
166 |
| - "If you are unsure which size to choose, visit the [docs](https://www.singlestore.com/cloud-pricing/)." |
| 166 | + "If you are unsure which size to choose, you can check them [here](https://www.singlestore.com/cloud-pricing/)." |
167 | 167 | ]
|
168 | 168 | },
|
169 | 169 | {
|
|
195 | 195 | " <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
|
196 | 196 | " <div>\n",
|
197 | 197 | " <p><b>Warning</b></p>\n",
|
198 |
| - " <p>During the migration process data writen to the shared deployment may not be moved to the new Workspace in the dedicated deployment. The shared deployment will remain available during (and after) the migration process, however any writes to the shared deployment after the migration process begins may not be reflected on the new workspace.</p>\n", |
199 |
| - " <p>The migration process will copy your data to the new deployment and, by default, move any jobs you had scheduled for your shared deployemnt to the new deployment. If you do not wish to move your scheduled jobs, You will be prompeted to not do it. You can manually move them later from the Jobs page.</p>\n", |
200 |
| - " <p>While your migrated data will also remain available on your shared deployment, after the migration, the scheduled jobs will only be one the new deployment.</p>\n", |
201 |
| - " <p></p>\n", |
202 |
| - " <p>Please account for this behaviour when migrating.</p>\n", |
| 198 | + " <p>After runnig the next cell, data written to the shared deployment may not be moved to the new Workspace.</p>\n", |
| 199 | + " <p>If you do not wish to move your scheduled jobs, you should set \"migrateScheduledJobs\" to false on the request body bellow.</p>\n", |
203 | 200 | " <p></p>\n",
|
204 |
| - " <p>If you do not wish to migrate your scheduled Jobs to the new deployment, please set the field \"migrateScheduledJobs\", in the cell bellow, to false.</p>\n", |
205 | 201 | " </div>\n",
|
206 | 202 | "</div>"
|
207 | 203 | ]
|
|
233 | 229 | " \"migrateScheduledJobs\": true,\n",
|
234 | 230 | " \"destinationWorkspace\": {\n",
|
235 | 231 | " \"name\": workspace_name_text_box.value,\n",
|
236 |
| - " \"regionID\": region_dropdown.value,\n", |
| 232 | + " \"provider\": region_dropdown.value[0],\n", |
| 233 | + " \"regionName\": region_dropdown.value[1],\n", |
237 | 234 | " \"size\": size_text_box.value,\n",
|
238 | 235 | " \"workspaceGroupName\": workspace_group_name_text_box.value\n",
|
239 | 236 | " }\n",
|
240 |
| - "})\n", |
| 237 | + "}).status_code\n", |
241 | 238 | "\n",
|
242 |
| - "if migrate_response.status_code == 200:\n", |
| 239 | + "if migrate_response == 200:\n", |
243 | 240 | " display(widgets.HTML(f\"<div class='alert alert-block alert-success'><b class='fa fa-solid fa-check-circle'></b><div><p><b>Migration Started</b></p><p>See next cell for progress</p></div></div>\"))\n",
|
244 | 241 | "else:\n",
|
245 | 242 | " display(widgets.HTML(f\"<div class='alert alert-block alert-danger'><b class='fa fa-solid fa-exclamation-triangle'></b><div><p><b>Failed to Start Migration</b></p><p>{migrate_response.status_code} - {migrate_response.text}</p></div></div>\"))"
|
|
251 | 248 | "id": "fb825bce",
|
252 | 249 | "metadata": {},
|
253 | 250 | "source": [
|
254 |
| - "## Check the progress of the migration:\n", |
| 251 | + "## Check the progress of the migration\n", |
255 | 252 | "Running the next cell will give you progress on the migration"
|
256 | 253 | ]
|
257 | 254 | },
|
|
269 | 266 | "organization_id = os.environ['SINGLESTOREDB_ORGANIZATION']\n",
|
270 | 267 | "api_url = os.environ['SINGLESTOREDB_MANAGEMENT_BASE_URL']\n",
|
271 | 268 | "\n",
|
272 |
| - "status_response = requests.get('{}/v1/sharedtier/virtualWorkspaces/{}/migrate'.format(api_url, workspace_id), headers={'Authorization': 'Bearer {}'.format(connection_password)})\n", |
| 269 | + "status_response = requests.get('{}/v1/sharedtier/virtualWorkspaces/{}/migrations'.format(api_url, workspace_id), headers={'Authorization': 'Bearer {}'.format(connection_password)})\n", |
273 | 270 | "\n",
|
274 |
| - "while status_response.json()[\"migrationStatus\"] not in [\"Completed\", \"Failed\"]:\n", |
275 |
| - " display(widgets.IntProgress(\n", |
276 |
| - " value=[\"Failed\", \"WaitingForWorkspaceGroup\", \"MigratingData\", \"MigratingJobs\", \"Completed\"].index(status_response.json()[\"migrationStatus\"]),\n", |
277 |
| - " min=0,\n", |
278 |
| - " max=4,\n", |
279 |
| - " description='Loading:',\n", |
280 |
| - " orientation='horizontal'\n", |
281 |
| - " ))\n", |
| 271 | + "while status_response.json()[\"migrationStatus\"] not in [\"SUCCEEDED\", \"FAILED\"]:\n", |
| 272 | + " display(widgets.HTML('<div class=\"alert alert-block alert-info\"><b class=\"fa fa-solid fa-info-circle\"></b><div><p><b>In Progress</b></p><p>Your Shared Deployment is being migrated.</p></div></div>'))\n", |
282 | 273 | " time.sleep(15)\n",
|
283 | 274 | " status_response = requests.get('{}/v1/sharedtier/virtualWorkspaces/{}/migrations'.format(api_url, workspace_id), headers={'Authorization': 'Bearer {}'.format(connection_password)})\n",
|
284 | 275 | "\n",
|
|
0 commit comments