Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/compile-graalvm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Compile GraalVM lambda
on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21' # See 'Options' for more details
distribution: 'graalvm' # See 'Supported distributions' for available options
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Example step
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
- name: Compile using Maven plugin # https://graalvm.github.io/native-build-tools/latest/maven-plugin.html
run: |
cd lambda/graalvm/GraalVMLambda
AWS_REGION=eu-west-2 mvn -Pnative package
- uses: actions/upload-artifact@v4
with:
name: function.zip
path: lambda/graalvm/GraalVMLambda/target/function.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ benchmark/data/*
benchmark/scripts/plots/*
__pycache__/*
.DS_Store
.terraform
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,21 @@ npm run build

```

Then deploy:
Then deploy to Localstack to test:

```bash
cd infra
docker-compose up -d
cd infra/environments/local
tofu init
tofu apply
```

## Deploying to AWS

All lambdas built on an ARM Mac will run in AWS apart from the GraalVM lambda - follow instructions in its README.

```
cd infra/environments/production
tofu init
tofu apply
```
Expand All @@ -48,9 +59,26 @@ tofu apply

Install the Python requirements and run the script to send events to the Lambdas:

### Setup

It may be necessary to install venv and install the benchmark requirements:

```
mkdir ~/.venv
python3 -m venv ~/.venv
source ~/.venv/bin/activate
python3 -m pip install -r requirements.txt
```

Then to run the benchmark in localstack (presumably with a low job size to test):

```
AWS_DEFAULT_REGION=eu-west-2 AWS_ENDPOINT_URL=http://localhost:4566 AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test python run_load_test.py
```

And for the real test in AWS where your credentials are set up:

```bash
cd benchmark/scripts
pip install -r requirements.txt
python run_load_test.py
```

Expand Down
3,638 changes: 3,638 additions & 0 deletions benchmark/data/parsed_cloudwatch_logs.csv

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion benchmark/scripts/analyse_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def save_plot(ax, plot_name: str) -> None:
def print_and_plot_init_duration_by_language(data: pd.DataFrame) -> None:
cold_starts = data[data["cold_start"] == True]


print("Cold start times per language - p50, p95, p99")
print(
cold_starts.groupby("name")["init_duration_ms"]
Expand All @@ -24,7 +25,7 @@ def print_and_plot_init_duration_by_language(data: pd.DataFrame) -> None:
)
print("-" * 10)

ax = sns.histplot(x="init_duration_ms", hue="name", binwidth=20, data=data)
ax = sns.histplot(x="init_duration_ms", hue="name", binwidth=20, data=cold_starts)
ax.set_title("Cold start times by language")
ax.set_xlabel("Init duration (ms)")
ax.set_ylabel("Count")
Expand Down
Loading