This week we will study some Web Resources which train us to use Google GCP which is a competitor of Amazon AWS:
https://codelabs.developers.google.com/cpb100
**
Feb 18:
This week we will study some Web Resources which train us to use Google GCP which is a competitor of Amazon AWS:
https://codelabs.developers.google.com/cpb100
This will be a repeat of the Feb 15 Meetup.
**
Feb 24:
This week we will study some Web Resources which train us to use Google GCP which is a competitor of Amazon AWS:
http://cs101.us
https://codelabs.developers.google.com/cpb100
**
Feb 25:
This week we will study some Web Resources which train us to use Google GCP which is a competitor of Amazon AWS:
http://cs101.us
https://codelabs.developers.google.com/cpb100
**
Mar 2:
LOCATION: 333 W. Maude [Maude and Mathilda] #110
This week we will study some Web Resources which train us to use Google GCP which is a competitor of Amazon AWS:
http://cs101.us
https://codelabs.developers.google.com/cpb100
If you want to sign up for a free GCP account, bring your laptop, gmail-account, and a credit card.
The WIFI at this location is EXCELLENT.
We offer: Table, Chair, Power, and WIFI.
This 2 hour Meetup is timed to start at 5pm Friday so you can attend Free-Training rather than sit in traffic.
**
This is the MEAT of what Dan Bikle is teaching:
https://cs101.herokuapp.com/lessons
https://cs101.herokuapp.com/lessons/lesson001
Computer Science 101 cs101.us About Blog Contact Links Lessons |
Lesson 001 [ Google GCP ]I have taught this lesson several times now.Most of this lesson is done with a browser. I offer tips for success.
I created 7 tabs in that window. In tab 1 I loaded this URL: http://cs101.us In tab 2 I loaded this URL: https://codelabs.developers.google.com/cpb100 In tab 3 I loaded this URL: https://github.com/GoogleCloudPlatform In tab 4 I loaded this URL: https://console.cloud.google.com In tabs 5,6,7 I had done nothing (yet). After I created the 7 tabs, my Chrome-window looked like this: I clicked on tab 2, the codelabs-tab. I continued this lesson by studying the URL listed below: https://codelabs.developers.google.com/cpb100 On that page I assume the correct ordering of some links is listed below:
Free-Trial
Next, in the codelabs-tab, I clicked this link:
https://codelabs.developers.google.com/codelabs/cpb100-free-trialI saw a simple path through 4 pages. The third page had a noteworthy URL I used to get $300 of cloud-credit from Google: I loaded the URL into the GCP-tab: https://console.developers.google.com/freetrial I logged in using my gmail account. It worked well; I gave it my credit-card info. It gave me $300 of cloud-credit from Google. I hope that you can also get that credit. Next, I visited the URL listed below: https://console.cloud.google.com/projectcreate I used that page to create a project called cpb100. Google needed 4 minutes to create project cpb100. Although I wanted the name to be cp100, Google added some text to the end of the name: cpb100-195004 Google created a URL for the project: https://console.cloud.google.com/home/activity?project=cpb100-195004 In the upper right I saw a blue-button called "UPGRADE". I clicked the button. Next, I accepted the upgrade offer because I wanted access to services required by future training sessions. Then I verified that the "hamburger-link" in the upper-left behaved well when I clicked it. It did behave well and I was ready to move on. In the codelabs-tab, I returned to the URL listed below: https://codelabs.developers.google.com/cpb100 [top] Compute-EngineNext, in the codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-compute-engine I quickly clicked through the first two links in that page and landed at this URL: https://codelabs.developers.google.com/codelabs/cpb100-compute-engine/#2 It asked me to click the upper-left-hamburger-link in my project page. I went to the GCP-tab and did that. Then I followed the advice to click the "Compute Engine" link on the left: https://console.cloud.google.com/compute I saw this: I clicked the "Create" button. It served me a form from this URL: https://console.cloud.google.com/compute/instancesAdd I saw this: I clicked radio-button: "Allow full access to all Cloud APIs" I deviated from the tutorial and clicked the link: "SSH keys" Note: If you are on windows, you can get ssh from the URL listed below: https://git-scm.com/download/win My intent was to ease my ability to ssh into the GCP-Instance from a shell in my laptop. The text I mouse-copied into the GCP SSH-key-form came from this file: ~/.ssh/id_rsa.pub It looks like this:
The last line asks GCP to create a Linux account named "dan" in the new Linux instance. I saw this: Next, I clicked the blue "Create" button. GCP started the instance in about 1 minute. I saw the corresponding IP address: 35.229.101.148 I saw this: I tried to login with this shell command:
I used a shell command which asked to login as "dan".
If you do not know how to start a shell on your laptop, you should click the SSH-link in your GCP-tab: Next, I returned to the codelabs-tab; I studied the instructions in this page: https://codelabs.developers.google.com/codelabs/cpb100-compute-engine/#4 I returned to my shell-window. I followed instructions I had just read:
In the codelabs-tab, I returned to the URL listed below: https://codelabs.developers.google.com/cpb100 That ended my interaction with the CPB100-node I call: "Compute-Engine". [top] Cloud-StorageNext, in the codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage I studied the page there and clicked through until I landed at this URL: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#2 I verified that I could ssh into the GCP instance I had created earlier. I saw this: After the instance served me a shell prompt, I issued a shell command:
I ran more shell commands:
https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#3 I read the content on that page. Next, I clicked the github-tab. I visited the URL below: https://github.com/GoogleCloudPlatform/datalab-samples/blob/master/basemap/earthquakes.ipynb I studied the above page. I returned to the shell. I ran two shell commands inside the GCP instance:
I noticed a new file which python created:
In the codelabs-tab, I clicked the next node in the page and landed on this URL: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#4 I clicked on the GCP-tab. I visited the URL below: https://cloud.google.com/ I hovered the button: "GO TO CONSOLE". I made note of its href-URL: https://console.cloud.google.com I clicked the button. It sent me to a page I call: "Dashboard". I clicked the upper-left-hamburger-link and from there clicked: "Storage". It served me a page with blue-button: "Create bucket". I clicked "Create bucket". It served me a form asking me to name a new bucket. I called my new bucket: cs101feb2018 In retrospect, I can see now that was a poor naming choice. Now I know to create buckets with shorter names. At the bottom of the form I clicked the blue "Create" button. I saw evidence that it worked. It served me a page, called "Browser", prompting me to upload files into the bucket. The page reminds me of the page served to me by AWS when I work with S3. I saw this: In the codelabs-tab, I returned to the cpb100 page: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#4 I clicked the next node in the page and landed on this URL: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#5 I returned to the shell prompt of my GCP instance and type a command:
I verified by returning to the "Browser" page in the GCP-tab and inspecting the contents of cs101feb2018. It listed three files:
In the codelabs-tab, I returned to the cpb100 page: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#5 I clicked the next node in the page and landed on this URL: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#6 I returned to the "Browser" page in the GCP-tab. I checked the boxes to "Share publicly" the three files in cs101feb2018. I list the resulting URLs below:
The google server asked me to authenticate. Google should not force me to login to gmail in order to see publicly-shared content. Based on this "feature", AWS-S3 is clearly superior to GCP-Storage. In the codelabs-tab, I returned to the cpb100 page: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#6 I clicked the next node in the page and landed on this URL: https://codelabs.developers.google.com/codelabs/cpb100-cloud-storage/#7 I followed the instructions in that page to delete my GCP instance. I saw this: In the codelabs-tab, I returned to the URL listed below: https://codelabs.developers.google.com/cpb100 That ended my interaction with the CPB100-node I call: "Cloud-Storage". [top] Cloud-SqlThis sub-lesson has many steps and offers many opportunities to get lost.Good Luck! In the codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#0 I studied the next page in sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#1 I studied the next page in sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#2 In the GCP-tab, I visited this URL: https://console.cloud.google.com I found the tiny "Cloud-Shell" button near the upper-right. I hovered it to see: "Activate Google Cloud Shell". I saw this: I clicked it. A dark window appeared at the bottom. After 15 seconds, a white shell prompt appeared in the window. I tried some shell commands and saw this:
I moved that tab so it was tab #5, the tab after GCP-tab. After that, GCP issued an error. I sense that it some kind of GCP-bug: It is unfortunate that GCP lacks reliability. The error suggested that I send feedback. So I did that and halted my activity in this lab for a day. After 24 hours, I continued. In GCP-tab I started a new Cloud-Shell. I move the shell to its own tab (tab #5). Cloud-Shell stopped issuing errors. In the codelabs-tab, I returned my attention to this page: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#2 In the Cloud-Shell-tab, I typed a shell command which looked familiar:
I returned to the codelabs-tab. I navigated to the next page in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#3 I returned to the Cloud-Shell-tab. I ran another command:
I verified success of the above command by visiting an appropriate URL: https://console.cloud.google.com/storage/browser/cs101feb2018/sql/ I returned to the codelabs-tab. I navigated to the next page in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#4 I studied that page. The page listed 10 steps. To start step 1, clicked the GCP-tab and I visited this URL: https://console.cloud.google.com I clicked the upper-left-hamburger-link and from there clicked: "SQL". It served me a page describing: "Cloud SQL Instances"
I clicked the blue: "Create instance" button. In the next page I picked the MySQL radio-button. I clicked the blue: "Next" button. I saw this: I clicked the blue: "Choose Second Generation" button. The next page landed me in a field: "Instance ID". I entered string: "rentals". I entered root password: "root". I saw this: I clicked the blue "Create" button. GCP served me a page with information about my new db instance:
Next I clicked the Cloud-Shell-tab. I ran shell commands:
If you have problems getting permissions granted, GCP allows you to grant permissions in a web page. A clue to do that is described below: In the GCP-tab, visit this URL: https://console.cloud.google.com/sql Then look for a link for the MySQL instance. Under that link find the authorization form. I saw this: Enough about that; back to the lesson. In the codelabs-tab, I navigated to the next page in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#5 I studied that page. The page listed 4 steps. To start step 1, in the GCP-tab, I navigated to the URL listed below: https://console.cloud.google.com/sql I clicked the link called "rentals" which is the name of the Instance I created earlier. I clicked "Import" at the top. GCP served a page: "Import data from Cloud Storage" I saw this: I clicked the button named: "Browse". GCP served a link named: "cs101feb2018" which is the name of the bucket I created earlier. I clicked the "cs101feb2018" link. GCP showed three files and a folder named "sql" in that bucket. I clicked "table_creation.sql" in that folder. I saw this: GCP activated a blue button named "Import". I saw this: I clicked the button. GCP got busy for 10 seconds and then indicated success with a green-check-mark. I saw this: In the codelabs-tab, I navigated to the next page in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#6 I studied that page. The page listed 3 steps. To start step 1, in the GCP-tab, I navigated to the URL listed below: https://console.cloud.google.com/sql I clicked the link called "rentals" which is the name of the Instance I created earlier. I clicked "Import" at the top. I browsed to accommodation.csv and selected it. GCP served me a page: "Import data from Cloud Storage" I selected radio-button: "CSV". I selected database: "recommendation_spark". In the next field, I entered string: "Accommodation". GCP responded by activating the blue "Import" button. I saw this: I clicked the button. GCP quickly served me a page named "Instance details". Quickly after that it served a green-check-mark to indicate success. I clicked "Import" at the top. I browsed to rating.csv and selected it. GCP served me a page: "Import data from Cloud Storage" I selected radio-button: "CSV". I selected database: "recommendation_spark". In the "Table" field, I entered string: "Rating". GCP responded by activating the blue "Import" button. I clicked the button. GCP quickly served me a page named "Instance details". Quickly after that it served a green-check-mark to indicate success. In the codelabs-tab, I visited the next page in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-cloud-sql/#7 I studied that page. The page contained 5 steps. To start step 1, in the GCP-tab, I visited this page: https://console.cloud.google.com/sql I used that page to get the IP address of the MySQL instance: 104.197.219.252 Next, in the Cloud-Shell-tab, I entered a shell command:
So, GCP gave it a new IP address. It was up to me tell MySQL about this problem. I tried these shell commands:
[top] DataprocNext, in the codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-dataproc I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#0 In the Cloud-Shell tab I verifed that repo: "training-data-analyst" was still available. I verified that my MySQL instance and tables were still available. In the codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#1 I studied the page it served me. I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#2 I studied the page it served me. In the GCP-tab I noted the region of my Cloud SQL instance: "us-central1". I clicked the upper-left-hamburger-link and from there clicked: "Dataproc". GCP served me a page with blue-button: "Enable API". I clicked it. GCP served me a page with blue-button: "Create cluster". I saw this: I clicked it. GCP served me a form to configure the cluster. I ensured the cluster was in same region as my Cloud SQL instance: "us-central1". I changed machine type of both master and worker nodes to: "2vCPUs 7.5 GB memory" I specified the cluster have two nodes (the minimum). I saw this: I clicked the blue-button: "Create". GCP served a page indicating it was busy building the cluster. I saw this: Eventually, it finished. I saw this: In Cloud-Shell-tab I issued shell commands:
https://console.cloud.google.com/dataproc/clusters In Cloud-Shell-tab I tried this shell command:
https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#3 I studied that page. I ran a shell command to open an editor in Cloud-Shell-tab:
I saw this: I entered a shell command:
https://console.cloud.google.com/dataproc/clusters/ I clicked the "Jobs" icon on the left. It served me a page with blue-button: "Submit job". I clicked "Submit job". GCP served me a job-submission form for Hadoop. I changed the job-type to: "PySpark" I indicated the location of the Python script to be this:
Near the bottom, I clicked on the blue-button: "Submit" GCP accepted the job and then gave it a status of: "Running". I saw this: After two minutes, GCP changed the status to "Succeeded". In codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#4 I studied that page. In GCP-tab, I got the IP address of MySQL from this URL: https://console.cloud.google.com/sql/instances In Cloud-Shell-tab, I verified that I could connect to MySQL.
I got authorization again with these shell commands:
So, I see that as solid evidence that I was able to finish the Dataproc lab. In the codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-dataproc/#5 I studied that page. In the GCP-tab, I visited this URL: https://console.cloud.google.com/sql/instances I selected my instance and asked GCP to delete it to prevent more charges against my account. I visited this URL: https://console.cloud.google.com/dataproc I selected my instance and asked GCP to delete it to prevent more charges against my account. That ended my interaction with the CPB100-node I call: "Dataproc". [top] DatalabNext, in codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-datalab I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-datalab/#0 I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-datalab/#1 In the GCP-tab, I visited the URL below: https://console.cloud.google.com In the Cloud-Shell-tab I entered a command:
I entered a shell command:
https://console.cloud.google.com/apis/library/sourcerepo.googleapis.com The above page served a blue-button: "ENABLE". I clicked the button. In Cloud-Shell-tab I entered a shell command:
The button looks like this: I opted to change the port: I changed the port to 8081 and clicked through. GCP loaded a page from this URL: https://8081-dot-3516970-dot-devshell.appspot.com/tree/datalab/notebooks# I made sure that page was in tab 6, the tab after the Cloud-Shell-tab. I call tab 6 the DataLab-tab. I captured an image of the page: In the GCP-tab, I visited this URL: https://console.cloud.google.com/compute/instances The page told me that GCP had just started an VM instance named "mydatalabvm". I saw this: In codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-datalab/#2 I studied the page. I ran an experiment to verify the information there:
[top] Bigquery-DatasetIn codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-bigquery-dataset I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-bigquery-dataset/#0 I clicked the next node in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-bigquery-dataset/#1 I studied that page. I clicked the next node in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-bigquery-dataset/#2 I studied that page. In DataLab-tab, I verified this URL was active: https://8081-dot-3516970-dot-devshell.appspot.com/tree/datalab# In codelabs-tab, I clicked the next node in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-bigquery-dataset/#3 I studied that page. In DataLab-tab, I visited this URL: https://8081-dot-3516970-dot-devshell.appspot.com/tree/datalab# I clicked the +notebook button. The server responded with a page which reminds me of a Jupyter Notebook UI: In Github-tab, I visited this URL: demandforecast.ipynb I copied some Python syntax from demandforecast.ipynb into the field in the new notebook UI: So, I was bouncing between the Github-tab and DataLab-tab. In the DataLab-tab, I asked the UI to run it. It ran fine. I continued the process of copy-paste-run on each section of code I found in demandforecast.ipynb Each section ran just as expected. Next, in GCP-tab, I visited this URL: https://console.cloud.google.com/compute/instances I stopped mydatalabvm to avoid adding costs to my account. That ended my interaction with the CPB100-node I call: "Bigquery-Dataset". [top] TensorFlowIn codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-tensorflow I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-tensorflow/#0 I studied the next page: https://codelabs.developers.google.com/codelabs/cpb100-tensorflow/#1 I studied the next page: https://codelabs.developers.google.com/codelabs/cpb100-tensorflow/#2 In GCP-tab, I visited the console-URL: https://console.cloud.google.com In Cloud-Shell-tab, I issued a shell command:
GCP loaded this URL into my browser: https://8081-dot-3516970-dot-devshell.appspot.com/tree/datalab/notebooks I move that page so it occupied DataLab-tab [ tab 6 ]. I clicked the +notebook button in upper-left. GCP served a page with name: "Untitled Notebook1". The page offered an input field for notebook commands. The author of this notebook server assumes that I know how to operate a Python Jupyter notebook. A GCP-datalab notebook offers behavior similar to a Jupyter notebook. In Github-tab, I visited the URL listed below which offers syntax for a Jupyter notebook: demandforecast.ipynb I scrolled to this h2-element [about 2/3 to page-end]: "Machine Learning with Tensorflow": I studied four paragraphs below the h2-element. I studied the Python syntax below the paragraphs:
I copied syntax from demandforecast.ipynb into "Untitled Notebook1", in DataLab-tab. I did the copying bit-by-bit; I was patient. I wanted to study the output at a slow pace. Eventually I worked all the way through the syntax in: demandforecast.ipynb Next, in GCP-tab, I visited this URL: https://console.cloud.google.com/compute/instances I stopped mydatalabvm to avoid adding costs to my account. That ended my interaction with the CPB100-node I call: "TensorFlow". [top] Translate-APIIn codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-translate-api I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-translate-api/#0 I studied the next page: https://codelabs.developers.google.com/codelabs/cpb100-translate-api/#1 I studied the next page: https://codelabs.developers.google.com/codelabs/cpb100-translate-api/#2 In GCP-tab, I visited this URL: https://console.cloud.google.com/apis I saw a blue-button: "ENABLE APIS AND SERVICES". I clicked it. GCP served me a large list of APIs. I enabled: "Google Cloud Vision API". GCP served me this page: https://console.cloud.google.com/apis/api/vision.googleapis.com/overview I clicked the credentials-key-icon on the left. It served me a blue-button: "Create credentials". I clicked it. At that point the UI mis-matched the instructions I was following in cpb100. So I was confused. I visited this URL: https://console.cloud.google.com/apis/credentials/wizard From select-option control I picked value: "Google Cloud Vision API". Next I picked radio-button: "Yes I am using one or both". I clicked blue-button: "What credentials do I need?" GCP served me a message: "You don't need to create new credentials" So, I clicked blue-button: "Done". I followed the same process to enable Translate API, Speech API, and Natural Language APIs. In codelabs-tab, I studied the next codelabs-page: https://codelabs.developers.google.com/codelabs/cpb100-translate-api/#3 In GCP-tab, I visited my console URL: https://console.cloud.google.com In Cloud-Shell-tab, I entered a shell command:
The Datalab URL served to me looked like this: https://8081-dot-3516970-dot-devshell.appspot.com/tree/datalab/notebooks# I moved that page so it was tab 6, the DataLab-tab. In codelabs-tab, I studied the next codelabs-page: https://codelabs.developers.google.com/codelabs/cpb100-translate-api/#4 I visited the GCP-tab and loaded a URL: https://console.cloud.google.com/apis I clicked credentials-icon on left. I clicked blue-button: "Create credentials". I clicked API-key. GCP gave me this key:
mlapis.ipynb I studied comments in that page. I returned to my Datalab-tab. I clicked +Notebook It served me a new notebook with a field for syntax. I typed in this syntax:
Next, one field at a time, I carefully copy-pasted syntax from Github-tab to my Datalab-tab. I saw responses from GCP which matched information in the Github-tab. So, I am confident I completed the lab with no error. In my GCP-tab I loaded this URL: https://console.cloud.google.com/compute/instances I stopped the instance named: "mydatalabvm". Next, I loaded this URL: https://console.cloud.google.com/apis/credentials I used the trash-can-icon to remove the API key I no longer needed. That ended my interaction with the CPB100-node I call: "Translate-API". [top] Serverless-IngestIn codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest/#0 I clicked the next node in the sequence: https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest/#1 In Cloud-Shell-tab, I issued a command:
It means that I had already git-cloned training-data-analyst. I responded with a shell command:
https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/CPB100/lab2b/scheduled/ingestapp.py The script is a simple Python Flask App. This app has one interesting route:
http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.csv Flask transforms the CSV-data into an image of earthquake activity. This happens during a Flask response to a request of the '/ingest' route. Near the end of the response, Flask uploads the image to GCP-Cloud-Storage. The author of the script separated ingest_last_week() into sections:
In codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest/#2 I studied the above page. In Cloud-Shell-tab I ran a command:
After the host is available, root should run shell commands:
Then, Docker should make /app the Current Working Directory. Next, Docker should run a shell command:
I assume that after Docker runs ingestapp.py, then a Flask app will be running on the host. In codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest/#3 I studied the above page. In Cloud-Shell-tab, I used the nano editor to enhance cron.yaml:
That bucket is named: "cs101feb2018". In Cloud-Shell-tab, I used the nano editor to enhance app.yaml:
https://codelabs.developers.google.com/codelabs/cpb100-serverless-ingest/#4 I studied the above page. In Cloud-Shell-tab, I ran a shell command:
I decided to abandon this effort. Perhaps in the future I will encounter App-Engine training content which works better. That ended my interaction with the CPB100-node I call: "Serverless-Ingest". [top] Distributed-LandsatIn codelabs-tab, I clicked the next link in the series:https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat I studied the page it served me: https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat/#0 I studied the next page it served me: https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat/#1 In the GCP-tab I visited this URL: https://console.cloud.google.com/apis I clicked the blue-button: "ENABLE APIS AND SERVICES". I searched for: "Google Dataflow API". I found it; I enabled it. In codelabs-tab, I clicked the next link in the series: https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat/#2 I studied that page. In tab-7 I visited the URL below: how-to-do-distributed-processing-of-landsat-data-in-python In Github-tab, I visited the URL below: dfndvi.py In the above page I studied the run() method. Below, I list sections of that method which I see:
https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat/#3 I studied that page. In Cloud-Shell-tab, I ran commands:
I ran two shell scripts I found in the folder:
https://codelabs.developers.google.com/codelabs/cpb100-distributed-landsat/#4 I studied that page. In GCP-tab, I visited the URL below: http://console.cloud.google.com/dataflow I saw this: I saw that as good evidence that my DataFlow job was running. Eventually, it finished: In GCP tab I visited URL: http://console.cloud.google.com/storage I searched about and found much output from DataFlow: That ended my interaction with the CPB100-node I call: "Distributed-Landsat" Also that ended my interaction with the CPB100. [top] |
cs101.us | About Blog Contact Links Lessons |
**
https://cs101.herokuapp.com/lessons/lesson002
Lesson 002 [ More Google GCP ]I have taught this lesson several times now.Most of this lesson is done with a browser. I offer tips for success.
I created 7 tabs in that window. In tab 1 I loaded this URL: http://cs101.us In tab 2 I loaded this URL: https://codelabs.developers.google.com/cp100 In tab 3 I loaded this URL: https://github.com/GoogleCloudPlatform In tab 4 I loaded this URL: https://console.cloud.google.com In tabs 5,6,7 I had done nothing (yet). After I created the 7 tabs, my Chrome-window looked like this: I clicked on tab 2, the codelabs-tab. I continued this lesson by studying the URL listed below: https://codelabs.developers.google.com/cp100 I saw this: On that page I assume the correct ordering of links is listed below:
Free-Trial
Next, in the codelabs-tab, I clicked this link:
https://codelabs.developers.google.com/codelabs/cp100-free-trialI saw a simple path through 4 pages. The third page had a noteworthy URL I used to get $300 of cloud-credit from Google: I loaded the URL into tab 3, the GCP-tab: https://console.developers.google.com/freetrial I logged in using my gmail account. It worked well; I gave it my credit-card info. It gave me $300 of cloud-credit from Google. I hope that you can also get that credit. Next, I visited the URL listed below: https://console.cloud.google.com/projectcreate I used that page to create a project called cp100. After I created cp100, GCP displayed a "CP100" select-option-link at the top of every GCP page in my GCP-tab: That ended my interaction with the CP100-node I call: "Free-Trial". [top] Cloud-LauncherNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-cloud-launcherI studied this page: https://codelabs.developers.google.com/codelabs/cp100-cloud-launcher/#1 I studied this page: https://codelabs.developers.google.com/codelabs/cp100-cloud-launcher/#2 In the GCP-tab of my browser, I confirmed that I had project CP100 loaded. I visited this URL: https://console.cloud.google.com/ I saw this: I clicked the "upper-left-hamburger-link": I clicked "APIs & Services": I saw this: Near the top I clicked blue-button: "ENABLE APIS AND SERVICES": I searched for "Compute Enginge". I found it: I clicked the blue-button: "ENABLE". After two minutes, GCP signaled success. I returned to the codelabs-tab. I studied the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-launcher/#3 I returned to the GCP-tab. I clicked the "upper-left-hamburger-link". I clicked "Cloud-Launcher": I found LAMP by Bitnami: I clicked blue-button: "LAUNCH ON COMPUTE ENGINE". After a short delay, GCP served me a configuration page: I assumed that the default configuration was fine for my training. I clicked the blue-button: "Deploy". GCP served status during deployment: In the codelabs-tab, I studied the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-launcher/#4 In the GCP-tab I clicked the link site address near the top. A LAMP server responded: I closed that tab. In the GCP-tab I clicked the SSH link: After 30 seconds, GCP served me an SSH window: In that window I issued shell commands:
The LAMP server appeared in a new tab with this URL: http://146.148.39.70/ I enhanced the URL: http://146.148.39.70/phpinfo.php The server responded with configuration information: The above page convinced me that I successfully completed this exercise. In the GCP-tab I clicked the blue-trashcan-button "DELETE" near the top: GCP deleted that server for me. That ended my interaction with the CP100-node I call: "Cloud-Launcher". [top] App-EngineNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-app-engine I saw this: I studied that page. I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#1 I studied the page. I bookmarked useful links in that page:
https://codelabs.developers.google.com/codelabs/cp100-app-engine/#2 I studied the page. In the GCP-tab of my browser, I loaded a URL: https://console.cloud.google.com/ I clicked the upper-left-hamburger-link. From there I picked "Source Repositories": GCP served me a page. I clicked blue-button "CREATE REPOSITORY": GCP asked me to name my new repository. I called it: "default": GCP served me a page: At the upper-right of that page I clicked a small icon to activate: "Cloud-Shell": I moved the Cloud-Shell window into its own tab (tab 5). I changed the text to be black on white: In that Cloud-Shell-tab, I entered commands:
https://github.com/GoogleCloudPlatformTraining/cp100-bookshelf I saw this: I studied the URLs listed below:
This file looked interesting: container-engine/Dockerfile In the codelabs-tab, I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#3 I studied the page. In the GCP-tab I loaded this URL: https://console.cloud.google.com/code I studied the page and recognized it as a git repo. I saw this: I clicked the folder: "app-engine". I clicked the file: "app.yaml". I saw that it was a simple yaml file. I clicked the folder: "app-engine". I clicked the file: "main.py". I saw that it was a simple Python file. I clicked the folder: "app-engine". I clicked the file: "config.py". I saw that it was a simple Python file. I clicked the folder: "app-engine". I clicked the folder: "bookshelf". I studied files in that folder. In the codelabs-tab, I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#4 I studied the page. In Cloud-Shell tab I entered commands:
https://cp100-196102.appspot.com I saw this: In the codelabs-tab, I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#5 I studied the page. I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#6 I studied the page. In tab-6 I asked for browser-refresh with ctrl-r. After that I saw this: I clicked green-button: "Add book". I saw this: I entered information about a book. I clicked green-button: "Save". I saw this: In the GCP-tab I visited a URL: https://console.cloud.google.com/datastore I saw this: In the GCP-tab I visited a URL: https://console.cloud.google.com/code I clicked app-engine folder. I clicked bookshelf folder. I clicked model_datastore.py I saw this: In the codelabs-tab, I studied this page: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#6 I carefully read: "Step 5". In my mind I joined that section with model_datastore.py (in GCP-tab). Now I understand Cloud Datastore better. If I ever need to add a No-SQL datastore to a python-web-app I will return to this lesson. In the codelabs-tab, I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-app-engine/#7 I studied the page. That ended my interaction with the CP100-node I call: "App-Engine". [top] Cloud-StorageNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-cloud-storage I saw this: I studied that page. I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-storage/#1 I studied that page. I bookmarked three links in that page:
https://codelabs.developers.google.com/codelabs/cp100-cloud-storage/#2 I studied that page. I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-storage/#3 I studied that page to understand the shell commands below: In the GCP-tab I visited a URL: https://console.cloud.google.com In the top-right, I clicked the Cloud-Shell icon to start a new Cloud-Shell. I moved the new Cloud-Shell window to tab 5. In Cloud-Shell-tab, I entered commands:
In Cloud-Shell-tab, I entered another command:
In the GCP-tab I visited a URL: https://console.cloud.google.com/code I clicked folder: "cloud-storage". I clicked "config.py". I studied lines 47 through 49. I clicked folder: "cloud-storage". I clicked folder: "bookshelf". I clicked "storage.py". I studied lines 47 through 69. I clicked folder: "bookshelf". I clicked folder: "templates". I clicked "list.html". I studied lines 31 through 35. I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-storage/#4 I studied that page. In Cloud-Shell-tab I entered command:
I clicked the next link in the sequence: https://codelabs.developers.google.com/codelabs/cp100-cloud-storage/#5 I studied that page. I studied the output from gcloud app deploy (displayed above). It gave me the URL of my app on appspot: target url: [https://cp100-196102.appspot.com] I visited https://cp100-196102.appspot.com I saw this: I clicked geen-button: "Add book". I added a book and pressed the green-button: "Save": I saw this: In GCP-tab I loaded URL: https://console.cloud.google.com/storage I found the image for the book: That ended my interaction with the CP100-node I call: "Cloud-Storage". [top] Compute-EngineNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-compute-engine I saw this: I studied that page. I studied the next page: https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#1 I bookmarked links in that page:
https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#2 In the GCP-tab, I visited URL: https://console.cloud.google.com/code I clicked folder: "compute-engine". I clicked folder: "startup-scripts". I clicked file: "startup-script.sh" I studied lines: 20, 45, 52. In the codelabs-tab, I studied the next page: https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#3 In GCP-tab I visited URL: https://console.cloud.google.com I used the top-right Cloud-Shell icon to start a new Cloud-Shell. I moved Cloud-Shell to tab-5. In Cloud-Shell, I issued commands:
In Cloud-Shell, I entered a long command:
https://console.cloud.google.com/compute I saw this: I made note of the IP address: 35.224.163.97 I visited URL: http://35.224.163.97:8080 I saw this: In the codelabs-tab, I studied the next page: https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#4 I visited the Bookshelf-tab. I clicked green-button: "Add book". I filled out the form and clicked green-button: "Save". I saw this: In the codelabs-tab, I studied the next page: https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#5 I bookmarked links in that page:
https://codelabs.developers.google.com/codelabs/cp100-compute-engine/#6 In the GCP-tab I visited this URL: https://console.cloud.google.com/compute I deleted the instance: "bookshelf". In the GCP-tab I visited this URL: https://console.cloud.google.com/networking I saw this: I clicked link "default" near top-left. I clicked link "Firewall rules": I deleted the rule for 8080. GCP indicated success. That ended my interaction with the CP100-node I call: "Compute-Engine". [top] Container-EngineNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-container-engine I saw this: I studied that page. I clicked through to the next page: https://codelabs.developers.google.com/codelabs/cp100-container-engine/#1 I bookmarked links in that page:
https://codelabs.developers.google.com/codelabs/cp100-container-engine/#2 I studied that page. In GCP-tab I visited this URL: https://console.cloud.google.com/apis Near the top I clicked blue-button: "ENABLE APIS AND SERVICES": I searched for "Kubernetes Engine API". I found it; I clicked on the square: I was ready to click the blue-button: "ENABLE". But, GCP indicated that it was already enabled: In the Cloud-Shell-tab I clicked "Reconnect": I entered shell commands:
https://console.cloud.google.com/code I clicked folder: "container-engine". I clicked folder: "bookshelf". I clicked file: "storage.py". I studied line 18. I studied lines 24,25,26. I studied lines 49 through 70. I returned to folder: "container-engine". I clicked file: "bookshelf-frontend.yaml". I studied lines 24 through 52. I studied lines 63 through 77. In the codelabs-tab I clicked through to the next URL: https://codelabs.developers.google.com/codelabs/cp100-container-engine/#3 I studied that page. In the Cloud-Shell-tab I entered commands:
I captured output from the end:
35.226.210.138 In tab-6 I entered this URL: http://35.226.210.138 I saw this: In codelabs-tab I clicked to the next page: https://codelabs.developers.google.com/codelabs/cp100-container-engine/#4 I studied that page. In the bookshelf-tab (should be tab-6), I clicked the green-button: "Add book". I filled out the form: I clicked green-button "Save"; It responded: In codelabs-tab I clicked to the next page: https://codelabs.developers.google.com/codelabs/cp100-container-engine/#5 I studied that page. In codelabs-tab I clicked to the next page: https://codelabs.developers.google.com/codelabs/cp100-container-engine/#6 I studied that page. In GCP-tab, I visited URL: https://console.cloud.google.com/kubernetes I clicked the icon: "bookshelf". I clicked the trash-icon on the left; I wanted to delete the cluster: In GCP-tab, I clicked the hamburger-link. I picked "Container Registry". I saw this: I clicked "bookshelf": I checked it; that activated blue-button: "DELETE". I clicked: "DELETE": In GCP-tab I visited URL: https://console.cloud.google.com/networking/firewalls I saw this: I deleted the two firewall-rules for bookshelf: In GCP-tab I visited URL: https://console.cloud.google.com/net-services/loadbalancing I saw this: I clicked the trashcan-icon to delete that service: I visited the VM URL to ensure I had no VMs eating my GCP budget: https://console.cloud.google.com/compute GCP showed that none were running. That ended my interaction with the CP100-node I call: "Container-Engine". [top] Big QueryNext, in the codelabs-tab, I clicked this link:https://codelabs.developers.google.com/codelabs/cp100-big-query I saw this: I studied that page; I clicked through to the next page: https://codelabs.developers.google.com/codelabs/cp100-big-query#1 I bookmarked links from that page:
I memorized the above image as this phrase: Project has many Datasets has many Tables has many Rows with Columns I clicked through to the next page: https://codelabs.developers.google.com/codelabs/cp100-big-query#2 I studied that page. In the GCP-tab I visited the URL to set my project to CP100: https://console.cloud.google.com After I set the project to "cp100", I clicked the top-left-hamburger link. From there I clicked BigQuery near the bottom. It opened a new tab with this URL: https://bigquery.cloud.google.com I saw this: I clicked the select-option to the right of cp100: I asked for a new Dataset named: "cp100": I clicked blue-button: "OK". Next, I clicked the tiny-blue-button: "+". GCP offered me a form to specify Source-Data: I filled it out: At the bottom I clicked blue-button: "Create Table". I saw this: I inspected the new table: I returned to the codelabs-tab. I clicked through to the next page: https://codelabs.developers.google.com/codelabs/cp100-big-query#3 I studied that page. I clicked through to the next page: https://codelabs.developers.google.com/codelabs/cp100-big-query#4 I studied that page. In the BigQuery-tab I clicked link: "Compose Query" BigQuery offered a TextArea-element for me to enter syntax: I entered syntax:
BigQuery responded quickly: I returned to my Cloud-Shell. I asked it to "Reconnect". I entered command:
That caused BigQuery to fail. I tried other ideas but they all failed:
To clean-up, I clicked on my BigQuery tab. I found the link to "Delete Dataset"; I clicked it: BigQuery indicated successful delete. That ended my interaction with the CP100-node I call: "Big Query". Also that ends lesson002 of cs101.us [top] |
cs101.us | About Blog Contact Links Lessons |
**
https://cs101.herokuapp.com/lessons/lesson003
Lesson 003 [ Intro Data Science ]Topics:
AnacondaAnaconda runs on Mac, Windows, and Linux.I started by downloading Anaconda 5.1.0 for my laptop:
https://repo.continuum.io/archive/ After I downloaded it, I started the install by clicking on the download. During the install, I answered yes to all the defaults. After I installed Anaconda, I saw this:
JupyterJupyter is an interesting application.You can learn a bit about Jupyter at the URL listed below: http://jupyter.org/ I see Jupyter as a mashup of a Python interpreter and Web technology. I can use Jupyter to expose some Python syntax to a group of people who are running browsers who then want to see that syntax run in their browswers. I bumped into Jupyter in two types of situations. The first type is what I call the presentation-training-scenario. If I present a small amount of Python based content to a room full of Python programmers, Jupyter can be a good fit for that task. The second type is what I call the development-scenario. In this situation I need to write some code to deliver a feature in a production app. Is the production app running in Jupyter? Probably not. So to me it's obvious that Jupyter makes a poor development environment. So I remember two points:
On windows you should find the right icon and then click on it. On windows if you have trouble, I offer a tip: https://www.google.com/search?q=On+windows+how+to+start+Jupyter On my laptop after I typed: "jupyter notebook", I saw this: On the right, I clicked the new-link and I saw this: I typed in some Python syntax:
That just made the field larger. I entered shift-enter. Python came to life and ran that Python syntax: Now you know enough Jupyter to learn some Python. [top] PythonHere is some Python:
Then in Jupyter, use shift-enter to run it. I did that. First, I saw this: Then, I pasted: Then, I pressed shift-enter: If you can do that in your laptop, you are on the right path. Time to move along. I show you More python below. Try to slowly and carefully run pieces of it in Jupyter:
Data ScienceTo do this exercise I shutdown Jupyter.Then I downloaded two CSV files into my Downloads folder on my laptop: I wanted Jupyter to see those two files. So, I used two shell commands to start Jupyter from the Downloads folder:
I ran the Python in my Jupyter Notebook and it worked well:
I saw this: I saw this: Questions/Answers
|
cs101.us | About Blog Contact Links Lessons |
**
https://cs101.herokuapp.com/lessons/lesson004
Lesson 004 [ GCP Dataflow ]GCP Dataflow is described in this URL:https://cloud.google.com/dataflow/ If you want a free GCP account to do this lesson, you should be able to get one: https://console.developers.google.com/freetrial Google will want you to login using gmail. Also they will want your credit-card information. So, you should do that now. Or, if you want, just keep reading. To do this lesson, I needed only a browser. I used a Chrome browser. To start, I logged into gmail. Next I loaded a URL: https://console.cloud.google.com/projectcreate I saw this: I created a project: Notice in the above image that I did not use the suggested project-name. Instead I called my new project: "dfnow". Dataflow depends on a bucket: I created a bucket called "dfnow": I checked that it was available in the browser: Next, I loaded a URL: https://console.cloud.google.com/dataflow I saw this: I clicked blue-button: "CREATE JOB FROM TEMPLATE". GCP served me a form to fill out: I wanted to test if Dataflow would work for me. So, I supplied minimal information to the form. I clicked blue-button: "Run job". GCP served me an error: I looked for help: I returned to URL: https://console.cloud.google.com/dataflow I saw this: I clicked blue-button: "Try Dataflow": It offered me help with my permission problem. I clicked through: I clicked blue-button: "Enable APIs": It needed two minutes: It finished. I clicked blue-button, "CREATE JOB FROM TEMPLATE": GCP served me a form to fill out: I wanted to test if Dataflow would work for me. So, I supplied minimal information to the form. I clicked blue-button: "Run job". Instead of serving an error, GCP launched a Job: I saw information about the job as it progressed: After 4 min 28 sec, it finished: I visited a URL to search for the job-output: https://console.cloud.google.com/storage I found it and clicked on a file in the dfnow-bucket: I saw output from the job: After I studied the files, I deleted them from the bucket: At that point I was convinced that I had the permissions I need to submit Dataflow-jobs. [top] Python DataFlowI started this effort by activating Cloud-Shell:I clicked button on the right to give Cloud-Shell its own tab: I like to have my Cloud-Shell tab to the right of my GCP-tab: I visited a URL and studied it: https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python I should have started there. The above page offers information on how to avoid the API-permission-error I encountered. In Cloud-Shell-tab I issued commands:
Then, I prepared two shell variables for a large Python command:
Eventually it finished: In the buckets-Browser, I looked for output from the job: I found output from the job: After I saw that output, I returned to the buckets-Browser and removed files from that job. That concludes this lesson on GCP-Dataflow. [top] |
cs101.us | About Blog Contact Links Lessons |
**
Thanks for providing your information, keep update and share your information AWS Online Training
ReplyDeleteThanks for this great article.
ReplyDeleteGoogle Cloud Platform Training
GCP Online Training
Google Cloud Platform Training In Hyderabad