एडब्ल्यूएस गोंद इंटरैक्टिव सत्र allow engineers to build, test, and run data preparation and analytics workloads in an interactive notebook. Interactive sessions provide isolated development environments, take care of the underlying compute cluster, and allow for configuration to stop idling resources.
Glue interactive sessions provides default recommended configurations, and also allows users to customize the session to meet their needs. For example, you can provision more workers to experiment on a larger dataset or set the idle timeout for long-running workloads. With the flexibility to change these options depending on the workload, you may need ensure that the options are changed within specific boundaries and apply a control mechanism.
In this post, we present the process of deploying a पुन: प्रयोज्य समाधान to enforce AWS Glue interactive session limits on three options: connection, number of workers, and maximum idle time. The first option addresses the need for applying custom inspection and controls on traffic, for example by enforcing an interactive session to only be run inside a VPC. The other two enforce limits on costs and usage of एडब्ल्यूएस गोंद resources by enforcing an upper boundary on the number of workers and idle time per session. You can further extend the solution for other properties or services within AWS Glue.
समाधान का अवलोकन
The proposed architecture is built on serverless components and runs whenever a new AWS Glue interactive session is created.
वर्कफ़्लो चरण इस प्रकार हैं:
- A data engineer creates a new AWS Glue interactive session either through the एडब्ल्यूएस प्रबंधन कंसोल or in a Jupyter notebook locally.
- The interactive session produces a new event to AWS क्लाउडट्रिल के लिए
CreateSession
event with all relevant information to identify and inspect a session as soon as the session is initiated. - An अमेज़न EventBridge rule filters the CloudTrail events and invokes an AWS लाम्बा function to inspect the
CreateSession
घटना। - The Lambda function inspects the
CreateSession
event and checks for all defined boundary conditions. Currently, the boundaries configurable with this solution are limited to maximum number of workers, idle timeout in minutes, and deployment with connection enforced. - If any of the defined boundary conditions are not met, for example too many workers are provisioned for the session, depending on the provided configuration, the function ends the interactive session immediately and sends an email via अमेज़न सरल अधिसूचना सेवा (Amazon SNS). If the session hasn’t started yet, the function will wait for it to start before taking any action.
- If the session was stopped, an email is sent to an SNS topic. There is no information available in the interactive session notebook on the reason for the ending of the session. Therefore, additional context information is provided through the SNS topic to the data engineers.
- If the function fails, the sessions are logged in a मृत-पत्र कतार अंदर अमेज़ॅन सरल कतार सेवा (Amazon SQS). Furthermore, the queue is monitored and in case of a message, it will trigger an अमेज़ॅन क्लाउडवॉच अलार्म।
The following steps walk you through how to build and deploy the solution. The code is available in the गीथहब रेपो.
.. पूर्वापेक्षाएँ
इस पूर्वाभ्यास के लिए, आपके पास निम्नलिखित शर्तें होनी चाहिए:
Overview of the deployed resources
All the necessary resources are defined in an एडब्ल्यूएस CloudFormation file located under cfn/template.yaml
. To deploy those resources, we use AWS सर्वर रहित अनुप्रयोग मॉडल (AWS SAM), which enables us to conveniently build and package all the dependencies and also manages the AWS CloudFormation steps for us.
क्लाउडफॉर्मेशन स्टैक निम्नलिखित संसाधनों को तैनात करता है:
- A Lambda function with its library, both defined under the directory src/functions. The function is the control. It will validate that the session is started within the limits defined.
- An EventBridge rule. This event listens to CloudTrail and in case of a new interactive session, will trigger the control Lambda function.
- An SQS dead-letter queue (DLQ) attached to the Lambda function. This keeps a record of events that triggered a Lambda function failure.
- Two CloudWatch alarms monitoring the Lambda function failures and the messages in the DLQ.
If notification via email is enabled, two more resources are deployed:
इसके अतिरिक्त, AWS CloudFormation सभी आवश्यक चीज़ें तैनात करता है AWS पहचान और अभिगम प्रबंधन (IAM) roles and policies, and an AWS प्रमुख प्रबंधन सेवा (AWS KMS) key to ensure that the exchanged data is encrypted.
समाधान तैनात करें
To facilitate the deployment lifecycle, including the setup of the user local environment, we provide a Makefile that describes all the necessary steps. Make sure you have your AWS credentials renewed and have access to your account. For more information, refer to कॉन्फ़िगरेशन और क्रेडेंशियल फ़ाइल सेटिंग्स.
- Explore the Makefile and adjust the Region and stack name as needed by modifying the values of the variables
AWS_REGION
औरSTACK_NAME
. - सेट
KILL_SESSION = "True"
if you want to immediately stop the interactive session that has been found out of boundaries. Allowed values are True or False; the default is True. - सेट
NOTIFICATION_EMAIL_ADDRESS = <your.email@provider.com>
मेंMakefile
if you want get notified when a session has been found out of boundaries. - Set values for your controls:
ENFORCE_VPC_CONNECTION
to stop sessions not running inside a VPC (true or false).MAX_WORKERS
to set the maximum number of workers for a session (numeric).MAX_IDLE_TIMEOUT_MINUTES
to define the maximum idle time for sessions in minutes (numeric).
- Install all the prerequisite libraries:
These will be installed under a newly created Python virtual environment inside this repository in the directory
.venv
. - Deploy the new stack:
This command will complete the following tasks:
- Check if the prerequisites are met.
- निष्पादन
pytest unittest
on the Python files. - Validate the CloudFormation template.
- Build the artifacts (Lambda function and Lambda layers).
- Deploy the resources via AWS SAM.
समाधान का परीक्षण करें
का संदर्भ लें पेश है ज्यूपिटर के लिए एडब्ल्यूएस ग्लू इंटरएक्टिव सत्र for information about running an interactive session. If you follow the instructions in the post (see the section अपना पहला कोड सेल चलाएँ और अपनी AWS ग्लू नोटबुक लिखें), the initialization of the interactive session should fail with an error similar to the following.
Example of code in the cell:
Received output:
If you enabled the email feature, you should also get an email notification.
You can also check on the AWS Glue console that your session ID isn’t listed.
क्लीन अप
Clean up the deployed resources by running the following command:
Note that the resources deployed from following the recommended post, पेश है ज्यूपिटर के लिए एडब्ल्यूएस ग्लू इंटरएक्टिव सत्र, will not be removed with the previous command.
सीमाओं
The delivery guarantee for CloudTrail events to EventBridge are best effort. This means CloudTrail will attempt to deliver all events to EventBridge, but in some rare cases, an event might not be delivered. For more information, refer to AWS सेवाओं की घटनाएँ.
निष्कर्ष
This post described how to build, deploy, and test a solution to enforce boundary conditions on AWS Glue interactive sessions in order to enforce constraints on the number of workers, idle timeouts, and AWS Glue connection.
You can adapt this solution based on your needs and further extend it to allow controls on other options.
To learn more about how to use AWS Glue interactive sessions, refer to पेश है ज्यूपिटर के लिए एडब्ल्यूएस ग्लू इंटरएक्टिव सत्र और लेखक एडब्ल्यूएस गोंद इंटरैक्टिव सत्र का उपयोग करके PyCharm के साथ AWS ग्लू जॉब.
लेखक के बारे में
निकोलस जैकब बेयर is a Senior Cloud Application Architect with a strong focus on data engineering and machine learning, based in Switzerland. He works closely with enterprise customers to design data platforms and build advanced analytics/ml use-cases.
Luca Mazzaferro is a Senior DevOps Architect at Amazon Web Services. He likes to have infrastructure automated, reproducible and secured. In his free time he likes to cook, especially pizza.
केमेंग झांग is a Cloud Application Architect with a strong focus on machine learning and UX, based in Switzerland. She works closely with customers to design user experiences and build advanced analytics/ml use-cases.
Mark Walser, a Senior Global Data Architect at Amazon Web Services, collaborates with customers to develop innovative Big Data solutions that solve business problems and speed up the adoption of AWS services. Outside of work, he finds pleasure in running, swimming, and all things related to technology.
गल हेने is a Product Manager for AWS Glue with a strong focus on AI/ML, data engineering and BI, based in California. She is passionate about developing a deep understanding of customer’s business needs and collaborating with engineers to design easy to use data products.
- एसईओ संचालित सामग्री और पीआर वितरण। आज ही प्रवर्धित हो जाओ।
- प्लेटोडेटा.नेटवर्क वर्टिकल जेनरेटिव एआई। स्वयं को शक्तिवान बनाएं। यहां पहुंचें।
- प्लेटोआईस्ट्रीम। Web3 इंटेलिजेंस। ज्ञान प्रवर्धित। यहां पहुंचें।
- प्लेटोईएसजी. ऑटोमोटिव/ईवीएस, कार्बन, क्लीनटेक, ऊर्जा, पर्यावरण, सौर, कचरा प्रबंधन। यहां पहुंचें।
- BlockOffsets. पर्यावरणीय ऑफसेट स्वामित्व का आधुनिकीकरण। यहां पहुंचें।
- स्रोत: https://aws.amazon.com/blogs/big-data/enforce-boundaries-on-aws-glue-interactive-sessions/
- :हैस
- :है
- :नहीं
- $यूपी
- 1
- 10
- 100
- 7
- a
- About
- पहुँच
- लेखा
- कार्य
- अनुकूलन
- अतिरिक्त
- पतों
- दत्तक ग्रहण
- उन्नत
- ऐ / एमएल
- अलार्म
- सब
- अनुमति देना
- की अनुमति दी
- की अनुमति देता है
- भी
- वीरांगना
- अमेज़ॅन वेब सेवा
- an
- विश्लेषिकी
- और
- कोई
- आवेदन
- लागू करें
- लागू
- स्थापत्य
- हैं
- तर्क
- AS
- At
- लेखक
- स्वचालित
- उपलब्ध
- एडब्ल्यूएस
- एडब्ल्यूएस CloudFormation
- एडब्ल्यूएस गोंद
- आधारित
- BE
- किया गया
- से पहले
- BEST
- बड़ा
- बड़ा डेटा
- ब्लॉग
- के छात्रों
- सीमाओं
- निर्माण
- बनाया गया
- व्यापार
- लेकिन
- by
- कैलिफ़ोर्निया
- बुला
- कर सकते हैं
- कौन
- मामला
- मामलों
- सेल
- परिवर्तन
- बदल
- चेक
- जाँचता
- निकट से
- बादल
- समूह
- कोड
- सहयोग
- पूरा
- घटकों
- गणना करना
- स्थितियां
- विन्यास
- संबंध
- कंसोल
- की कमी
- प्रसंग
- नियंत्रण
- नियंत्रण
- लागत
- बनाना
- बनाया
- बनाता है
- क्रेडेंशियल
- साख
- वर्तमान में
- रिवाज
- ग्राहक
- तिथि
- डेटा इंजीनियर
- डेटा तैयारी
- गहरा
- चूक
- परिभाषित
- उद्धार
- दिया गया
- प्रसव
- निर्भर करता है
- तैनात
- तैनात
- तैनाती
- तैनाती
- तैनात
- वर्णित
- डिज़ाइन
- विकसित करना
- विकासशील
- विकास
- DevOps
- आसान
- प्रयास
- भी
- ईमेल
- सक्षम
- सक्षम बनाता है
- एन्क्रिप्टेड
- समाप्त होता है
- लागू करना
- लागू करने
- इंजीनियर
- अभियांत्रिकी
- इंजीनियर्स
- सुनिश्चित
- उद्यम
- उद्यम ग्राहकों
- वातावरण
- वातावरण
- त्रुटि
- विशेष रूप से
- ईथर (ईटीएच)
- कार्यक्रम
- घटनाओं
- उदाहरण
- अपवाद
- आदान-प्रदान किया
- अनुभव
- प्रयोग
- विस्तार
- की सुविधा
- असफल
- विफल रहता है
- विफलता
- असत्य
- Feature
- पट्टिका
- फ़ाइलें
- फ़िल्टर
- पाता
- प्रथम
- लचीलापन
- फोकस
- का पालन करें
- निम्नलिखित
- इस प्रकार है
- के लिए
- पाया
- मुक्त
- से
- समारोह
- आगे
- और भी
- GAL
- मिल
- वैश्विक
- गारंटी
- है
- he
- उसके
- कैसे
- How To
- एचटीएमएल
- http
- HTTPS
- आई ए एम
- ID
- पहचान करना
- पहचान
- निष्क्रिय
- if
- तुरंत
- आयात
- in
- सहित
- करें-
- इंफ्रास्ट्रक्चर
- शुरू
- अभिनव
- अंदर
- निर्देश
- इंटरैक्टिव
- में
- का आह्वान
- पृथक
- IT
- आईटी इस
- काम
- नौकरियां
- जेपीजी
- जुपीटर नोटबुक
- कुंजी
- बड़ा
- परतों
- जानें
- सीख रहा हूँ
- पुस्तकालयों
- पुस्तकालय
- जीवन चक्र
- को यह पसंद है
- सीमित
- सीमाएं
- सूचीबद्ध
- स्थानीय
- स्थानीय स्तर पर
- स्थित
- लॉग इन
- मशीन
- यंत्र अधिगम
- बनाना
- प्रबंध
- प्रबंधक
- प्रबंधन करता है
- बहुत
- अधिकतम
- मई..
- साधन
- तंत्र
- मिलना
- message
- संदेश
- घास का मैदान
- हो सकता है
- मिनट
- नजर रखी
- निगरानी
- अधिक
- नाम
- आवश्यक
- आवश्यकता
- जरूरत
- की जरूरत है
- नया
- नए नए
- नहीं
- नोटबुक
- अधिसूचना
- संख्या
- हुआ
- of
- on
- केवल
- आपरेशन
- विकल्प
- ऑप्शंस
- or
- आदेश
- अन्य
- आउट
- उत्पादन
- बाहर
- पैकेज
- आवेशपूर्ण
- प्रति
- पिज़्ज़ा
- प्लेटफार्म
- प्लेटो
- प्लेटो डेटा इंटेलिजेंस
- प्लेटोडाटा
- खुशी
- नीतियाँ
- पद
- तैयारी
- आवश्यक शर्तें
- वर्तमान
- पिछला
- समस्याओं
- प्रक्रिया
- पैदा करता है
- एस्ट्रो मॉल
- उत्पादन प्रबंधक
- उत्पाद
- गुण
- प्रस्तावित
- प्रदान करना
- बशर्ते
- प्रदान करता है
- प्रावधान
- अजगर
- दुर्लभ
- तैयार
- कारण
- की सिफारिश की
- रिकॉर्ड
- क्षेत्र
- सम्बंधित
- प्रासंगिक
- हटाया
- नवीकृत
- कोष
- उपयुक्त संसाधन चुनें
- भूमिकाओं
- नियम
- रन
- दौड़ना
- चलाता है
- सैम
- अनुभाग
- सिक्योर्ड
- देखना
- भेजता
- वरिष्ठ
- भेजा
- serverless
- सेवाएँ
- सत्र
- सत्र
- सेट
- व्यवस्था
- वह
- चाहिए
- समान
- सरल
- समाधान
- समाधान ढूंढे
- हल
- कुछ
- जल्दी
- स्पार्क
- विशिष्ट
- गति
- धुआँरा
- प्रारंभ
- शुरू
- कथन
- स्थिति
- कदम
- रुकें
- रोक
- मजबूत
- निश्चित
- तैराकी
- स्विजरलैंड
- लेना
- ले जा
- कार्य
- टेक्नोलॉजी
- टेम्पलेट
- परीक्षण
- कि
- RSI
- लेकिन हाल ही
- वहाँ।
- इसलिये
- इन
- चीज़ें
- इसका
- उन
- तीन
- यहाँ
- पहर
- सेवा मेरे
- भी
- विषय
- यातायात
- रूपांतरण
- ट्रिगर
- शुरू हो रहा
- <strong>उद्देश्य</strong>
- दो
- टाइप
- के अंतर्गत
- आधारभूत
- समझ
- us
- प्रयोग
- उपयोग
- बक्सों का इस्तेमाल करें
- उपयोगकर्ता
- उपयोगकर्ताओं
- का उपयोग
- ux
- सत्यापित करें
- मान
- के माध्यम से
- वास्तविक
- प्रतीक्षा
- इंतज़ार कर रही
- walkthrough
- करना चाहते हैं
- था
- we
- वेब
- वेब सेवाओं
- कब
- जब कभी
- कौन कौन से
- जब
- मर्जी
- साथ में
- अंदर
- काम
- कामगार
- श्रमिकों
- वर्कफ़्लो
- कार्य
- अभी तक
- इसलिए आप
- आपका
- जेफिरनेट