-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
412 changed files
with
18,589 additions
and
12,705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Destroy Benchmark Env | ||
|
||
on: | ||
schedule: | ||
- cron: '30 4 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: benchmarking | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
|
||
- name: Azure login | ||
uses: azure/login@v2.1.1 | ||
with: | ||
client-id: ${{ secrets.BENCHMARK_ARM_CLIENT_ID }} | ||
tenant-id: ${{ secrets.BENCHMARK_ARM_TENANT_ID }} | ||
subscription-id: ${{ secrets.BENCHMARK_ARM_SUBSCRIPTION_ID }} | ||
|
||
- run: Setup node | ||
- uses: actions/setup-node@v4.0.2 | ||
with: | ||
node-version: 20.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Destroy cloud env | ||
if: github.event.inputs.debug == 'true' | ||
run: pnpm destroy-cloud-env | ||
working-directory: packages/@n8n/benchmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Run Nightly Benchmark | ||
run-name: Benchmark ${{ inputs.n8n_tag }} | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
description: 'Use debug logging' | ||
required: true | ||
default: 'false' | ||
n8n_tag: | ||
description: 'Name of the n8n docker tag to run the benchmark against.' | ||
required: true | ||
default: 'nightly' | ||
benchmark_tag: | ||
description: 'Name of the benchmark cli docker tag to run the benchmark with.' | ||
required: true | ||
default: 'latest' | ||
|
||
env: | ||
ARM_CLIENT_ID: ${{ secrets.BENCHMARK_ARM_CLIENT_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.BENCHMARK_ARM_SUBSCRIPTION_ID }} | ||
ARM_TENANT_ID: ${{ secrets.BENCHMARK_ARM_TENANT_ID }} | ||
K6_API_TOKEN: ${{ secrets.K6_API_TOKEN }} | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: benchmarking | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
|
||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: '1.8.5' | ||
|
||
- run: corepack enable | ||
- uses: actions/setup-node@v4.0.2 | ||
with: | ||
node-version: 20.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Azure login | ||
uses: azure/login@v2.1.1 | ||
with: | ||
client-id: ${{ env.ARM_CLIENT_ID }} | ||
tenant-id: ${{ env.ARM_TENANT_ID }} | ||
subscription-id: ${{ env.ARM_SUBSCRIPTION_ID }} | ||
|
||
- name: Run the benchmark with debug logging | ||
if: github.event.inputs.debug == 'true' | ||
run: pnpm run-in-cloud sqlite --debug | ||
working-directory: packages/@n8n/benchmark | ||
|
||
- name: Run the benchmark | ||
if: github.event.inputs.debug != 'true' | ||
run: pnpm run-in-cloud sqlite | ||
working-directory: packages/@n8n/benchmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
**/.terraform/* | ||
**/*.tfstate* | ||
**/*.tfvars | ||
privatekey.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
data "azurerm_resource_group" "main" { | ||
name = var.resource_group_name | ||
} | ||
|
||
# Random prefix for the resources | ||
resource "random_string" "prefix" { | ||
length = 8 | ||
special = false | ||
} | ||
|
||
# SSH key pair | ||
resource "tls_private_key" "ssh_key" { | ||
algorithm = "RSA" | ||
rsa_bits = 4096 | ||
} | ||
|
||
# Dedicated Host Group & Hosts | ||
|
||
resource "azurerm_dedicated_host_group" "main" { | ||
name = "${random_string.prefix.result}-hostgroup" | ||
location = var.location | ||
resource_group_name = data.azurerm_resource_group.main.name | ||
platform_fault_domain_count = 1 | ||
automatic_placement_enabled = false | ||
zone = 1 | ||
|
||
tags = local.common_tags | ||
} | ||
|
||
resource "azurerm_dedicated_host" "hosts" { | ||
name = "${random_string.prefix.result}-host" | ||
location = var.location | ||
dedicated_host_group_id = azurerm_dedicated_host_group.main.id | ||
sku_name = var.host_size_family | ||
platform_fault_domain = 0 | ||
|
||
tags = local.common_tags | ||
} | ||
|
||
# VM | ||
|
||
module "test_vm" { | ||
source = "./modules/benchmark-vm" | ||
|
||
location = var.location | ||
resource_group_name = data.azurerm_resource_group.main.name | ||
prefix = random_string.prefix.result | ||
dedicated_host_id = azurerm_dedicated_host.hosts.id | ||
ssh_public_key = tls_private_key.ssh_key.public_key_openssh | ||
vm_size = var.vm_size | ||
|
||
tags = local.common_tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "vm_name" { | ||
value = azurerm_linux_virtual_machine.main.name | ||
} | ||
|
||
output "ip" { | ||
value = azurerm_public_ip.main.ip_address | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/@n8n/benchmark/infra/modules/benchmark-vm/vars.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
variable "location" { | ||
description = "Region to deploy resources" | ||
default = "East US" | ||
} | ||
|
||
variable "resource_group_name" { | ||
description = "Name of the resource group" | ||
} | ||
|
||
variable "prefix" { | ||
description = "Prefix to append to resources" | ||
} | ||
|
||
variable "dedicated_host_id" { | ||
description = "Dedicated Host ID" | ||
} | ||
|
||
variable "ssh_public_key" { | ||
description = "SSH Public Key" | ||
} | ||
|
||
variable "vm_size" { | ||
description = "VM Size" | ||
# 4 vCPUs, 16 GiB memory | ||
default = "Standard_DC4s_v2" | ||
} | ||
|
||
variable "tags" { | ||
description = "Tags to apply to all resources created by this module" | ||
type = map(string) | ||
} |
Oops, something went wrong.