Skip to content

Commit 765efd9

Browse files
author
Taniya Mathur
committed
Fix Windows build issues and improve dev setup
- Update dev_setup.bat to use idp/genaiic-idp-accelerator directory structure - Fix pywin32 dependency issue in analytics processor requirements - Add Windows development environment setup documentation
1 parent 62f125e commit 765efd9

File tree

3 files changed

+189
-8
lines changed

3 files changed

+189
-8
lines changed

docs/setup-development-env-win.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Windows Development Environment Setup
2+
3+
This guide provides instructions for setting up a complete development environment for the GenAI IDP accelerator on Windows systems using the automated setup script.
4+
5+
## Prerequisites
6+
7+
Before running the setup script, ensure you have:
8+
9+
- **Windows 10 or Windows 11** with latest updates
10+
- **Administrator privileges** on your machine
11+
- **Internet connectivity** for downloading packages
12+
- **PowerShell** (included with Windows)
13+
- **At least 10GB free disk space** for all development tools
14+
15+
## Running the Setup Script
16+
17+
### Step 1: Run as Administrator
18+
19+
1. Right-click on **Command Prompt** or **PowerShell**
20+
2. Select **"Run as administrator"**
21+
3. Navigate to the project directory:
22+
```cmd
23+
cd path\to\genaiic-idp-accelerator
24+
```
25+
4. Execute the setup script:
26+
```cmd
27+
scripts\dev_setup.bat
28+
```
29+
30+
### Step 2: Follow Interactive Prompts
31+
32+
The script will guide you through:
33+
34+
1. **AWS Credentials Configuration**:
35+
```
36+
Enter AWS Access Key ID:
37+
Enter AWS Secret Access Key:
38+
Enter AWS Default Region (e.g., us-east-1):
39+
```
40+
41+
2. **GitLab Project Setup**:
42+
- SSH URL (uses default if not specified)
43+
- Local parent directory name (defaults to "idp")
44+
- Branch selection (defaults to "develop")
45+
- Project will be cloned to `C:\Projects\<parent-dir>\genaiic-idp-accelerator`
46+
47+
3. **Build Configuration**:
48+
- S3 bucket name for artifacts
49+
- S3 prefix (defaults to "idp")
50+
- AWS region (defaults to "us-east-1")
51+
- Build options: Standard, Verbose, or Skip build
52+
53+
## What Gets Installed
54+
55+
The script automatically installs and configures:
56+
57+
### Development Tools
58+
- **Python 3.12** - Required runtime for the project
59+
- **Node.js** - For React UI development
60+
- **Git** - Version control
61+
- **AWS CLI** - AWS service interaction
62+
- **AWS SAM CLI** - Serverless application deployment
63+
- **Docker Desktop** - Container support
64+
- **Chocolatey** - Windows package manager
65+
66+
### Python Dependencies
67+
- **boto3** - AWS SDK for Python
68+
- **numpy 2.3.2** - Numerical computing
69+
- **typer** - CLI framework
70+
- **rich** - Rich text and beautiful formatting
71+
- **editdistance** - String similarity calculations
72+
- **python-docx** - Word document processing
73+
74+
## Troubleshooting
75+
76+
### Common Issues
77+
78+
#### Administrator Privileges Error
79+
**Problem**: Script fails with "must be run as Administrator"
80+
**Solution**:
81+
- Close current command prompt
82+
- Right-click Command Prompt → "Run as administrator"
83+
- Navigate back to project directory and retry
84+
85+
#### Python Version Issues
86+
**Problem**: "Python version is too old. Need Python 3.12 or later"
87+
**Solution**: The script will automatically install Python 3.12
88+
89+
#### Chocolatey Installation Fails
90+
**Problem**: PowerShell execution policy restrictions
91+
**Solution**: The script handles this automatically, but if issues persist:
92+
```powershell
93+
Set-ExecutionPolicy Bypass -Scope Process -Force
94+
```
95+
96+
#### AWS CLI Configuration Test Fails
97+
**Problem**: "AWS configuration test failed"
98+
**Solution**:
99+
- Verify your AWS credentials are correct
100+
- Check internet connectivity
101+
- Ensure your AWS account has necessary permissions
102+
103+
#### Docker Installation Issues
104+
**Problem**: Docker Desktop installation fails or requires restart
105+
**Solution**:
106+
- Complete the script execution
107+
- Restart your computer when prompted
108+
- Docker Desktop may require manual startup after restart
109+
110+
#### Build Failures (pywin32 Error)
111+
**Problem**: `Error: PythonPipBuilder:ResolveDependencies - {pywin32==311(wheel)}`
112+
**Solution**: This is a known issue with Windows-specific dependencies:
113+
```cmd
114+
# Clean build cache and retry
115+
rmdir /s /q .aws-sam
116+
python publish.py <bucket> <prefix> <region>
117+
118+
# Or use container build (requires Docker)
119+
sam build --use-container
120+
```
121+
122+
#### SAM CLI Version Requirements
123+
**Problem**: Build fails due to SAM CLI version
124+
**Solution**: The script installs SAM CLI >= 1.129.0 automatically. If issues persist:
125+
```cmd
126+
# Check version
127+
sam --version
128+
129+
# Update if needed
130+
choco upgrade aws-sam-cli -y
131+
```
132+
133+
## Validation
134+
135+
After successful installation, the script automatically validates:
136+
137+
- ✓ Python 3.12+ installation
138+
- ✓ Node.js installation
139+
- ✓ AWS CLI installation and configuration
140+
- ✓ Git installation
141+
- ✓ Docker installation (may show warning if not running)
142+
- ✓ SAM CLI installation
143+
- ✓ Python package installations (boto3, numpy, typer, rich)
144+
145+
## Next Steps
146+
147+
After successful setup:
148+
149+
1. **Review the validation output** to ensure all components installed correctly
150+
2. **Restart your computer** if Docker Desktop was installed
151+
3. **Your development environment is ready** - the script has already built the project if you selected that option
152+
4. **Use the provided CloudFormation template URL** to deploy the stack to AWS
153+
154+
## Build Options Explained
155+
156+
The script offers three build options:
157+
158+
1. **Standard build (recommended)**: Builds the project with normal output
159+
2. **Verbose build**: Provides detailed output for debugging build issues
160+
3. **Skip build**: Only sets up the environment without building the project
161+
162+
## Support
163+
164+
If you encounter issues:
165+
166+
1. Check the script output for specific error messages
167+
2. Review the validation results at the end of the script
168+
3. Consult the project's main [Troubleshooting Guide](./troubleshooting.md)
169+
4. Contact the development team with detailed error logs
170+
171+
---
172+
173+
**Note**: The setup process may take 30-60 minutes depending on your internet connection. A system restart may be required after Docker Desktop installation.

scripts/dev_setup.bat

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,17 @@ if not exist "C:\Projects" (
368368

369369
cd /d "C:\Projects"
370370

371+
REM Create the parent directory if it doesn't exist
372+
if not exist "!PROJECT_DIR!" (
373+
mkdir "!PROJECT_DIR!"
374+
)
375+
376+
cd "!PROJECT_DIR!"
377+
371378
REM Check if project directory already exists
372-
if exist "!PROJECT_DIR!" (
373-
echo Project directory C:\Projects\!PROJECT_DIR! already exists
374-
cd "!PROJECT_DIR!"
379+
if exist "genaiic-idp-accelerator" (
380+
echo Project directory C:\Projects\!PROJECT_DIR!\genaiic-idp-accelerator already exists
381+
cd "genaiic-idp-accelerator"
375382

376383
REM Check if it's a git repository
377384
git status >nul 2>&1
@@ -433,14 +440,14 @@ if exist "!PROJECT_DIR!" (
433440
goto :build_project
434441
) else (
435442
echo Directory exists but is not a git repository
436-
echo Please remove C:\Projects\!PROJECT_DIR! or choose a different directory name
443+
echo Please remove C:\Projects\!PROJECT_DIR!\genaiic-idp-accelerator or choose a different directory name
437444
pause
438445
goto :skip_gitlab
439446
)
440447
)
441448

442449
REM Clone the project
443-
git clone "!GITLAB_PROJECT_URL!" "!PROJECT_DIR!"
450+
git clone "!GITLAB_PROJECT_URL!" "genaiic-idp-accelerator"
444451

445452
if !errorLevel! neq 0 (
446453
echo ERROR: Failed to clone GitLab project
@@ -449,7 +456,7 @@ if !errorLevel! neq 0 (
449456
goto :skip_gitlab
450457
)
451458

452-
cd "!PROJECT_DIR!"
459+
cd "genaiic-idp-accelerator"
453460

454461
echo.
455462
echo Repository cloned successfully!
@@ -494,7 +501,7 @@ if !errorLevel! neq 0 (
494501
echo Successfully checked out existing local branch !TARGET_BRANCH!
495502
)
496503

497-
echo GitLab project cloned successfully to C:\Projects\!PROJECT_DIR!
504+
echo GitLab project cloned successfully to C:\Projects\!PROJECT_DIR!\genaiic-idp-accelerator
498505

499506
:skip_gitlab
500507
:build_project
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
aws-requests-auth==0.4.3
22
requests==2.31.0
3-
./lib/idp_common_pkg[agents] # idp_common package with analytics agent implementation
3+
# Use core package only to avoid Windows-specific dependencies like pywin32
4+
./lib/idp_common_pkg[core]

0 commit comments

Comments
 (0)