diff --git a/content/GCP/01_intro_to_cloud_console.ipynb b/content/GCP/01_intro_to_cloud_console.ipynb index d3df3ab..d7a5d60 100644 --- a/content/GCP/01_intro_to_cloud_console.ipynb +++ b/content/GCP/01_intro_to_cloud_console.ipynb @@ -12,9 +12,9 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", - "**Teaching:**\n", + "**Teaching:** 10 min.\n", "\n", - "**Exercises:**\n", + "**Exercises:** 6 min.\n", "\n", "**Questions:**\n", "* How do I find things in the web console?\n", @@ -64,19 +64,20 @@ "tags": [] }, "source": [ - "### Exercise\n", + "```{admonition} Exercise\n", "\n", "Take a few moments to ask yourself the following questions:\n", " * What account are you currently using in the Google Cloud web console?\n", " * Are you logged into any other accounts?\n", " * How do you know which account is being used?\n", " \n", - " If you are not currently using the correct account, switch to it." + " If you are not currently using the correct account, switch to it.\n", + "```" ] }, { "cell_type": "markdown", - "id": "ef4c1470", + "id": "847149e2-bce0-4377-b9fc-ae88d8ba41e8", "metadata": {}, "source": [ "## Projects\n", @@ -95,9 +96,15 @@ "A Project, just like the word, should be associated with a real world project (for example a research effort or grant, lab, or your Ph.D. Project. etc). For Drew, this is the image processing project. In this way it is easier to track and allocate costs and to manage permissions and access for resources within the project.\n", "\n", "The active project is also shown next to the project icon (three hexagons) and clicking it brings up the project selection dialog. The current project has a check mark and the active project can be changed by clicking on the project name or double clicking the row.\n", - " ![select-project](img/select-project.png) \n", - "\n", - "### Exercise\n", + " ![select-project](img/select-project.png) " + ] + }, + { + "cell_type": "markdown", + "id": "45e76bfd-9392-4905-b554-f0a0ad815274", + "metadata": {}, + "source": [ + "```{admonition} Exercise\n", "\n", "Take a few moments to ask yourself the following questions:\n", " * What is the *name* of the Project you are currently using in the Google Cloud Platform web console?\n", @@ -106,12 +113,13 @@ " * Do you have multiple projects?\n", " * How do you know which project you are currently using?\n", "\n", - "If you are currently not using the correct project for this lesson, switch to the correct one." + "If you are currently not using the correct project for this lesson, switch to the correct one.\n", + "```" ] }, { "cell_type": "markdown", - "id": "294a3fa0-7a55-4547-af19-4ef542b8dae7", + "id": "a43bd3bd-2d12-4d24-a59e-707e389b9cd0", "metadata": { "tags": [] }, @@ -128,14 +136,23 @@ " * You can pin frequently used items on the top of this page by clicking on the pin icon. \n", " * Click the hamburger again to hide the Left Sidebar.\n", "\n", - "All the different products and services are the \"What\" of the cloud. We will start with compute, called *Google Compute Engine* in the next Episode. \n", - "\n", - "### Exercise \n", + "All the different products and services are the \"What\" of the cloud. We will start with compute, called *Google Compute Engine* in the next Episode. " + ] + }, + { + "cell_type": "markdown", + "id": "4da0bd01-47f7-40bd-a929-985f63bb1810", + "metadata": { + "tags": [] + }, + "source": [ + "```{admonition} Exercise\n", "\n", "Take a few moments to navigate a few key services.\n", " * Navigate to the \"Compute Engine\" service under the \"Compute\" product group.\n", " * You will probably need to \"Enable\" this service first by clicking on the \"Enable\" button on the \"Compute Engine API\" page. This will only need to be done once per project.\n", - " * Navigate to \"Cloud Storage\" under the \"Storage\" product group and enable the service if necessary." + " * Navigate to \"Cloud Storage\" under the \"Storage\" product group and enable the service if necessary.\n", + "```" ] }, { @@ -201,12 +218,23 @@ "tags": [] }, "source": [ - "## Exercise\n", + "```{admonition} Exercise\n", "\n", "Before we move on, do the following:\n", "* Double check that you are in the correct account and project that you will be using for this lesson.\n", - "* Take a moment to reflect on the \"Who, What, and Where\" of the cloud. Why is this important?\n" + "* Take a moment to reflect on the \"Who, What, and Where\" of the cloud. \n", + " * What is your Who, What, and Where?\n", + " * Why is this important?\n", + "```" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "530f7a45-5708-4213-b120-71c6328f7026", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/content/GCP/02_intro_to_compute.ipynb b/content/GCP/02_intro_to_compute.ipynb index 33ccfba..5f70007 100644 --- a/content/GCP/02_intro_to_compute.ipynb +++ b/content/GCP/02_intro_to_compute.ipynb @@ -12,9 +12,9 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", - "**Teaching:**\n", + "**Teaching:** 45 min.\n", "\n", - "**Exercises:**\n", + "**Exercises:** 6 min\n", "\n", "**Questions:**\n", "* How do I create my own computer in the cloud?\n", @@ -24,8 +24,8 @@ "* Allocate a virtual machine in Google Compute Engine.\n", "* Choose a machine type based on the application.\n", "* Use the cost estimator for Google Compute Engine.\n", - "* Understand what a service account is and how they are used.\n", - "* Learn how to connect to a virtual machine using ssh in the cloud shell with the web console.\n", + "* Learn what a service account is and how they are used.\n", + "* Learn how to connect to a virtual machine using ssh in the Cloud Shell with the web console.\n", "```" ] }, @@ -75,8 +75,21 @@ " * For **Machine type** select *e2-medium* (default). Note that it shows the size of the VM in parentheses. \n", " * In the **Identity and API access** section note that for the **Service Accounts** -> **Service account** option that the **Compute Engine default service account** is selected. This allows the *VM Instance* to access resources in the project. Note: the *\"Allow full access to all Cloud APIs\"* allows *everyone* on the VM to *access and edit all resources in the project*.\n", " * Leave the remaining options as default.\n", - " * Note the **Monthly estimate** in the right side panel. This is only for running the *VM instance* and does not include other storage, networking, compute, and other charges that may occur by running software. Click **Details** show a breakdown of the *VM instance* only costs. **Exercise:** Find the most expensive VM.\n", - " * Finally, click **Create** to create the *VM Instance* (allocate the resource).\n" + " * Note the **Monthly estimate** in the right side panel. This is only for running the *VM instance* and does not include other storage, networking, compute, and other charges that may occur by running software. Click **Details** show a breakdown of the *VM instance* only costs.\n", + "![compute-create-instance](img/compute-create-instance.png) \n", + " * Finally, click **Create** to create the *VM Instance* (allocate the resource).\n", + "![compute-create-instance-ok](img/compute-create-instance-ok.png)\n" + ] + }, + { + "cell_type": "markdown", + "id": "6737d8ba-e6d4-437f-a652-5d9d4477b34c", + "metadata": {}, + "source": [ + "```{admonition} Exercise\n", + "* Find the most expensive VM. **DO NOT actually create! Just cancel!**\n", + "* Find the least expensive VM.\n", + "```" ] }, { @@ -138,7 +151,7 @@ "\n", "Now lets find and connect to the *VM Instance*.\n", " * Navigate to the Google Compute Engine page by clicking **Navigation Menu** -> **Compute Engine** (under Compute) -> **Instances**.\n", - " * **Find** the *VM instance* you just created. You can use the filter to find a bucket if there are a lot of them.\n", + " * **Find** the *VM instance* you just created. You can use the filter to find a *VM instance* if there are a lot of them.\n", " * Click on the *VM instance* name to open the **VM instance details** (it will display as a hyperlink when you hover over the *VM instance* name).\n", "\n", "Navigate to the **dashboard** and you will see **Compute Engine** in the *resources* card. You can click on this to quickly navigate to the compute engine page.\n" @@ -249,20 +262,56 @@ }, { "cell_type": "markdown", - "id": "0362e76c-3f03-4299-8217-24a2f39ee503", + "id": "c59b7e30-95a4-4eb7-91bf-ba30390ed817", + "metadata": { + "tags": [] + }, + "source": [ + "## Delete the VM Instance\n", + "\n", + "```{admonition} Danger\n", + ":class: danger\n", + "\n", + "This will destroy the VM instance and and ALL the data in it! You cannot undelete an instance!\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "31bcefe2-dcf8-42d7-a8b5-76edeb585c7d", + "metadata": { + "tags": [] + }, + "source": [ + "Now that we have made that clear, we will now complete the resource life-cycle by deleting the *VM Instance* we just created. Think about the process we did for creating the bucket and follow a similar one. First, try to do this on your own.\n", + "\n", + "```{admonition} Exercise\n", + "\n", + "* Try to delete the ***VM instance*** on your own\n", + "* Try to follow the process we just learned (hint: *follow* and *enumerate*)\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "de7fff43-be0f-45f1-a950-8d7e8326d328", "metadata": { "tags": [] }, "source": [ - "## Delete the VM - Exercise \n", + "To delete a *VM Instance*:\n", + " * Go to **Navigation Menu** -> **Compute Engine** (under Compute) -> **Instances**.\n", + " * On the row of the virtual machines click the three vertical dots (**kabob**) menu and select **Delete**\n", + " * Click 'Delete' to confirm deleting the instance. \n", "\n", - "We will now complete the resource life-cycle by deleting the *VM Instance* we just created. Think about the process we did for creating the bucket and follow a similar one. \n", + "![compute-delete-instance](img/compute-delete-instance.png)\n", "\n", - "Did you \"Follow\" the bucket by looking at the **activity** page?\n", + "Did you \"Follow\" the bucket by looking at the **activity** page as discussed above?\n", "\n", - "Since we care about paying for resources we are not using we **review** our project by visiting the compute engine service and reviewing that we no longer have any virtual machines (VM) running. \n", + "Since we care about paying for resources we are not using we review our project by visiting the compute engine service and reviewing that we no longer have any virtual machines (VM) running. \n", + " * Go to **Navigation Menu** -> **Compute Engine** (under Compute) -> **Instances** and look for your virtual machine.\n", "\n", - "In later episodes we will show how to easily list all the resources in a project." + "In a later episode we will show how to easily list all the resources in a project." ] }, { diff --git a/content/GCP/05_cli_storage.ipynb b/content/GCP/05_cli_storage.ipynb index 03c6b92..ea543f2 100644 --- a/content/GCP/05_cli_storage.ipynb +++ b/content/GCP/05_cli_storage.ipynb @@ -11,9 +11,9 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", - "**Teaching:**\n", + "**Teaching:** 20 min\n", "\n", - "**Exercises:**\n", + "**Exercises:** 2 min\n", "\n", "**Questions:**\n", "* How do I store data in a Bucket?\n", @@ -53,8 +53,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Your active configuration is: [cloudshell-31923]\n", - "student31@class.internet2.edu\n" + "998995103712-compute@developer.gserviceaccount.com\n" ] } ], @@ -72,8 +71,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Your active configuration is: [cloudshell-31923]\n", - "just-armor-301114\n" + "essentials-learner\n" ] } ], @@ -91,7 +89,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "just-armor-301114\n" + "essentials-learner\n" ] } ], @@ -120,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "id": "255eb914-a06a-4bfd-adbb-7ca2f94678e7", "metadata": {}, "outputs": [ @@ -128,7 +126,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "essentials-learner-2021-12-16\n" + "essentials-learner-2022-01-14\n" ] } ], @@ -139,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "id": "b0661b4c-b56b-4d6d-ba3c-e1c5f38699c6", "metadata": {}, "outputs": [ @@ -147,7 +145,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Creating gs://essentials-learner-2021-12-16/...\n" + "Creating gs://essentials-learner-2022-01-14/...\n" ] } ], @@ -185,7 +183,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/\n" + "gs://essentials-learner-2022-01-14/\n" ] } ], @@ -219,7 +217,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/ :\n", + "gs://essentials-learner-2022-01-14/ :\n", "\tStorage class:\t\t\tSTANDARD\n", "\tLocation type:\t\t\tmulti-region\n", "\tLocation constraint:\t\tUS\n", @@ -231,34 +229,34 @@ "\tRequester Pays enabled:\t\tNone\n", "\tLabels:\t\t\t\tNone\n", "\tDefault KMS key:\t\tNone\n", - "\tTime created:\t\t\tTue, 26 Oct 2021 20:47:06 GMT\n", - "\tTime updated:\t\t\tTue, 26 Oct 2021 20:47:06 GMT\n", + "\tTime created:\t\t\tFri, 14 Jan 2022 22:25:26 GMT\n", + "\tTime updated:\t\t\tFri, 14 Jan 2022 22:25:26 GMT\n", "\tMetageneration:\t\t\t1\n", "\tBucket Policy Only enabled:\tFalse\n", - "\tPublic access prevention:\tunspecified\n", + "\tPublic access prevention:\tinherited\n", "\tRPO:\t\t\t\tDEFAULT\n", "\tACL:\t\t\t\t\n", "\t [\n", "\t {\n", - "\t \"entity\": \"project-owners-1002111293252\",\n", + "\t \"entity\": \"project-owners-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"owners\"\n", "\t },\n", "\t \"role\": \"OWNER\"\n", "\t },\n", "\t {\n", - "\t \"entity\": \"project-editors-1002111293252\",\n", + "\t \"entity\": \"project-editors-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"editors\"\n", "\t },\n", "\t \"role\": \"OWNER\"\n", "\t },\n", "\t {\n", - "\t \"entity\": \"project-viewers-1002111293252\",\n", + "\t \"entity\": \"project-viewers-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"viewers\"\n", "\t },\n", "\t \"role\": \"READER\"\n", @@ -267,25 +265,25 @@ "\tDefault ACL:\t\t\t\n", "\t [\n", "\t {\n", - "\t \"entity\": \"project-owners-1002111293252\",\n", + "\t \"entity\": \"project-owners-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"owners\"\n", "\t },\n", "\t \"role\": \"OWNER\"\n", "\t },\n", "\t {\n", - "\t \"entity\": \"project-editors-1002111293252\",\n", + "\t \"entity\": \"project-editors-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"editors\"\n", "\t },\n", "\t \"role\": \"OWNER\"\n", "\t },\n", "\t {\n", - "\t \"entity\": \"project-viewers-1002111293252\",\n", + "\t \"entity\": \"project-viewers-998995103712\",\n", "\t \"projectTeam\": {\n", - "\t \"projectNumber\": \"1002111293252\",\n", + "\t \"projectNumber\": \"998995103712\",\n", "\t \"team\": \"viewers\"\n", "\t },\n", "\t \"role\": \"READER\"\n", @@ -333,7 +331,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 11, "id": "bb8e7270-2f64-4fbd-b312-b18a7960700f", "metadata": { "scrolled": true, @@ -345,65 +343,55 @@ "output_type": "stream", "text": [ "---\n", - "insertId: -z8eaicef61t3\n", - "logName: projects/just-armor-301114/logs/cloudaudit.googleapis.com%2Factivity\n", + "insertId: 1dyc72ccp1b\n", + "logName: projects/essentials-learner/logs/cloudaudit.googleapis.com%2Factivity\n", "protoPayload:\n", " '@type': type.googleapis.com/google.cloud.audit.AuditLog\n", " authenticationInfo:\n", - " principalEmail: student31@class.internet2.edu\n", + " principalEmail: 998995103712-compute@developer.gserviceaccount.com\n", + " principalSubject: serviceAccount:998995103712-compute@developer.gserviceaccount.com\n", + " serviceAccountDelegationInfo:\n", + " - firstPartyPrincipal:\n", + " principalEmail: service-998995103712@compute-system.iam.gserviceaccount.com\n", " authorizationInfo:\n", " - granted: true\n", - " permission: storage.buckets.create\n", - " resource: projects/_/buckets/essentials-student31-2021-10-26\n", + " permission: serviceusage.services.enable\n", + " resource: projectnumbers/998995103712\n", + " resourceAttributes: {}\n", + " - granted: true\n", + " permission: serviceusage.services.enable\n", + " resource: projectnumbers/998995103712\n", + " resourceAttributes: {}\n", + " - granted: true\n", + " permission: serviceusage.operations.get\n", + " resource: projectnumbers/998995103712/operations/-\n", + " resourceAttributes: {}\n", + " - granted: true\n", + " permission: serviceusage.services.get\n", + " resource: projectnumbers/998995103712/services/-\n", " resourceAttributes: {}\n", - " methodName: storage.buckets.create\n", - " request:\n", - " defaultObjectAcl:\n", - " '@type': type.googleapis.com/google.iam.v1.Policy\n", - " bindings:\n", - " - members:\n", - " - projectViewer:just-armor-301114\n", - " role: roles/storage.legacyObjectReader\n", - " - members:\n", - " - projectOwner:just-armor-301114\n", - " - projectEditor:just-armor-301114\n", - " role: roles/storage.legacyObjectOwner\n", + " methodName: google.longrunning.Operations.GetOperation\n", " requestMetadata:\n", - " callerIp: 35.239.199.87\n", - " callerSuppliedUserAgent: apitools Python/3.7.3 gsutil/5.4 (linux) analytics/disabled\n", - " interactive/True command/mb google-cloud-sdk/361.0.0,gzip(gfe)\n", + " callerIp: 34.94.169.98\n", + " callerNetwork: //compute.googleapis.com/projects/essentials-learner/global/networks/__unknown__\n", + " callerSuppliedUserAgent: google-cloud-sdk gcloud/366.0.0 command/gcloud.logging.read\n", + " invocation-id/90374af093e24c7d941f525d223d83c7 environment/GCE environment-version/None\n", + " interactive/True from-script/False python/3.7.3 term/xterm-256color (Linux 4.19.0-18-cloud-amd64),gzip(gfe)\n", " destinationAttributes: {}\n", " requestAttributes:\n", " auth: {}\n", - " time: '2021-10-26T20:47:05.790066575Z'\n", - " resourceLocation:\n", - " currentLocations:\n", - " - us\n", - " resourceName: projects/_/buckets/essentials-student31-2021-10-26\n", - " serviceData:\n", - " '@type': type.googleapis.com/google.iam.v1.logging.AuditData\n", - " policyDelta:\n", - " bindingDeltas:\n", - " - action: ADD\n", - " member: projectEditor:just-armor-301114\n", - " role: roles/storage.legacyBucketOwner\n", - " - action: ADD\n", - " member: projectOwner:just-armor-301114\n", - " role: roles/storage.legacyBucketOwner\n", - " - action: ADD\n", - " member: projectViewer:just-armor-301114\n", - " role: roles/storage.legacyBucketReader\n", - " serviceName: storage.googleapis.com\n", - " status: {}\n", - "receiveTimestamp: '2021-10-26T20:47:06.793562424Z'\n", + " time: '2022-01-14T22:34:23.880895Z'\n", + " resourceName: projects/998995103712/operations/acf.p2-998995103712-a617aa34-1a77-414c-bba6-7f6c931297db\n", + " serviceName: serviceusage.googleapis.com\n", + "receiveTimestamp: '2022-01-14T22:34:23.996006156Z'\n", "resource:\n", " labels:\n", - " bucket_name: essentials-student31-2021-10-26\n", - " location: us\n", - " project_id: just-armor-301114\n", - " type: gcs_bucket\n", + " method: google.longrunning.Operations.GetOperation\n", + " project_id: essentials-learner\n", + " service: serviceusage.googleapis.com\n", + " type: audited_resource\n", "severity: NOTICE\n", - "timestamp: '2021-10-26T20:47:05.785456012Z'\n" + "timestamp: '2022-01-14T22:34:23.839589Z'\n" ] } ], @@ -411,6 +399,23 @@ "gcloud logging read --limit 1" ] }, + { + "cell_type": "markdown", + "id": "e9e48571-80fa-40cc-838f-ec5ea3000bd7", + "metadata": {}, + "source": [ + "````{admonition} Note\n", + ":class: note\n", + "\n", + "You will probably need to enable the logging api to continue, press `y` to accept as shown below:\n", + "```\n", + "API [logging.googleapis.com] not enabled on project [998995103712]. Would you \n", + "like to enable and retry (this will take a few minutes)? (y/N)?\n", + "```\n", + "\n", + "````" + ] + }, { "cell_type": "markdown", "id": "fcdf7049-620f-4721-bc62-fa8f7fe97dcb", @@ -431,7 +436,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 13, "id": "f9a90752-871f-4156-b122-4c46fd4bfa43", "metadata": {}, "outputs": [], @@ -449,7 +454,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 14, "id": "bc0fb778-cc2e-4af4-8aa8-ca90d6b4f877", "metadata": {}, "outputs": [ @@ -475,7 +480,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 15, "id": "6384974b-d422-4ac1-90b7-cf9feec9aa8c", "metadata": {}, "outputs": [ @@ -495,7 +500,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 16, "id": "49589119-56bb-4c7b-b0a6-36e8f1133056", "metadata": {}, "outputs": [ @@ -503,7 +508,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/1\n" + "gs://essentials-learner-2022-01-14/1\n" ] } ], @@ -529,7 +534,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 17, "id": "442cc51f-8856-41d4-a3a6-072c8569beef", "metadata": {}, "outputs": [ @@ -547,7 +552,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 18, "id": "4e3c0de9-8a23-428a-9689-0cf896228afe", "metadata": {}, "outputs": [ @@ -573,7 +578,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 19, "id": "13f94b36-7dea-46b9-9e8b-baa8b4e59de6", "metadata": {}, "outputs": [ @@ -581,7 +586,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Copying gs://essentials-student31-2021-10-26/1...\n", + "Copying gs://essentials-learner-2022-01-14/1...\n", "/ [1 files][ 9.0 B/ 9.0 B] \n", "Operation completed over 1 objects/9.0 B. \n" ] @@ -593,7 +598,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 20, "id": "3982f21c-b827-4772-aa8c-3ac67e478b0d", "metadata": {}, "outputs": [ @@ -619,7 +624,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 21, "id": "6b57a3fc-94ea-4c25-b7ac-2744d7b28852", "metadata": {}, "outputs": [ @@ -645,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 22, "id": "5a7fc453-fca7-4ab4-8f0a-cb4de53bc992", "metadata": {}, "outputs": [ @@ -673,7 +678,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 23, "id": "1be58d86-5de7-420c-a3b3-0b82839ac90f", "metadata": {}, "outputs": [ @@ -681,8 +686,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/1\n", - "gs://essentials-student31-2021-10-26/2\n" + "gs://essentials-learner-2022-01-14/1\n", + "gs://essentials-learner-2022-01-14/2\n" ] } ], @@ -695,12 +700,15 @@ "id": "1427e837-f65f-4d35-8088-6a82677b5ed6", "metadata": {}, "source": [ - "Exercise: display the date in the bucket." + "```{admonition} Exercise\n", + "\n", + "* Display the date in the bucket.\n", + "```" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 24, "id": "e3d0585b-4d81-4429-ad90-b3ff51eec13d", "metadata": {}, "outputs": [ @@ -708,7 +716,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Tue 26 Oct 2021 07:49:59 PM UTC\n" + "Fri Jan 14 22:35:35 UTC 2022\n" ] } ], @@ -726,7 +734,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 25, "id": "9ad460d9-7a4f-4e3f-befb-2bbb10c51993", "metadata": {}, "outputs": [ @@ -734,7 +742,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Removing gs://essentials-student31-2021-10-26/1...\n", + "Removing gs://essentials-learner-2022-01-14/1...\n", "/ [1 objects] \n", "Operation completed over 1 objects. \n" ] @@ -746,7 +754,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 26, "id": "8fd782f2-700a-4862-970b-1b4751009d5f", "metadata": {}, "outputs": [ @@ -754,7 +762,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/2\n" + "gs://essentials-learner-2022-01-14/2\n" ] } ], @@ -772,7 +780,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 27, "id": "e1350695-0f01-4205-a604-91d62896783e", "metadata": {}, "outputs": [ @@ -780,8 +788,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Removing gs://essentials-student31-2021-10-26/...\n", - "NotEmptyException: 409 BucketNotEmpty (essentials-student31-2021-10-26)\n" + "Removing gs://essentials-learner-2022-01-14/...\n", + "NotEmptyException: 409 BucketNotEmpty (essentials-learner-2022-01-14)\n" ] } ], @@ -800,7 +808,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 28, "id": "ba2671f8-521f-48b4-9231-491d128ba67c", "metadata": {}, "outputs": [ @@ -808,7 +816,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Removing gs://essentials-student31-2021-10-26/2...\n", + "Removing gs://essentials-learner-2022-01-14/2...\n", "/ [1 objects] \n", "Operation completed over 1 objects. \n" ] @@ -818,20 +826,20 @@ "gsutil rm \"gs://$BUCKET/2\"" ] }, - { - "cell_type": "markdown", - "id": "9540ba16-1662-49b5-9bf7-87c5c49b1e2c", - "metadata": {}, - "source": [ - "Finally we can remove the bucket. We first double check the value of `$BUCKET`" - ] - }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 29, "id": "73d8b299-8e8e-443e-ae5b-4ecf7efa0442", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gs://essentials-learner-2022-01-14/\n" + ] + } + ], "source": [ "gsutil ls" ] @@ -847,7 +855,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 30, "id": "7b32764d-e7b5-42d6-8f88-bc6936b2024a", "metadata": {}, "outputs": [ @@ -855,7 +863,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "gs://essentials-student31-2021-10-26/\n" + "gs://essentials-learner-2022-01-14/\n" ] } ], @@ -873,7 +881,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 31, "id": "82487bd8-14f4-4811-8f5a-dd346042bd0f", "metadata": {}, "outputs": [ @@ -881,7 +889,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Bucket: essentials-student31-2021-10-26\n" + "Bucket: essentials-learner-2022-01-14\n" ] } ], @@ -891,7 +899,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 32, "id": "8635db94-2f3c-46d2-acc2-76a176fb37e7", "metadata": {}, "outputs": [ @@ -899,7 +907,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Removing gs://essentials-student31-2021-10-26/...\n" + "Removing gs://essentials-learner-2022-01-14/...\n" ] } ], @@ -917,7 +925,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 33, "id": "ed6f0204-0de2-4d20-ab00-3b7a1023fd86", "metadata": {}, "outputs": [], diff --git a/content/GCP/img/api-enable-compute-engine.png b/content/GCP/img/api-enable-compute-engine.png new file mode 100644 index 0000000..f5d4d5a Binary files /dev/null and b/content/GCP/img/api-enable-compute-engine.png differ diff --git a/content/GCP/img/compute-create-instance-ok.png b/content/GCP/img/compute-create-instance-ok.png new file mode 100644 index 0000000..3d1614d Binary files /dev/null and b/content/GCP/img/compute-create-instance-ok.png differ diff --git a/content/GCP/img/compute-create-instance.png b/content/GCP/img/compute-create-instance.png new file mode 100644 index 0000000..1de2241 Binary files /dev/null and b/content/GCP/img/compute-create-instance.png differ diff --git a/content/GCP/img/compute-delete-instance.png b/content/GCP/img/compute-delete-instance.png new file mode 100644 index 0000000..e67a38a Binary files /dev/null and b/content/GCP/img/compute-delete-instance.png differ