Skip to content

Commit 9e400f4

Browse files
Edit Developer Environment Guide for Linux.md
1 parent b5a5fb3 commit 9e400f4

File tree

1 file changed

+71
-88
lines changed

1 file changed

+71
-88
lines changed

docs/Developer Environment Guide for Linux.md

Lines changed: 71 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,104 @@
1-
# Development Environment Setup Guide
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.
215

316
## Step 1: Launch EC2 Instance
417

5-
### 1.1 Navigate to EC2 Console
18+
# 1.1 Navigate to EC2 Console
619
1. Log into [AWS Management Console](https://console.aws.amazon.com/)
720
2. Navigate to EC2 service
821
3. Click Launch Instance
922

10-
### 1.2 Configure Instance Settings
11-
Name: genai-idp-dev-environment
23+
# 1.2 Configure Instance Settings
24+
Name: genai-idp-dev-environment (example)
1225
AMI Selection:
1326
**Amazon Linux 2023**
14-
• Search: "Amazon Linux 2023 AMI"
15-
• Architecture: 64-bit (x86)
27+
Architecture: 64-bit (x86)
1628
Instance Type:
17-
• Heavy development: t3.xlarge (4 vCPU, 16 GB RAM)
29+
• Heavy development: t3.2xlarge (8 vCPU, 32 GB RAM)(recommended)
30+
(Other instance types will also work, but this is one we tested)
1831

19-
### 1.3 Key Pair Setup
32+
# 1.3 Key Pair Setup
2033
1. Click Create new key pair (or select existing)
21-
2. Name: genai-idp-dev-key
34+
2. Name: genai-idp-dev-key (example)
2235
3. Type: RSA
2336
4. Format: .pem
2437
5. Download and save the .pem file securely
2538

26-
### 1.4 Network Settings
39+
# 1.4 Network Settings
2740
Security Group Configuration:
28-
1. Create new security group: genai-idp-dev-sg
41+
1. Create new security group: genai-idp-dev-sg (example)
2942
2. Add these inbound rules:
3043
**SSH**: Port 22, Source: My IP
3144

32-
### 1.5 Storage Configuration
33-
• Size: 30 GiB (minimum 20GB)
45+
# 1.5 Storage Configuration
46+
• Size: 720 GiB (minimum 20GB)
3447
• Type: gp3
3548
• Delete on termination: Yes
3649

37-
### 1.6 Launch
50+
# 1.6 Launch
3851
Click Launch instance and wait for it to reach "Running" state.
3952

4053
## Step 2: Connect to Your Instance
4154

42-
### Get Connection Info
55+
# Get Connection Info
4356
1. Select your instance in EC2 console
4457
2. Note the Public IPv4 address
4558

46-
### SSH Connection Command
47-
48-
For Amazon Linux 2023:
59+
#SSH Connection Command
60+
On local machine:
4961
```bash
50-
# Command Prompt
62+
# CMD Terminal
5163
ssh -i /path/to/genai-idp-dev-key.pem ec2-user@YOUR_INSTANCE_IP
52-
53-
# Windows PowerShell:
64+
or
65+
# PowerShell:
5466
ssh -i C:\path\to\genai-idp-dev-key.pem ec2-user@YOUR_INSTANCE_IP
5567
```
68+
## Step 3: Automated Setup Script
5669

57-
## Step 3: Install Development Tools
58-
Once connected, run these commands:
59-
60-
### 3.1 Verify User Data Results
61-
62-
```bash
63-
# Check versions
64-
python3 --version # Should be 3.13.x
65-
aws --version # Should be aws-cli/2.x
66-
```
67-
68-
### 3.2 Install Build Tools
69-
```bash
70-
# Amazon Linux 2023:
71-
sudo yum groupinstall -y "Development Tools"
72-
sudo yum install -y make gcc gcc-c++ jq
73-
```
74-
75-
### 3.3 Generate an SSH key
76-
```bash
77-
# Run the following command to generate an ECDSA key:
78-
ssh-keygen -t ecdsa -b 521 -C "your_email@example.com"
79-
```
70+
# Introduction:
71+
For faster setup, you can use this automated script that installs all required development tools in one go. This
72+
script configures Python 3.12, AWS CLI, SAM CLI, Node.js, Docker, and development tools with optimized settings.
73+
What it installs: Complete development stack including Python 3.13, AWS CLI v2, SAM CLI, Node.js 18, Docker,
74+
Miniconda, and enhanced shell configuration.
75+
Usage: Copy the script below, save it as setup.sh, make it executable with chmod +x setup.sh, and run ./setup.sh.
76+
Reboot required after completion.
8077

81-
Press Enter to save the key as ~/.ssh/id_ecdsa. Optionally, add a passphrase.
78+
Note: This script is an alternative to the manual installation steps.
8279

83-
### 3.4 Initialize the key with AWS GitLab
80+
./scripts/dev_setup.sh
8481
```bash
85-
# Register your SSH public key with GitLab:
86-
mwinit -k ~/.ssh/id_ecdsa.pub
87-
```
88-
89-
### 3.5 Test the connection
90-
```bash
91-
# Verify that you can connect to GitLab over SSH:
92-
ssh -T ssh.gitlab.aws.dev
93-
```
94-
95-
Expected output:
96-
```
97-
Welcome to GitLab, @your-username!
98-
```
99-
100-
### 3.6 Setup Python Environment
101-
```bash
102-
# Create and activate virtual environment
103-
python3 -m venv venv
104-
source venv/bin/activate
105-
106-
# Install dependencies
107-
pip install --upgrade pip
108-
cd lib/idp_common_pkg
109-
pip install -e .
110-
cd ../..
111-
```
112-
113-
## Step 4: VSCode Remote Development Setup
114-
115-
### 4.1 Install VSCode Extension (Local Machine)
82+
# Navigate to the project directory
83+
cd /home/ec2-user/genaiic-idp-accelerator
84+
85+
# Run the setup script
86+
./scripts/dev_setup.sh
87+
88+
## Step 4: Install Visual Studio Code
89+
Visit the official website: Go to [https://code.visualstudio.com/](https://code.visualstudio.com/)
90+
Download: Click the "Download for Windows" button
91+
• This will download the User Installer (recommended for most users)
92+
• File name will be something like VSCodeUserSetup-x64-1.x.x.exe
93+
Install:
94+
• Run the downloaded installer
95+
• Choose installation location (default is recommended)
96+
Launch: Click "Launch Visual Studio Code" when installation completes
97+
98+
VSCode setup
11699
1. Open VSCode on your local computer
117100
2. Install Remote - SSH extension (by Microsoft)
118101

119-
### Clone your repository
120-
Once connected, clone repositories using SSH:
121-
```bash
122-
git clone git@ssh.gitlab.aws.dev:your-group/your-repo.git
123-
```
124-
125102
### 4.2 Connect via VSCode: Update your SSH config
126103
Press Ctrl+Shift+P for commands
127104
Append the following block to your ~/.ssh/config file:
@@ -134,19 +111,25 @@ Host genai-idp-dev
134111
Port 22
135112
```
136113
137-
### 4.3 Connect via VSCode
114+
# Clone Repository
115+
bash
116+
git clone https://github.com/aws-samples/genaiic-idp-accelerator.git
117+
cd genaiic-idp-accelerator
118+
119+
120+
# 4.3 Connect via VSCode
138121
1. Press Ctrl+Shift+P
139122
2. Type "Remote-SSH: Connect to Host"
140123
3. Select "genai-idp-dev"
141124
4. Open folder: /home/ec2-user/genaiic-idp-accelerator
142125
143-
## Step 5: Verify Setup
126+
## Step 5: Setup
144127
145-
### Test Development Environment
128+
### Setup Python Environment
146129
```bash
147-
# Activate virtual environment
130+
# Create and activate virtual environment
131+
python3 -m venv venv
148132
source venv/bin/activate
149-
```
150133
151134
### Test Build Process
152135
```bash

0 commit comments

Comments
 (0)