Skip to content

Commit b7d1631

Browse files
Maha Lakshmi Soumya Yalavarthigudivt
authored andcommitted
Add Windows WSL development environment setup guide
- Add comprehensive WSL setup documentation for Windows developers - Include step-by-step installation and configuration instructions - Add troubleshooting guidance and alternative distribution options - Configure .gitattributes for proper line ending handling
1 parent da1db80 commit b7d1631

File tree

1 file changed

+134
-70
lines changed

1 file changed

+134
-70
lines changed

docs/setup-development-env-WSL.md

Lines changed: 134 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,169 @@
1-
# Development Environment Setup Guide on Windows using WSL
2-
3-
## Introduction
1+
# Development Environment Setup Guide on Windows using WSL(Windows Subsystem for Linux)
2+
# Introduction
43
This guide establishes a WSL-based development environment on Windows, specifically designed for the GenAI IDP accelerator.
54

6-
**Purpose**: Provides a Linux development environment directly on Windows without virtualization overhead, combining native Windows tools with a complete Linux development stack.
7-
8-
**When to use this guide**:
9-
- You're developing on Windows and need Linux compatibility
10-
- You want to avoid Docker Desktop or VM overhead
11-
- You need consistent behavior with the project's Linux-based AWS infrastructure
12-
- You prefer integrated Windows/Linux development workflows
13-
14-
**What you'll achieve**: A seamless development setup where you can use Windows tools (VS Code, browsers, file explorers) while running the GenAI IDP accelerator in a native Linux environment.
15-
16-
## Prerequisites
5+
Purpose: Provides a Linux development environment directly on Windows without virtualization overhead, combining native Windows tools with a complete Linux
6+
development stack. This approach eliminates cross-platform compatibility issues while maintaining familiar Windows workflows.
177

18-
**Official Microsoft WSL Installation Guide**: https://docs.microsoft.com/en-us/windows/wsl/install
8+
When to use this guide:
9+
• You're developing on Windows and need Linux compatibility
10+
• You want to avoid Docker Desktop or VM overhead
11+
• You need consistent behavior with the project's Linux-based AWS infrastructure
12+
• You prefer integrated Windows/Linux development workflows
1913

20-
## Step 1: Enable WSL on Windows
14+
What you'll achieve:
15+
A seamless development setup where you can use Windows tools (VS Code, browsers, file explorers) while running the GenAI IDP accelerator in a native Linux
16+
environment, ensuring compatibility with AWS Lambda's Linux runtime and deployment targets.
17+
# Official Microsoft WSL Installation Guide:
18+
https://docs.microsoft.com/en-us/windows/wsl/install
2119

22-
### 1.1 Install WSL with Ubuntu
20+
# Step 1: Enable WSL on Windows
21+
### 1.1 Enable WSL Feature for example Ubuntu
2322
1. Open PowerShell as Administrator
2423
2. Run the installation command:
25-
```bash
24+
```
2625
wsl --install -d Ubuntu
2726
```
28-
3. Complete Ubuntu setup with username/password
29-
4. You will enter into linux shell directly, then go to your WSL home directory using ``` cd ~ ```
30-
31-
## Step 2: Clone Repository and Run Setup Script
32-
33-
### 2.1 Clone Repository
27+
3. Restart your computer when prompted
28+
4. Complete Ubuntu setup with username/password
29+
### 1.2 Verify Installation
30+
```
31+
wsl --version
32+
```
33+
# Step 2: Install Development Tools in WSL
34+
Open "Ubuntu" in local machine
35+
### 2.1 Update System Packages
36+
```
37+
sudo apt update && sudo apt upgrade -y
38+
```
39+
### 2.2 Install Essential Tools
40+
### Install Git
41+
```
42+
sudo apt install git -y
43+
```
44+
# Step 3: Clone and Setup Project
45+
### Clone Repository
3446
```
3547
git clone https://github.com/aws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws
3648
```
49+
### Go to directory
3750
```
3851
cd accelerated-intelligent-document-processing-on-aws
3952
```
40-
41-
### 2.2 Run Automated Setup Script
53+
### Install Python and pip
4254
```
43-
./scripts/wsl_setup.sh
55+
sudo apt install python3 python3-pip -y
4456
```
45-
This script automatically installs:
46-
- Git, Python 3, pip, and build tools
47-
- Node.js 18
48-
- AWS CLI v2
49-
- AWS SAM CLI
50-
- Python dependencies (boto3, rich, PyYAML, botocore, ruff, pytest)
51-
52-
After running the setup script, go to your WSL home directory using ```cd ~```
53-
54-
## Step 3: Complete Manual Setup
55-
56-
### 3.1 Create Python Virtual Environment
57+
### Verify Python version
58+
```
59+
python3 --version
60+
```
61+
### Create and setup Python Environment
5762
```
5863
python3 -m venv venv
5964
source venv/bin/activate
6065
```
61-
62-
### 3.2 Install Python Dependencies
63-
```bash
64-
pip install setuptools wheel boto3 rich PyYAML botocore ruff pytest
66+
### Build tools and make
67+
```
68+
sudo apt install build-essential make -y
69+
```
70+
### Install Node.js for UI development
71+
```
72+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
73+
```
74+
```
75+
sudo apt-get install -y nodejs
76+
```
77+
### AWS CLI
78+
#### Downloads the latest AWS CLI zip file for Linux x86_64 architecture
79+
```
80+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscli.zip"
81+
```
82+
#### Unzip aws-cli-linux-x86_64.zip -d
83+
```
84+
unzip awscli.zip
85+
```
86+
#### Installation
87+
```
88+
sudo ./aws/install
6589
```
66-
### 3.3 Configure AWS CLI
67-
```bash
68-
aws configure
90+
#### Remove Zip file
6991
```
70-
Enter your AWS credentials when prompted. Refer to: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
92+
rm -rf aws awscli.zip
93+
```
94+
### Verify AWS CLI installation
95+
```
96+
aws --version
97+
```
98+
### AWS SAM CLI
99+
#### Downloads the latest AWS SAM CLI zip file for Linux x86_64 architecture from GitHub releases
100+
```
101+
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
102+
```
103+
#### Unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
104+
```
105+
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
106+
```
107+
#### Installation
108+
```
109+
sudo ./sam-installation/install
110+
```
111+
#### Remove Zip file
112+
```
113+
rm -rf sam-installation aws-sam-cli-linux-x86_64.zip
114+
```
115+
### Verify SAM Installation
116+
```
117+
sam --version
118+
```
119+
### Install package building tools
120+
```
121+
pip install setuptools wheel
122+
```
123+
### Install all dependencies required for python
124+
```
125+
pip install boto3 rich PyYAML botocore
126+
```
127+
### Install development tools
128+
```
129+
pip install ruff pytest
130+
```
131+
### Install IDP common package in development mode
132+
```
133+
pip install -e lib/idp_common_pkg/
134+
```
135+
# Step 4: AWS Configure
136+
### Refer this link for AWS configure
137+
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
71138

72-
## Step 4: Test the Setup
139+
# Step 5: Run Publish Script
140+
## Using publish.py (Recommended)
73141

74-
### 4.1 Verify All Tools
75-
```bash
76-
# Check versions
77-
python3 --version (Example: Python 3.12.3)
78-
aws --version (Example: aws-cli/2.28.26)
79-
sam --version (Example: SAM CLI, version 1.143.0)
80-
node --version (Example: v18.20.8)
81-
npm --version (Example: 10.8.2)
142+
### Test publish script help
82143
```
83-
### 4.2 Test Build Process
144+
python3 publish.py --help
84145
```
85-
cd accelerated-intelligent-document-processing-on-aws
146+
### Test build using publish.py
86147
```
148+
python3 publish.py bucket_name build-test us-east-1
87149
```
88-
# Test publish script help
89-
python3 publish.py --help
90-
91-
# Test build (replace with your S3 bucket name)
92-
python3 publish.py your-bucket-name build-test us-east-1
150+
### Troubleshooting Build Issues
151+
If the build fails, use the `--verbose` flag to see detailed error messages:
93152
```
94-
95-
### 4.3 Troubleshooting Build Issues
96-
If the build fails, use the `--verbose` flag:
97-
```bash
98-
python3 publish.py your-bucket-name build-test us-east-1 --verbose
153+
python3 publish.py bucket_name build-test us-east-1 --verbose
99154
```
100-
101-
The verbose flag shows:
155+
The verbose flag will show:
102156
- Exact SAM build commands being executed
103157
- Complete error output from failed builds
104158
- Python version compatibility issues
105159
- Missing dependencies or configuration problems
160+
161+
## Using publish.sh (Legacy)
162+
### Test publish script help
163+
```
164+
./publish.sh --help
165+
```
166+
### Test build using publish.sh
167+
```
168+
./publish.sh bucket_name build-test us-east-1
169+
```

0 commit comments

Comments
 (0)