| title | Development Environment Setup Guide on Linux |
|---|
This guide establishes a cloud-based development environment using Amazon Linux 2023 or Ubuntu 24.04 on AWS EC2, specifically designed for the GenAI IDP accelerator.
Purpose: Provides a standardized, scalable development infrastructure that combines the familiar VSCode interface on your local machine with powerful cloud compute resources. This approach eliminates local environment configuration issues while ensuring consistent development experiences across team members.
When to use this guide:
- You need a new development environment
- Your current setup has configuration issues
- You prefer cloud-based development with scalable resources
- You want a clean, isolated environment for this project
What you'll achieve:
A hybrid development setup where your code runs on a pre-configured Amazon Linux EC2 instance while you work through VS Code on your local machine, providing both performance and consistency.
- Log into AWS Management Console
- Navigate to EC2 service
- Click Launch Instance
Name: genai-idp-dev-environment(example)
AMI Selection (choose one):
Option 1: Amazon Linux 2023
Option 2: Ubuntu 24.04
Instance Type:
- Heavy development: t3.2xlarge (8 vCPU, 32 GB RAM)(recommended)
(Other instance types will also work, but this is one we tested)
- Click Create new key pair (or select existing)
- Name: genai-idp-dev-key (example)
- Type: RSA
- Format: .pem
- Download and save the .pem file securely
Security Group Configuration:
- Create new security group
- Add these inbound rules:
- SSH: Port 22, Source: My IP
- Size: 720 GiB
- Type: gp3
- Delete on termination: Yes
Click Launch instance and wait for it to reach "Running" state.
- Select your instance in EC2 console
- Note the Public IPv4 address
On local machine:
ssh -i /path/to/genai-idp-dev-key.pem ec2-user@YOUR_INSTANCE_IP
For Amazon Linux 2023:
sudo dnf install git -yFor Ubuntu 24.04:
sudo apt update && sudo apt install git -ygit clone https://github.com/aws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws
cd accelerated-intelligent-document-processing-on-aws/
cd scripts
For Amazon Linux 2023:
chmod +x ./dev_setup_al2023.sh
./dev_setup_al2023.shFor Ubuntu 24.04:
chmod +x ./dev_setup_ubuntu.sh
./dev_setup_ubuntu.shFor Amazon Linux 2023:
source /home/ec2-user/miniconda/bin/activate baseFor Ubuntu 24.04:
source /home/ubuntu/miniconda/bin/activate base4.1 Visit the official website: Go to https://code.visualstudio.com/
Download: Click the "Download for Windows" button
- This will download the User Installer (recommended for most users)
- File name will be something like VSCodeUserSetup-x64-1.x.x.exe
Install:
- Run the downloaded installer
- Choose installation location (default is recommended)
Launch: Click "Launch Visual Studio Code" when installation completes
Install Remote - SSH extension (by Microsoft)
To open "SSH Config" go to "Remote Explorer" option on left bar
You can open and edit "SSH config" file by settings option on "SSH" Tab
For Amazon Linux 2023:
Host genai-idp-dev
HostName YOUR_INSTANCE_PUBLIC_IP
User ec2-user
IdentityFile /path/to/genai-idp-dev-key.pem
Port 22
For Ubuntu 24.04:
Host genai-idp-dev-ubuntu
HostName YOUR_INSTANCE_PUBLIC_IP
User ubuntu
IdentityFile /path/to/genai-idp-dev-key.pem
Port 22
- Press Ctrl+Shift+P
- Type "Remote-SSH: Connect to Host"
- Select "genai-idp-dev" (Amazon Linux) or "genai-idp-dev-ubuntu" (Ubuntu)
- Open folder:
- Amazon Linux:
/home/ec2-user/accelerated-intelligent-document-processing-on-aws - Ubuntu:
/home/ubuntu/accelerated-intelligent-document-processing-on-aws
- Amazon Linux:
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
make setup-venv
source .venv/bin/activateNote: This installs the
idp-clicommand along with all required Python dependencies.
idp-cli publish --helpStandard build and publish:
idp-cli publish --source-dir . --region us-east-1Pattern-2 container images are built automatically when Pattern-2 changes are detected. Ensure Docker is running and you have ECR permissions.
If the build fails, use the --verbose flag to see detailed error messages:
idp-cli publish --source-dir . --region us-east-1 --verboseThe verbose flag will show:
- Exact SAM build commands being executed
- Complete error output from failed builds
- Python version compatibility issues
- Missing dependencies or configuration problems
Note: The legacy
publish.pyscript is deprecated. Useidp-cli publishfor all new builds.
What it is: An AI coding assistant that runs as a VS Code extension, powered by various LLMs (Claude, GPT, etc.)
Key capabilities:
- Autonomous code editing across multiple files
- Executes terminal commands and reads file outputs
- Can browse the web for documentation/research
- Maintains context across entire codebases
- Handles complex, multi-step development tasks
Why it's helpful: Acts like an AI pair programmer that can actually write, test, and debug code independently while you supervise.
- You can install it from "Extensions" tab on VSCode.
What it is: AWS's AI coding assistant integrated into IDEs, specifically designed for AWS development
Key capabilities:
- Code suggestions and completions optimized for AWS services
- Security vulnerability scanning and fixes
- AWS best practices recommendations
- Infrastructure as Code (CloudFormation, CDK) assistance
- Direct integration with AWS documentation and services
Why it's helpful: Specialized for AWS development with deep knowledge of AWS services, perfect for this GenAI-IDP project since it's built entirely on AWS.
- You can install it from https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html