Integrate with Machine Learning APIs: Challenge Lab Tutorial

Detailed walk-through of the Integrate with Machine Learning APIs Skill Badge on Google Cloud Platform.

This medium article focuses on the detailed walk through of the steps I took to solve the challenge lab Integrate with Machine Learning APIs of the in Google Cloud Skill Badge on the Google Cloud Platform.

This lab is only recommended for students who have completed the quest Machine Learning APIs on Qwiklabs.

Task 1: Configure a service account to access the Machine Learning APIs, BigQuery, and Cloud Storage

Open a Cloud Shell session by clicking on the icon in the top right corner of the Cloud Console:

Then Click Continue:

Image for post
Image for post

Create a new service account that provides credentials for the script.

export SANAME=challenge
gcloud iam service-accounts create $SANAME

Once you have created the account, bind the BigQuery Admin and Cloud Storage Admin roles to the Service Account to provide the IAM permissions required to process files from Cloud Storage and insert the result data into a BigQuery table.

1) gcloud projects add-iam-policy-binding $DEVSHELL_PROJECT_ID --member=serviceAccount:$SANAME@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com --role=roles/bigquery.admin2) gcloud projects add-iam-policy-binding $DEVSHELL_PROJECT_ID --member=serviceAccount:$SANAME@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com --role=roles/storage.admin

Task 2: Create and download a credential file for your Service Account

When you have configured the service account permissions, download the JSON format IAM credentials file for the service account. Don’t forget to configure the environment variable that supplies the name of the credential file for the Python script.

1) gcloud iam service-accounts keys create sa-key.json --iam-account $SANAME@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com2) export GOOGLE_APPLICATION_CREDENTIALS=${PWD}/sa-key.json3) gsutil cp gs://$DEVSHELL_PROJECT_ID/analyze-images.py .

Task 3 & 4: Modify the Python script to extract text from image files

Open gcloud shell editor and replace the file analyze-images.py with the following code below

Run the command :

python3 analyze-images.py <PROJECT_NAME> <BUCKET_NAME>

Task 5: Identify the most common non-English language used in the signs in the data set

  1. Click Navigation menu > BigQuery.
Image for post
Image for post

The Welcome to BigQuery in the Cloud Console message box opens.

Click Done.

Copy and paste the following query into the Query editor, then Run query

SELECT locale, COUNT(locale) as OCCURENCE FROM `<QWIKLABS_PROJECT_ID>.image_classification_dataset.image_text_detail` GROUP BY locale

Replace <QWIKLABS_PROJECT_ID>with your project ID.

Detailed walk-through of the Perform Foundational Infrastructure Tasks in Google Cloud Skill Badge on Google Cloud Platform.

This medium article focuses on the detailed walk through of the steps I took to solve the challenge lab of the Perform Foundational Infrastructure Tasks in Google Cloud Skill Badge on the Google Cloud Platform.

This lab is only recommended for students who have completed the quest Baseline: Infrastructure on Qwiklabs.

Challenge scenario

You are just starting your junior cloud engineer role with Jooli inc. So far you have been helping teams create and manage Google Cloud Platform resources.

You are expected to have the skills and knowledge for these tasks so don’t expect step-by-step guides.

Your challenge

You are now asked to help…


Image for post
Image for post
Photo by BENCE BOROS on Unsplash

Challenge scenario

As a junior developer in Jooli Inc. and recently trained with Google Cloud and Dialogflow you have been asked to help a new team (Taniwha) set up their environment. The team has asked for your help and has done some work, but needs you to complete the work.

You are expected to have the skills and knowledge for these tasks so don’t expect step-by-step guides.

Your challenge

You need to help the team with some of their initial work creating two new Dialogflow apps.

As soon as you sit down at your desk and open your new laptop you receive the following…