aws-samples / aws-samples/sample-beam-on-emr-serverless
Documentation Bug: Scripts must be run from scripts/ directory, not repository root
- Dominant language
- Shell
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Description
The README.md instructs users to run scripts from the repository root directory, but the scripts are designed to be executed from within the `scripts/` directory. This causes path resolution issues for environment variable loading in scripts 02-06.
## Steps to Reproduce
**Following the README instructions (doesn't work):**
1. Clone the repository:
```bash
git clone https://github.com/aws-samples/sample-beam-on-emr-serverless.git
cd sample-beam-on-emr-serverless
```
2. Run the setup script as documented:
```bash
./scripts/01_setup_env.sh # Creates config at ./config/env.sh
```
3. Run the build script as documented:
```bash
./scripts/02_build_container.sh # Looks for scripts/config/env.sh - FAILS
```
## Root Cause
The `01_setup_env.sh` script creates the config directory based on the working directory:
**Line 23-24:**
```bash
WORKDIR="$(pwd)/beam-demo"
cd "$WORKDIR"
```
**Line 198:**
```bash
CONFIG_DIR="$(dirname "$(pwd)")/config"
```
When run from repository root:
- Creates working directory at: `/repo-root/beam-demo/`
- Config directory is created at: `/repo-root/config/env.sh`
But scripts 02-06 expect config at: `/repo-root/scripts/config/env.sh`
## Expected Behavior
The README should document the correct way to run the scripts.
## Actual Behavior
Following the README instructions causes all scripts after 01 to fail with "Failed to load environment variables"
## Proposed Fix
Update the README.md to instruct users to run scripts from the `scripts/` directory:
### Current (incorrect):
```bash
./scripts/01_setup_env.sh
./scripts/02_build_container.sh
./scripts/03_create_application.sh
...
```
### Should be:
```bash
cd scripts
./01_setup_env.sh
./02_build_container.sh
./03_create_application.sh
...
```
**the "Run All Scripts" section:**
```bash
cd scripts
./run_all_timed.sh
```
## Files That Need Updates
- `README.md` - Update all script execution examples (lines 49-77)
Contributor guide
Assessment
This issue has not been assessed yet.