WORKLOAD AUTOMATION COMMUNITY
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new

Invoking and Monitoring GCP Cloud Function Plugin with Workload Automation

8/16/2021

0 Comments

 
Picture
Let us begin with understanding of Google Cloud Function plugin and how it benefits our workload automation users.
Picture
“GCP is a plugin that helps you to invoke GCP Cloud Functions in a synchronous way and also monitor the job”.

GCP requires no servers to provision, manage, or upgrade. It automatically scales up based on the load. It has Integrated monitoring, logging, and debugging capability. It has built-in security at role and per function level based on the principle of least privilege. It also has the networking capabilities for hybrid and multi-cloud scenarios.

Serverless Computing:

  • Serverless computing is an execution model for the cloud.
  • A cloud provider dynamically allocates and then charges the user for only the resources needed to execute a particular piece of code.
  • No server management. Provisioning and maintenance are taken care by provider.
  • Minimizes cost: Developers are only charged for the resources they use.
  • Serverless architectures are inherently scalable.
  • Quick deployments and updates are possible.
GCP Cloud Functions
The GCP Cloud Function includes the following features:

  • Google Cloud Platform(GCP) Cloud Functions is a function-as-a-service platform.​
  • It allows to develop, run and manage application functionalities without the complexity of infrastructure associated with  developing an app.​
  • Functions automatically scale and are highly available and fault-tolerant.
  • Cloud Functions can be written in Node.js, Python, Go, Java, .NET, Ruby, and PHP programming languages, and are executed in language-specific runtimes.
  • It has integrated monitoring, logging, and debugging capability.
  • It helps you monitor the solution from a single point of control.
  • There are two distinct types of cloud functions:
    • HTTP functions
    • Event-driven functions

Plugin Use Case / Functionalities
    Invoke - Invoke GCP Cloud Functions in a synchronous way.
  Monitor - Get function output state: retrieve function output object if it is executed successfully or catch errors if the execution failed.
Picture
Figure 2 GCP Cloud Function Console
Picture
Figure 3 GCP Cloud Function Console

Installation & Prerequisite
 
Must have access to​:
  • GCP Console​
  • Service Account Credentials
 
Let us begin with our plugin part with job definition parameters

GCP Cloud Function Plugin

 
Log in to the Dynamic Workload Console and open the Workload Designer. Choose to create a new job and select “GCP Cloud Function Plugin” job type in the Cloud section.
Picture
Figure 4 Job Definition

Connection Tab
 
Establishing connection to the GCP Cloud.
 
Connection Info
Use this section to connect to Google Cloud.
 
GCP Default Credentials - Select this option if you want system to fetch default credentials from system configuration.
Note: Environment variable has to be configured for default access GOOGLE_APPLICATION_CREDENTIALS.
 
GCP Server Credentials - Select this option to enter the GCP credentials manually.
Service Account - The service account associated to your GCP Cloud Function account. Click the Select button to choose the service account in the cloud console. Select an item from the list, the selected item is displayed in the Service Account field.
 
Note: This attribute is required. The service account is the identity of the service, and the service account's permissions control which resources the service can access.
Project ID - The project ID is a unique number associated with each project. It is mandatory and unique for each service account.
 
Test Connection - Click to verify if the connection to the Google Cloud works correctly. 
Picture
Figure 5 connection tab

GCP Default Credentials
  • Google Cloud Application Default Credentials (ADC) are not credentials. ADC is a strategy to locate Google Cloud Service Account credentials.
  • If the environment variable GOOGLE_APPLICATION_CREDENTIALS is set, ADC will use the filename that the variable points to for service account credentials. This file is a Google Cloud Service Account credentials file in JSON format.
  • A JSON file in a location known to the Gcloud command-line tool.
  • On Windows, it is %APPDATA%/gcloud/application_default_credentials.json.
  • On other systems, it is $HOME/.config/gcloud/application_default_credentials.json.
  • The default service account for credentials if the application running on Compute Engine, App Engine.
​
If the previous steps do not find valid credentials, ADC will fail, and an error occurs.​
Picture
Figure 6 Connection Tab

Action Tab

 
Use this section to define invocation options for GCP cloud function.
 
Invoking Information
 
Region
Region where GCP function is located (for example us-east-2).
 
Function Name
Click the Select button to specify the name of the GCP cloud function to be invoked. The selected name appears in the Function Name field.
 
Function Input Event
 
Input From File
Select this option if GCP cloud function input event is stored inside a file (for example: text, json).
 
File Path
This field is available only if the Input from File has been checked. Provide here the absolute path to the file which contains the event payload. Event payload must be a valid JSON.
 
Manual Input
Select this option to provide the GCP cloud function input event manually.
 
Input Body
This field is available only if the Manual Input has been checked. Provide here the json to send as function input while invoking GCP cloud function.
 
Save Function Output to File
Select the check box to save the function output.
 
Output File Path
Provide the location to save the function output files.
Picture
Figure 7 Action Tab
Picture
Figure 8 Action tab – Application List
Picture
Figure 9- Action tab – File Path

Submitting your job
​ 
It is time to Submit your job into the current plan. You can add your job to the job stream that automates your business process flow. Select the action menu in the top-left corner of the job definition panel and click on Submit Job into Current Plan. A confirmation message is displayed, and you can switch to the Monitoring view to see what is going on.
Picture
Figure 10 Job Log
Picture
Figure 11 Monitor Job
Picture
Are you curious to try out the GCP Cloud Function plugin? Download the integrations from the Automation Hub and get started or drop a line at santhoshkumar.kumar@hcl.com

Learn more about HCL Workload Automation here or drop us a line at HWAinfo@hcl.com? 

Automate Anything, Run Anywhere!

Authors Bio
Picture
Saket Saurav, Tester (Senior Engineer) at HCL Technologies

Responsible for performing Automation and Manual Testing for different plugins in Workload Automation using Java Unified Test Automation Framework. Hands-on experience on Java programming language, Web Services with databases like Oracle and SQL Server.
View my profile on LinkedIn
Picture
Dharani Ramalingam -Senior Java Developer at HCL Technologies

Works as a Plugin Developer in Workload Automation. Technology enthusiast who loves to learn new tools and technologies. Acquired skills on Java, Spring, Spring Boot, Microservices, ReactJS,  NodeJS, JavaScript, Hibernate.

​
View my profile on LinkedIn
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    March 2023
    February 2023
    January 2023
    December 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    January 2020
    December 2019
    November 2019
    October 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017

    Categories

    All
    Analytics
    Azure
    Business Applications
    Cloud
    Data Storage
    DevOps
    Monitoring & Reporting

    RSS Feed

www.hcltechsw.com
About HCL Software 
HCL Software is a division of HCL Technologies (HCL) that operates its primary software business. It develops, markets, sells, and supports over 20 product families in the areas of DevSecOps, Automation, Digital Solutions, Data Management, Marketing and Commerce, and Mainframes. HCL Software has offices and labs around the world to serve thousands of customers. Its mission is to drive ultimate customer success with their IT investments through relentless innovation of its products. For more information, To know more  please visit www.hcltechsw.com.  Copyright © 2019 HCL Technologies Limited
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new