Video: How to Dockerize a Python App with FastAPI

Join host Peter McKee and Python wizard Michael Kennedy for a warts-and-all demo of how to Dockerize a Python app using FastAPI, a popular Python framework. Kennedy is a developer and entrepreneur, and the founder and host of two successful Python podcasts — Talk Python To Me and Python Bytes. He’s also a Python Software Foundation Fellow.

With some skillful back-seat driving by McKee, Kennedy shows how to build a bare-bones web API — in this case one that allows you to ask questions and get answers about movies (director, release date, etc.) — by mashing together a movie service and FastAPI. Next, he shows how to put it into a Docker container, create an app and run it, finally sharing the image on GitHub.

If you’re looking for a scripted, flawless, pre-recorded demo, this is not the one for you! McKee and Kennedy iterate and troubleshoot their way through the process — which makes this a great place to start if you’re new to Dockerizing Python apps. Install scripts, libraries, automation, security, best practices, and a pinch of Python zen — it’s all here. (Duration 1 hour, 10 mins.)

Join Us for DockerCon LIVE 2021  

Join us for DockerCon LIVE 2021 on Thursday, May 27. DockerCon LIVE is a free, one day virtual event that is a unique experience for developers and development teams who are building the next generation of modern applications. If you want to learn about how to go from code to cloud fast and how to solve your development challenges, DockerCon LIVE 2021 offers engaging live content to help you build, share and run your applications. Register today at https://dockr.ly/2PSJ7vn
The post Video: How to Dockerize a Python App with FastAPI appeared first on Docker Blog.
Quelle: https://blog.docker.com/feed/

How to accurately match OVAL security data to installed RPMs

Red Hat publishes security data using the Open Vulnerability and Assessment Language (OVAL). Depending on what you have installed, according to the Red Hat and OVAL compatibility FAQ, you’ll need to scan streams for all products installed on your system. This post aims to answer the question of how to determine which stream to use when scanning a system. We’ll use an operating system and container image as target systems to explore the topic. 
Quelle: CloudForms

Scheduling Cloud Bigtable Backups

Cloud Bigtable backups let you save a copy of a table’s schema and data, then restore from the backup to a new table at a later time. In this tutorial, you’ll learn how to create backups at regularly scheduled intervals (such as daily or weekly) using the Cloud Bigtable Scheduled Backups example.This example uses Cloud Scheduler to periodically send backup creation requests as Pub/Sub messages. The Pub/Sub messages trigger a Cloud Function which initiates a backup using the Cloud Bigtable Java client library. The function could be adapted to any of the clients that are supported in Cloud Functions.This solution uses the following Google Cloud services:Cloud Scheduler to trigger tasks with a cron-based scheduleCloud Pub/Sub to pass the message request from Cloud Scheduler to Cloud FunctionsCloud Functions to initiate an operation for creating a Cloud Bigtable backupCloud Logging to create logs-based metricsCloud Monitoring to create alerts based on conditions of the logs-based metricsSystem ArchitectureCostsThis tutorial uses billable components of Google Cloud, including the following:Cloud SchedulerCloud FunctionsCloud Bigtable backupsUse the pricing calculator to generate a cost estimate based on your projected usage.Before you beginBefore proceeding with the tutorial, ensure the following:A Cloud Bigtable table exists in the same Google Cloud project. Please check Cloud Bigtable documentation if needed.Google Cloud SDK is installedAPIs and IAM Roles SetupThe diagram below focuses on the actions flow between human roles and APIs.IAM Roles for AdministratorsThe administrator should be granted specific roles to deploy the services needed for the solution.RolePurposeroles/bigtable.adminCloud Bigtable administratorroles/cloudfunctions.adminDeploy and manage Cloud Functionsroles/deploymentmanager.editorDeploy monitoring metricsroles/pubsub.editorCreate and manage Pub/Sub topicsroles/cloudscheduler.adminSet up a schedule in Cloud Schedulerroles/appengine.appAdminUse Cloud Scheduler to deploy a cron serviceroles/monitoring.adminSet up alerting policies for failure notificationsroles/logging.adminAdd log based user metrics to track failuresThe administrator also needs to be assigned a custom role that has the following permissions:appengine.applications.create – for Cloud Scheduler to create an App Engine appserviceusage.services.use – for Cloud Scheduler to use the App Engine appService Account for Cloud FunctionsCloud Functions calls the Cloud Bigtable API to create a backup, and the Cloud function gets triggered when a message arrives on the Pub/Sub topic. For successful execution, the Cloud Function should be able to consume from the Pub/Sub topic and have permissions to create Cloud Bigtable backups. To accomplish this, perform the following steps:Create a service account (e.g. cbt-scheduled-backups@iam.gserviceaccount.com).Create a custom role with the following permissions:bigtable.backups.createbigtable.backups.deletebigtable.backups.getbigtable.backups.listbigtable.backups.restorebigtable.backups.updatebigtable.instances.getbigtable.tables.createbigtable.tables.readRowsAssign the custom role and roles/pubsub.subscriber to the service account. This allows Cloud Functions to read messages from the Pub/Sub topic and initiate a `create backup` request.Add the administrator as a member of the service account with role roles/iam.serviceAccountUser. This allows the administrator to deploy Cloud Functions.Creating Scheduled BackupsCreate a Pub/Sub topicCreate a Cloud Pub/Sub topic cloud-bigtable-scheduled-backups that serves as the target of the Cloud Scheduler job and triggers the Cloud function. For example:gcloud pubsub topics create cloud-bigtable-scheduled-backups –project <project-id>Then go to the Pub/Sub UI and verify that you can see the newly created topic:Deploy a function to Cloud FunctionsCreate and deploy a Cloud Function cbt-create-backup-function, which is called whenever a Pub/Sub message arrives in cloud-bigtable-scheduled-backups topic. The deploy-backup-function function in the script scheduled_backups.sh wraps the gcloud function to do that../scripts/scheduled_backups.sh deploy-backup-functionGo to the Cloud Functions UI to view the function. The function subscribes to the Pub/Sub topic cloud-bigtable-scheduled-backups.Deploying scheduled jobs using Cloud SchedulerNote: To use Cloud Scheduler, you must create an App Engine app. This can be done explicitly before the next step or indirectly when running the next step.Now we need to deploy the scheduled backup configuration to Cloud Scheduler. The configuration includes the time schedule of the cron job and the Pub/Sub topic name and message. This is also wrapped under a function in the script, and the configurations can be specified in the properties file../scripts/scheduled_backups.sh create-scheduleThe job is now visible in the Cloud Scheduler UI:Email notification of backup failuresTo get email notifications on backup creation failures, follow these steps:Follow this guide to add your email address as a notification channel.2. Create and deploy a custom metrics configuration file to filter logs generated by Cloud Functions, Cloud Scheduler, and Cloud Bigtable. We use Deployment Manager to create custom metrics. The example file can be found in ./config/metrics.yaml. Deploy the custom metrics in Cloud Logging:./scripts/scheduled_backups.sh add-metricsAfter this, you should see two user-defined metrics under Logs-based Metrics in Cloud Logging.3. From there, you can choose an Aggregrator, such as sum or mean, for the target metric, then define a condition that triggers an alert. For example, you can choose the following:Condition triggers if: Any time series violatesCondition: is aboveThreshold: 0For: 1 minute4. Add the notification channels you just created to the alerting policies. Whenever the condition breaks, you will receive an email notification.ConsiderationsTo use Cloud Scheduler, you must create an App Engine app. Once you set a zone for the App Engine app, you cannot change it. Your Cloud Scheduler job must run in the same zone as your App Engine app.Learn MoreTo get started, create a Cloud Bigtable instance or try it out with Cloud Bigtable Qwiklab.Check out this Github sample for details about this Scheduled Backup tool.Learn more about the managed backups feature of Cloud Bigtable.
Quelle: Google Cloud Platform

Customers handle up to 28% more concurrent chats with Agent Assist for Chat

Contact Center AI (CCAI) brings Google’s innovation in conversational AI to solve the most challenging customer service needs while lowering operational costs. More than a thousand customers have deployed CCAI and are steadily turning it on to power their production contact centers.Today, we’re excited to announce that we’ve made CCAI even stronger with Agent Assist for Chat, now in public preview.Agent Assist provides your human agents with continuous support during their calls and now chats by identifying the customers’ intent and providing them with real-time recommendations such as articles and FAQs as well as responses to customer messages to more effectively resolve the conversation.Customers using Agent Assist for Chat have been able to manage up to 28% more conversations concurrently, while also driving up customer satisfaction by 10%. Additionally, we’ve seen them respond up to 15% faster to chats, reducing chat abandonment rates and solving more customer problems.Agent Assist provides two key components to help agents manage conversations better: Smart Reply provides response suggestions to agents so they can quickly and appropriately respond to customer messages. These suggestions can be taken from your top performing agents as well as modified even further to ensure suggestions properly reflect the tone and voice of your brand. Agent Assist learns when and what recommendations to make by building a custom model that’s trained on your (and only your) data.Knowledge Assist unlocks the power of your knowledge base to provide articles and FAQ suggestions to agents in real-time as the conversation progresses. When using Knowledge Assist, agents no longer need to make the customer wait while they navigate multiple applications and data to find the resolution to the customer’s issue — the answer is delivered right to them.  “We’ve been very impressed by the chat capabilities of Agent Assist,” said Chris Smith, Vice President of Digital Service at Optus, one of the largest telecommunications companies in AustraliaOptus has been using CCAI Dialogflow CX to send queries to virtual agents and sees great potential to use Agent Assist to provide recommendations to their customer support representatives. They expect Agent Assist to help minimize repetitive tasks by providing response and typeahead suggestions, helping improve the efficiency of their agents and the quality and consistency of service they provide.Another customer, LoveHolidays, is using Agent Assist to support their agents and customers in the travel industry. “Agent Assist has been a beneficial aid to agents and our customers alike… It gives us the power to flex our contact center staff levels in hours not weeks,” said Eugene Neale, Director of CX Engineering & Business IT at LoveHolidaysAnalysts say online chat is becoming one of the most popular ways to reach out to businesses for customer support. IDC research finds that single-function contact centers worldwide are increasingly rare — in 2020, although phone/voice is still responsible for most interactions (at around 18%); email is responsible for around 13% of interactions, and live chat (without automation) is responsible for around 8% of interactions, according to IDC, Toward the AI-Powered Contact Center, Doc # EUR147017320, December 2020.Deploying CCAI with Agent Assist for ChatAs part of Google’s Contact Center AI suite, Agent Assist provides a seamless handoff from chats managed by your Dialogflow CX virtual agents. If a conversation or customer requires a live agent, Agent Assist will help your team pick it up quickly and drive it to a satisfying resolution. Historically, when managers saw contact center volumes increase they had two choices: allow customers to wait longer to speak to someone (lowering customer satisfaction) or bring on more agents (increasing cost to serve).  Deploying CCAI provides contact center leaders with a third choice: equip agents with tools like, Agent Assist for Chat, to efficiently manage customer interactions while maintaining high quality service.Global CCAI partners support Agent Assist for ChatAgent Assist for Chat is a set of public APIs that your engineering team can integrate directly into an agent desktop to control the agent experience from end-to-end. For a more out-of-the-box solution, we have partnered with LivePerson and 247.ai to build Agent Assist directly into their agent desktops.“Integrating our Conversational Cloud directly with Agent Assist means agents can leverage cutting-edge productivity AI to build even further on the massive ROI of conversational commerce, from reduced agent effort and time-to-respond to increased customer satisfaction and revenue,” said Alex Spinelli, CTO of LivePerson. More Agent Assist resourcesTo learn more, check out the Agent Assist webpage. Give Agent Assist a try by training a model and then testing it using the Agent Assist simulator.Related ArticleRespond to customers faster and more accurately with Dialogflow CXNew Dialogflow CX Virtual Agents can jumpstart your contact center operational efficiency goals, drive CSAT up and take care of your huma…Read Article
Quelle: Google Cloud Platform

What you can learn in our Q2 2021 Google Cloud Security Talks on May 12th

Join us for our second Google Cloud Security Talks of 2021, a live online event on May 12th where we’ll help you navigate the latest developments in cloud security.We’ll share expert insights into how we’re working to be your most trusted cloud by covering the following topics:Sunil Potti and Rob Sadowski will kick off Security Talks on May 12th.Following this will be a panel discussion on how organizations are using Confidential Computing with Harold Giménez (HashiCorp), Morgan Akers (JP Morgan Chase), Nelly Porter & Sam Lugani.Andy Wen and Neil Kumaran will discuss our use of machine learning/AI to stop online abuse. You will learn about COVID-19-related phishing and malware threats we’ve blocked in Gmail.A roundtable on new innovations that are making network security in the cloud even more powerful at protecting users from cyber attacks with Peter Blum, Matt Svensson (BetterCloud), and Gregory Lebovitz.Andy Chang will present on creating a secured landing zone for your organization on Google Cloud.We will look at strengthening the security of federated identity to your Google Cloud deployment, with Diego Zavala and Sriram Karra. Jian Zhen and Kiran Nair will do a deep dive into how you can leverage the Chrome browser and the new BeyondCorp Enterprise protected profile for Zero Trust access. Finally, Brad Meador and Chad Tyler will present on Google Workspace Security along with use-case based demos.We look forward to sharing our latest security insights and solutions with you. Sign-up now to reserve your virtual seat.Related ArticleWhat you can learn in our Q1 2021 Google Cloud Security TalksOur latest installment of our Google Cloud Security Talks, a live online event on March 3rd, will help you navigate the latest thinking i…Read Article
Quelle: Google Cloud Platform