100daysoflearning
Published in

100daysoflearning

Google Cloud Associate Certified Engineer — 100daysoflearning (Part 13)

Day 92–93

In continuation to the course for Google Cloud Associate Certified engineer lets move on with next set of learning topics.

If you have been following along my previous posts then by this time you would have created a VCN, public/private bucket, pubsub topic, bigtable, bigquery, Kubernetes cluster where the products api is deployed, spanner instance , compute instance created via deployment manager where the ads api is deployed and deploying the image processor with google Cloud functions. Next and kind of final on the list for our application to be fully functional is to deploy the frontend application to Google App Engine. After deploying you should be able to see a fully working application and test that out checking the functionality of each piece that I have been explaining throughout till now.

Google App Engine: Google App Engine is a fully managed Platform as a service offered by Google where you do not need to worry about the underlying infrastructure of that application and can only focus on the development, google will manage and maintain the infrastructure for you , google will scale up/down the infrastructure based on the traffic. you can also run multiple instance of you application via versioning which can help you in testing of you application and can also route the traffic accordingly to specific instances. So in this case when user will submit the object the application running in app engine will deserialize it and send the message to the pubsub topic created earlier. Once the App Engine is created you cannot delete it. Also you cannot the region of the App Engine once created. One App engine per project . Regions that app engines uses have separate names than the regular ones:

App Engine regions
Before creating App Engine

Create App Engine : in order to create an app engine a simple gcloud app create with project id and region .

output after running the command
App Engine Created

Now the app Engine is created and ready for the application deployment.

Before we actually deploy the application you need to do few changes to the code .
- First in the app.yaml file in ‘/frontend/app’ directory you need to set the same pubsub topic that you created previously

- Second in the items.js file in ‘/frontend/app/public/assets/js’ directory you need to update the ‘producthost’ and ‘adHost’ ip addresses. You can get these address by following commands:
kubectl get svc -o jsonpath=’{.items[*].status.loadBalancer.ingress[0].ip}’
gcloud compute forwarding-rules list — filter=’name:”ads-service-forwarding-rules”’ — format=’value(IPAddress)’

Once these changes are done, you can run the deploy.sh file to deploy the application which has following contents:

deploy.sh
build.sh

As you can see above in ‘deploy.sh’ its exposing the go path and building the build.sh file which is nothing but running a docker container. Then you have the gcloud app deploy command where we are passing app.yaml file with -q at the end which means to choose the default options whatever comes either yes/no while running the script. So lets run the ‘deploy.sh’ and see the final output.

output

Now you can see the external url by running the gcloud app browse command.

Congratulations ….!!!
Your application is deployed. Try uploading some images using the buyer and seller options and see the some of the outputs of below commands . The images should also be present in public bucket. Also you should be able to see the images in the front end UI

Frontend after uploading some images
Bigtable Table read results

you can see from the bigtable command that the data is getting inserted after the Vision API processing.
Also the images are getting uploaded to the public bucket.

So this was a sample application running on Google cloud using most of the required service important for the exam.
It covers: VPC, Bigtable, Bigquery, Spanner, Google compute engine, Kubernetes engine, Google cloud functions, Google App Engine, Pubsub, Public/private buckets.

By now you should have fair understanding of Google cloud services and how to use them for an application development and deployment.

Happy Learning & Happy Coding
Saiyam Pathak
https://www.linkedin.com/in/saiyam-pathak-97685a64/
https://twitter.com/SaiyamPathak

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store