|
| 1 | +# Development Environment Setup Guide on Linux |
| 2 | +# Introduction |
| 3 | +This guide establishes a cloud-based development environment using Amazon Linux 2023 on AWS EC2, specifically designed for the GenAI IDP accelerator. |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +When to use this guide: |
| 8 | +- You need a new development environment |
| 9 | +- Your current setup has configuration issues |
| 10 | +- You prefer cloud-based development with scalable resources |
| 11 | +- You want a clean, isolated environment for this project |
| 12 | + |
| 13 | +What you'll achieve: |
| 14 | +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. |
| 15 | + |
| 16 | +# Step 1: Launch EC2 Instance |
| 17 | + |
| 18 | +## 1.1 Navigate to EC2 Console |
| 19 | +1. Log into [AWS Management Console](https://console.aws.amazon.com/) |
| 20 | +2. Navigate to EC2 service |
| 21 | +3. Click Launch Instance |
| 22 | + |
| 23 | +## 1.2 Configure Instance Settings |
| 24 | +Name: genai-idp-dev-environment(example) |
| 25 | +AMI Selection: |
| 26 | +Amazon Linux 2023 |
| 27 | +- Architecture: 64-bit (x86) |
| 28 | + |
| 29 | +Instance Type: |
| 30 | +- Heavy development: t3.2xlarge (8 vCPU, 32 GB RAM)(recommended) |
| 31 | +(Other instance types will also work, but this is one we tested) |
| 32 | + |
| 33 | +## 1.3 Key Pair Setup |
| 34 | +1. Click Create new key pair (or select existing) |
| 35 | +2. Name: genai-idp-dev-key (example) |
| 36 | +3. Type: RSA |
| 37 | +4. Format: .pem |
| 38 | +5. Download and save the .pem file securely |
| 39 | + |
| 40 | +## 1.4 Network Settings |
| 41 | +Security Group Configuration: |
| 42 | +1. Create new security group |
| 43 | +2. Add these inbound rules: |
| 44 | +- **SSH**: Port 22, Source: My IP |
| 45 | + |
| 46 | +## 1.5 Storage Configuration |
| 47 | +- Size: 720 GiB |
| 48 | +- Type: gp3 |
| 49 | +- Delete on termination: Yes |
| 50 | + |
| 51 | +## 1.6 Launch |
| 52 | +Click Launch instance and wait for it to reach "Running" state. |
| 53 | + |
| 54 | +# Step 2: Connect to Your Instance |
| 55 | + |
| 56 | +## Get Connection Info |
| 57 | +1. Select your instance in EC2 console |
| 58 | +2. Note the Public IPv4 address |
| 59 | + |
| 60 | +## SSH Connection Command |
| 61 | +On local machine: |
| 62 | +### CMD Terminal |
| 63 | +ssh -i /path/to/genai-idp-dev-key.pem ec2-user@YOUR_INSTANCE_IP |
| 64 | +### To install git run this command on EC2 Instance |
| 65 | +sudo dnf install git -y |
| 66 | + |
| 67 | +### Clone Repository |
| 68 | +git clone https://github.com/aws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws |
| 69 | + |
| 70 | +### Go to directory |
| 71 | + cd accelerated-intelligent-document-processing-on-aws/ |
| 72 | + |
| 73 | +### Run the setup script for development tools which is scripts directory |
| 74 | +cd scripts |
| 75 | +sh ./dev_setup.sh |
| 76 | + |
| 77 | +### To upgrade the python version run this command on EC2 instance |
| 78 | +source /home/ec2-user/miniconda/bin/activate base |
| 79 | + |
| 80 | +# Step 4: Install Visual Studio Code on Local Machine |
| 81 | +## 4.1 Visit the official website: Go to [https://code.visualstudio.com/](https://code.visualstudio.com/) |
| 82 | +Download: Click the "Download for Windows" button |
| 83 | +- This will download the User Installer (recommended for most users) |
| 84 | +- File name will be something like VSCodeUserSetup-x64-1.x.x.exe |
| 85 | + |
| 86 | +Install: |
| 87 | + - Run the downloaded installer |
| 88 | + - Choose installation location (default is recommended) |
| 89 | + |
| 90 | +Launch: Click "Launch Visual Studio Code" when installation completes |
| 91 | +Install Remote - SSH extension (by Microsoft) |
| 92 | + |
| 93 | +## 4.2 Connect via VSCode: Update your SSH config |
| 94 | +To open "SSH Config" go to "Remote Explorer" option on left bar |
| 95 | +You can open and edit "SSH config" file by settings option on "SSH" Tab |
| 96 | + |
| 97 | +``` |
| 98 | +Host genai-idp-dev |
| 99 | + HostName YOUR_INSTANCE_PUBLIC_IP |
| 100 | + User ec2-user |
| 101 | + IdentityFile /path/to/genai-idp-dev-key.pem |
| 102 | + Port 22 |
| 103 | +``` |
| 104 | + |
| 105 | +# 4.3 Connect via VSCode |
| 106 | +1. Press Ctrl+Shift+P |
| 107 | +2. Type "Remote-SSH: Connect to Host" |
| 108 | +3. Select "genai-idp-dev" |
| 109 | +4. Open folder: /home/ec2-user/accelerated-intelligent-document-processing-on-aws |
| 110 | + |
| 111 | +# Step 5: AWS Configure |
| 112 | +### Refer this link for AWS configure |
| 113 | +https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html |
| 114 | + |
| 115 | +# Step 6: Run Publish Script |
| 116 | +## Test Build Process |
| 117 | +### Test publish script help |
| 118 | +./publish.sh --help |
| 119 | + |
| 120 | +### Test build (this will take 10-15 minutes) |
| 121 | +./publish.sh bucket_name build-test us-east-1 |
| 122 | + |
| 123 | +# Step 7: Cline & Q Developer installation |
| 124 | +### Cline |
| 125 | +What it is: An AI coding assistant that runs as a VS Code extension, powered by various LLMs (Claude, GPT, etc.) |
| 126 | + |
| 127 | +Key capabilities: |
| 128 | +- Autonomous code editing across multiple files |
| 129 | +- Executes terminal commands and reads file outputs |
| 130 | +- Can browse the web for documentation/research |
| 131 | +- Maintains context across entire codebases |
| 132 | +- Handles complex, multi-step development tasks |
| 133 | + |
| 134 | +Why it's helpful: Acts like an AI pair programmer that can actually write, test, and debug code independently while you supervise. |
| 135 | +- You can install it from "Extensions" tab on VSCode. |
| 136 | + |
| 137 | +### Amazon Q Developer |
| 138 | +What it is: AWS's AI coding assistant integrated into IDEs, specifically designed for AWS development |
| 139 | + |
| 140 | +Key capabilities: |
| 141 | +- Code suggestions and completions optimized for AWS services |
| 142 | +- Security vulnerability scanning and fixes |
| 143 | +- AWS best practices recommendations |
| 144 | +- Infrastructure as Code (CloudFormation, CDK) assistance |
| 145 | +- Direct integration with AWS documentation and services |
| 146 | + |
| 147 | +Why it's helpful: Specialized for AWS development with deep knowledge of AWS services, perfect for this GenAI-IDP project since it's |
| 148 | +built entirely on AWS. |
| 149 | +- You can install it from https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html |
0 commit comments