Introducing Workflows callbacks

With Workflows, developers can easily orchestrate various services together, on Google Cloud or third-party APIs. Workflows connectors handle long-running operations of Google Cloud services till completion. And Workflow executions can also wait for time to pass with the built-in sys.sleep function, till some computation finishes, or some event takes place. But what if you need some user input or some approval in the middle of the workflow execution, like validating automatic text translation? Or an external system like a fulfillment center or an inventory system that is going to notify that products are back in stock? Instead of using a combination of “sleep” instructions and API polling, now you’ll be able to use Workflows callbacks! With callbacks, the execution of a workflow can wait until it receives a call to a specific callback endpoint. Let’s have a look at a concrete example.Case study: human validation of automated translationLet’s have a look at a concrete example! Machine learning based translations have reached an incredible level of quality, but sometimes, you want a human being to validate the translations produced. Thanks to Workflows callbacks, we can add a human, or an autonomous system, into the loop.To illustrate this case study, the following diagram will show you a possible implementation of the whole process:Click to enlargeFirst, the user visits a translation web page. They fill a textarea with the text they want to translate, and click on the translate button.Clicking on the button will call a Cloud Function that will launch an execution of the workflow. The text to translate is passed as a parameter of the function, and as a parameter of the workflow too.The text is saved in Cloud Firestore, and the Translation API is called with the input text, and will return the translation, which will be stored in Firestore as well. The translation appears on the web page in real-time thanks to the Firebase SDK.A step in the workflow creates a callback endpoint (also saved in Firestore), so that it can be called to validate or reject the automatic translation. When the callback endpoint is saved in Firestore, the web page displays validation and rejection buttons.The workflow now explicitly awaits the callback endpoint to be called. This pauses the workflow execution.The user decides to either validate or reject the translation. When one of the two buttons is clicked, a Cloud Function is called, with the approval status as parameter, which will in turn call the callback endpoint created by the workflow, also passing the approval status. The workflow resumes its execution, and saves the approval in Firestore. And this is the end of our workflow.Creating a callback and awaiting incoming callsTwo new built-in functions are introduced in the standard Workflows library:events.create_callback_endpoint — to create and setup the callback endpointevents.await_callback — to wait for the callback endpoint to be calledWith events.create_callback_endpoint you specify the HTTP method that should be used for invoking the callback endpoint, and you get a dictionary with the URL of that endpoint that you can pass to other systems. And with events.await_callback, you pass the callback endpoint to wait on, pass a timeout defining how long you want to wait, and when the endpoint is called, you get access to the body that was sent to the endpoint.Let’s have a look at the YAML definition of our workflow, where we apply those two new functions. First, we’re going to create the callback:The callback endpoint is now ready to receive incoming requests via a POST HTTP method, and the details of that endpoint are stored in the callback_details dictionary (in particular, the url key will be associated with the URL of the endpoint).Next, we pause the workflow, and await the callback with:The callback_details from earlier is passed as argument, as well as a timeout in seconds to wait for the callback to be made. When the call is received, all the details of the request are stored in the callback_request dictionary. You then have access to the full HTTP request, including its headers or its body. In case the timeout is reached, a TimeoutError is raised and can be caught by a try /except block.Going further and calling us back!If you want to have a closer look at the above example, all the code for this workflow can be found in the Workflows samples Github repository. And you can follow the details of this tutorial to replicate this workflow in your own project. As this is still a preview feature for now, please be sure to request access to this feature, if you want to try it on your own.For more information on callbacks, be sure to read the documentation. To dive deeper into the example above, please checkout the Github repository of this translation validation sample. Don’t hesitate to let us know via Twitter to @glaforge what you think of this feature, and how you intend on taking advantage of it in your own workflows!Related ArticleIntroducing new connectors for WorkflowsWe’re announcing new connectors for Workflows, which simplify calling Google Cloud services and APIs.Read Article
Quelle: Google Cloud Platform

Google named a leader in the 2021 Gartner® Magic Quadrant® for Full Life Cycle API Management

We’re excited to share that Gartner has recognized Google Cloud’s Apigee as a Leader in the 2021 Magic Quadrant for Full Life Cycle API Management, marking the sixth time in a row we’ve earned this recognition. We believe this achievement is a testimony to Google Cloud’s differentiated vision for API management and strong track record of delivering continuous product innovation. In this year’s report, Apigee is placed highest among all the vendors for the ability to execute.  We want to take this opportunity to thank our thriving community of customers, developers and partners for voicing their opinion.APIs are one of the key mechanisms through which organizations bring digital-first strategies to life in the form of new experiences and applications for partners and customers. To get the most out of these APIs in an efficient and scalable manner, API management is a must and partnering with the right API management vendor is critical to building and scaling a successful API program. Research from industry analyst firms like Gartner can help enterprises evaluate and choose the right solution.Many enterprise customers like Nationwide Insurance, ABN Amro, Bed Bath & Beyond, and Pizza Hut chose Google Cloud’s Apigee as their API management partner. Our mission is to help our customers make the leap to digital excellence – the ability to rapidly and repeatedly deploy and scale, and to consistently deliver on digital programs. We want to support our customers in building profitable API-based platforms and delivering measurable business outcomes.“APIs allow Veolia to access new ecosystems and partners that will bring new innovation opportunities for us. Apigee helps us quickly and easily deliver great customer experiences. It abstracts away the backend IT complexity, and helps us provide information and data to our customers quickly, consistently and securely,” – Pascal Dalla-Torre, Group CTO at Veolia.As part of this vision, we are focused on delivering continuous innovation.Achieve hyperscale – To help customers scale globally, connect their distributed workforce, and collaborate with regional partners using APIs, we announced Apigee X earlier this year. It’s a major release of our API management platform that seamlessly weaves together Google Cloud’s expertise in AI, security and networking to help enterprises efficiently manage the assets on which digital transformation initiatives are built. Developer efficiency – Developers today are using multiple tools to address their API and integration needs. Adding to the complexity is the proliferation of newer API styles and software development tools. Therefore, we recently announced Apigee Integration, a unified platform for API and integration needs,  Apigee Adapter for Envoy to support microservices needs, support for new API styles like GraphQL, flexibility of using existing SDLC tools to manage APIs, and fulfilment solutions for conversational AI. Democratizing application development – Across industries, tech savvy employees outside of the IT teams are increasingly using no-code development tools like AppSheet to build internal applications. To help organizations extend their API management investments to these tech savvy employees, we continue to invest in integrations between Apigee and AppSheet platforms. AIOps for APIs – In a digital excellence strategy, APIs take the center stage acting as the central nervous system for connecting various customer and employee facing applications. Therefore, ensuring APIs are always available and performing as expected is critical. To overcome monitoring challenges of hyperscale API programs, we harness the power of Google’s industry-leading machine learning capabilities to equip API operators with capabilities such as anomaly detection.Industry-specific solutions – To reduce the time to market of new digital programs and address specific industry requirements, we delivered a robust set of API industry accelerators such as Open Banking, Health APIx, eCommerce modernization, and Contact Center AI fulfilment for Telco.We are honored to be a Leader in the 2021 Gartner Magic Quadrant for Full Life Cycle Management and look forward to continuing to innovate and partner with you on your digital transformation journey. Download the full report here (requires an email address). To learn more about Apigee, visit the website here.Gartner Magic Quadrant for Full Life Cycle API Management, Shameen Pillai, Kimihiko Iijima, Mark O’Neill, John Santoro, Akash Jain, Fintan Ryan,28th September 2021.Gartner does not endorse any vendor, product or service depicted in its research publications and does not advise technology users to select only those vendors with the highest ratings or other designation. Gartner research publications consist of the opinions of Gartner’s Research & Advisory organization and should not be construed as statements of fact. Gartner disclaims all warranties, expressed or implied, with respect to this research, including any warranties of merchantability or fitness for a particular purpose.Gartner and Magic Quadrant are registered trademarks of Gartner, Inc. and/or its affiliates in the U.S. and internationally and is used herein with permission. All rights reserved.  This graphic was published by Gartner, Inc. as part of a larger research document and should be evaluated in the context of the entire document. The Gartner document is available upon request from Google(Apigee).Related ArticleRead Article
Quelle: Google Cloud Platform

Friday Five — October 1, 2021

The Friday Five is a weekly Red Hat® blog post with 5 of the week’s top news items and ideas from or about Red Hat and the technology industry. Consider it your weekly digest of things that caught our eye.

Quelle: CloudForms

Cloud NAT explained!

For security, it is a best practice to limit the number of public IP addresses in your network. In Google Cloud, Cloud NAT (network address translation) lets certain resources without external IP addresses create outbound connections to the internet.Cloud NAT provides outgoing connectivity for the following resources:Compute Engine virtual machine (VM) instances without external IP addressesPrivate Google Kubernetes Engine (GKE) clustersCloud Run instances through Serverless VPC AccessCloud Functions instances through Serverless VPC AccessApp Engine standard environment instances through Serverless VPC AccessClick to enlargeHow is Cloud NAT different from typical NAT proxiesCloud NAT is a distributed, software-defined managed service, not based on proxy VMs or appliances. This proxyless architecture means higher scalability (no single choke point) and lower latency. Cloud NAT configures the Andromeda software that powers your Virtual Private Cloud (VPC) network so that it provides source network address translation (SNAT) for VMs without external IP addresses. It also provides destination network address translation (DNAT) for established inbound response packets only.Benefits of using Cloud NATSecurity: Helps you reduce the need for individual VMs to each have external IP addresses. Subject to egress firewall rules, VMs without external IP addresses can access destinations on the internet.Availability: Since Cloud NAT is a distributed software-defined managed service,  it doesn’t depend on any VMs in your project or a single physical gateway device. You configure a NAT gateway on a Cloud Router, which provides the control plane for NAT, holding configuration parameters that you specify. Scalability: Cloud NAT can be configured to automatically scale the number of NAT IP addresses that it uses, and it supports VMs that belong to managed instance groups, including those with autoscaling enabled.Performance: Cloud NAT does not reduce network bandwidthper VM because it is implemented by Google’s Andromeda software-defined networking. NAT rulesIn Cloud NAT, the NAT rulesfeature lets you create access rules that define how Cloud NAT is used to connect to the internet. NAT rules support source NAT based on destination address. When you configure a NAT gateway without NAT rules, the VMs using that NAT gateway use the same set of NAT IP addresses to reach all internet addresses. If you need more control over packets that pass through Cloud NAT, you can add NAT rules. A NAT rule defines a match condition and a corresponding action. After you specify NAT rules, each packet is matched with each NAT rule. If a packet matches the condition set in a rule, then the action corresponding to that match occurs.Basic Cloud NAT configuration examplesIn the example pictured in sketchnote, the NAT gateway in the east is configured to support the VMs with no external IPs in subnet-1 to access the internet. These VMs can send traffic to the internet by using either the gateways’s primary internal IP address or an alias IP range from the primary IP address range of subnet-1, 10.240.0.0/16. A VM whose network interface does not have an external IP address and whose primary internal IP address is located in subnet-2 cannot access the internet. Similarly, the NAT gateway Europe is configured to apply to the primary IP address range of subnet-3 in the west region allowing the VM whose network interface does not have an external IP address to send traffic to the internet by using either its primary internal IP address or an alias IP range from the primary IP address range of subnet-3, 192.168.1.0/24.To enable NAT for all the containers and the GKE node, you must choose all the IP address ranges of a subnet as the NAT candidates. It is not possible to enable NAT for specific containers in a subnet. For a more in-depth look into Cloud NAT check out the documentation.For more #GCPSketchnote, follow the GitHub repo. For similar cloud content follow me on Twitter @pvergadia and keep an eye out on thecloudgirl.dev Related ArticleSupercharge your Cloud NAT: Introducing new Cloud NAT featuresIntroducing new Google Cloud NAT features that improve scalability and flexibility for Compute Engine and Kubernetes Engine workloads.Read Article
Quelle: Google Cloud Platform