Skip to content

Run AWS interactive sessions in VSCode

0

Hi, I am trying to follow this https://docs.aws.amazon.com/glue/latest/dg/interactive-sessions-vscode.html. However, there is no vscode plugin called "AWS Glue interactive sessions" on the market. I installed AWS Toolkit plugin instead. However, I could not find the the kernel.

Any idea to make it working? Thanks!

asked a year ago525 views
2 Answers
0

I apologize for the confusion, but it seems there might be a misunderstanding regarding the AWS Glue interactive sessions in Visual Studio Code (VSCode). You're correct that there isn't a specific VSCode plugin called "AWS Glue interactive sessions" in the marketplace.

To use AWS Glue interactive sessions in VSCode, you need to follow these steps:

  1. First, ensure you have installed the AWS Glue interactive sessions and verified that it works with Jupyter Notebook.

  2. Download and install Visual Studio Code with Jupyter support.

  3. Install the AWS Toolkit for Visual Studio Code from the VS Code Marketplace. This is the correct plugin to use, which you've already done.

  4. In VSCode, you need to disable Jupyter AutoStart to prevent conflicts with the interactive sessions.

  5. Create a new Jupyter Notebook file with a .ipynb extension and open it.

  6. For the kernel selection:

    • On Windows: You should be able to select the Glue PySpark kernel.
    • On MacOS: You might need to obtain a Jupyter URL and select the Existing Jupyter Server with that URL.
  7. To create an AWS Glue Interactive Session, specify any required magics at the top of the first cell and run a statement of code.

If you're still unable to find the Glue PySpark kernel, make sure that you've properly set up the AWS Glue interactive sessions prerequisites. Also, ensure that your AWS credentials are correctly configured in VSCode using the AWS Toolkit.

If issues persist, you may want to check your AWS Glue Studio for any active interactive sessions and manage them appropriately, as this could potentially affect your ability to create new sessions in VSCode.

Remember, AWS Glue interactive sessions are designed for rapid development and testing of data preparation and analytics applications, so make sure to manage your sessions correctly to avoid unnecessary costs.
Sources
Using interactive sessions with Microsoft Visual Studio Code - AWS Glue
Installing the AWS Toolkit for Visual Studio Code - AWS Toolkit for VS Code
Manage AWS Glue interactive sessions | AWS re:Post

answered a year ago
  • What specific do you mean by "First, ensure you have installed the AWS Glue interactive sessions"? How to "install the AWS Glue interactive sessions"? A Glue session to me is a remote process running the spark cluster. How can I even "install" it? Thanks!

0

Hello,

From the description, I understand that you are unable to select Glue PySpark as kernel to run AWS interactive sessions in VSCode as mentioned in doc.

Kindly note that, in order to get started with the AWS Glue interactive sessions ensure that you meet the prerequisites to setup interactive sessions locally.

As per the prerequisites doc, ensure that you install jupyter and follow the steps mentioned below.

  1. Run the below commands to install the jupyter kernelspec for both pyspark and spark kernels
pip3 install --upgrade jupyter boto3 aws-glue-sessions
install-glue-kernels
  1. As AWS Glue interactive sessions requires the same IAM permissions as AWS Glue Jobs and Dev Endpoints, thereby make sure you specify the role used with interactive sessions, it can be either with the %iam_role and %region magics or with an additional line in ~/.aws/config.

  2. Kindly ensure that session credentials and region are properly configured. You can refer the doc to know more about credentials configuration.

  3. Next, disable Jupyter AutoStart in VS Code where you check the box "Jupyter: Disable Jupyter Auto Start" in Jupyter's extension settings as mentioned in doc in the "To get started with interactive sessions with VSCode" section.

  4. Next, create a new file and save this file with name of your choice as .ipynb extension or select jupyter under select a language and save the file.

  5. Click on "Select Kernel" and a list of available kernels is displayed. Choose "Glue PySpark". In case, if you are unable to find Glue PySpark kernel then run a local Jupyter session to obtain the URL.

  6. Copy the URL, click the current kernel > select Another Kernel > select Existing Jupyter Server and paste the URL.

  7. If successful, this will display the kernel Glue PySpark.

Please note that, I am able run AWS interactive sessions in VSCode by choosing Glue PySpark as kernel in my test environment by following the above steps.

Therefore, kindly follow the above steps to select Glue PySpark as kernel to run AWS Glue interactive sessions in VSCode.

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.