From 198f15f0d93d5b483b790a42608ce11677eb1d11 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Wed, 9 Jul 2025 18:25:57 +0200 Subject: [PATCH 1/6] binary provisioning: GA Signed-off-by: Pablo Chacin --- ...un-extensions-using-binary-provisioning.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md index f5c9dbe1f8..58e999b593 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md @@ -1,7 +1,4 @@ --- -labels: - products: - - cloud title: 'Run extensions using Binary Provisioning' description: 'Learn how to run scripts that require extensions using Binary Provisioning.' weight: 04 @@ -9,26 +6,17 @@ weight: 04 # Run extensions using Binary Provisioning -{{< admonition type="caution" >}} - -This is an experimental feature. Breaking changes might occur prior to the feature being made generally available. - -{{< /admonition >}} - k6 supports [extensions](https://grafana.com/docs/k6//extensions/) as a way of extending k6 native functionality, and support a wider variety of use cases. -Using k6 with extensions locally requires users to build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries) that includes the extension, which can then be used to run a test script. With the Binary Provisioning feature, Grafana Cloud k6 users can run tests with a [limited set of extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud), without having to manually build a k6 binary. - -The `archive` and `inspect` commands also support Binary Provisioning to allow creating archives for Grafana Cloud. +Using k6 with extensions requires users to build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries) that includes the extension, which can then be used to run a test script. With the Binary Provisioning feature, k6 users can run tests using extensions without having to manually build a k6 binary. ## Before you begin To use Binary Provisioning, you'll need: -- k6 v1.0 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/). -- A [Grafana Cloud account](https://grafana.com/auth/sign-up/create-user). +- k6 v1.2 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/). -## Set the Binary Provsioning environment flag +## Set the Binary Provisioning environment flag To enable Binary Provisioning, you must set the `K6_BINARY_PROVISIONING` environment variable to `true`: @@ -49,13 +37,27 @@ $Env:K6_BINARY_PROVISIONING = "true" {{< /code >}} -## Log in to Grafana Cloud +## Enable community extensions (Optional) + +By default the Binary Provisioning allows using [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud). With the `ENABLE_COMMUNITY_EXTENSIONS` all extension in the extensions registry are available. + +> When running tests in the cloud only the officially supported extensions are allowed. + +{{< code >}} + +```linux +export ENABLE_COMMUNITY_EXTENSIONS=true +``` + +```mac +export ENABLE_COMMUNITY_EXTENSIONS=true +``` -To use Binary Provisioning, you must [authenticate to Grafana Cloud](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/tokens-and-cli-authentication/#authenticate-with-the-login-command) using the `k6 cloud login` command: +```windows-powershell +$Env:ENABLE_COMMUNITY_EXTENSIONS = "true" -```bash -k6 cloud login --token ``` +{{< /code >}} ## Run a test @@ -97,7 +99,7 @@ You should see an output similar to the following: ```sh INFO[0000] The current k6 binary doesn't satisfy all dependencies, it is required to provision a custom binary. deps="k6/x/faker*" -INFO[0000] A new k6 binary has been provisioned with version(s): k6:v1.0.0 k6/x/faker:v0.4.3 +INFO[0000] A new k6 binary has been provisioned with version(s): k6:v1.2.0 k6/x/faker:v0.4.3 time="2025-04-24T12:59:24+02:00" level=info msg=Zelma source=console @@ -116,7 +118,4 @@ The output includes information about which dependencies were detected, and the ## Limitations -- Only extensions supported in Grafana Cloud are supported. - Output extensions are not supported. -- Running scripts from stdin is not supported. -- Only files with extensions `.js`, `.ts` or `.tar` can be used. Other extensions will not invoke the Binary Provisioning mechanism. From fa243ef418af888f5908bd39ecc6b7ac52626c9b Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 31 Jul 2025 14:39:33 +0200 Subject: [PATCH 2/6] add link to community extensions Signed-off-by: Pablo Chacin --- .../next/extensions/run-extensions-using-binary-provisioning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md index 58e999b593..1947a9b924 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md @@ -39,7 +39,7 @@ $Env:K6_BINARY_PROVISIONING = "true" ## Enable community extensions (Optional) -By default the Binary Provisioning allows using [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud). With the `ENABLE_COMMUNITY_EXTENSIONS` all extension in the extensions registry are available. +By default the Binary Provisioning allows using [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud). With the `ENABLE_COMMUNITY_EXTENSIONS` all extension in the extensions registry are available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). > When running tests in the cloud only the officially supported extensions are allowed. From dff9be56023f132d309a3bebecf7763bffec4952 Mon Sep 17 00:00:00 2001 From: pablochacin Date: Thu, 31 Jul 2025 14:59:53 +0200 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com> --- .../run-extensions-using-binary-provisioning.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md index 1947a9b924..b09b7576e0 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md @@ -14,11 +14,11 @@ Using k6 with extensions requires users to build a [custom k6 binary](https://gr To use Binary Provisioning, you'll need: -- k6 v1.2 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/). +- k6 v1.2.0 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/). ## Set the Binary Provisioning environment flag -To enable Binary Provisioning, you must set the `K6_BINARY_PROVISIONING` environment variable to `true`: +Set the `K6_BINARY_PROVISIONING` environment variable to `true` to enable the feature: {{< code >}} @@ -39,22 +39,22 @@ $Env:K6_BINARY_PROVISIONING = "true" ## Enable community extensions (Optional) -By default the Binary Provisioning allows using [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud). With the `ENABLE_COMMUNITY_EXTENSIONS` all extension in the extensions registry are available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). +By default [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) can be used. With the `K6_ENABLE_COMMUNITY_EXTENSIONS` the full list of available extensions is available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). > When running tests in the cloud only the officially supported extensions are allowed. {{< code >}} ```linux -export ENABLE_COMMUNITY_EXTENSIONS=true +export K6_ENABLE_COMMUNITY_EXTENSIONS=true ``` ```mac -export ENABLE_COMMUNITY_EXTENSIONS=true +export K6_ENABLE_COMMUNITY_EXTENSIONS=true ``` ```windows-powershell -$Env:ENABLE_COMMUNITY_EXTENSIONS = "true" +$Env:K6_ENABLE_COMMUNITY_EXTENSIONS = "true" ``` {{< /code >}} From 4205b994a95e5d1cd5797544427ceb7a4f900eac Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 7 Aug 2025 18:04:25 +0200 Subject: [PATCH 4/6] rename feature and make it enabled by default Signed-off-by: Pablo Chacin --- ...s-using-automatic-extension-resolution.md} | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename docs/sources/k6/next/extensions/{run-extensions-using-binary-provisioning.md => run-extensions-using-automatic-extension-resolution.md} (71%) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md similarity index 71% rename from docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md rename to docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md index b09b7576e0..ce5d3efb18 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md @@ -1,46 +1,46 @@ --- -title: 'Run extensions using Binary Provisioning' -description: 'Learn how to run scripts that require extensions using Binary Provisioning.' +title: 'Run scripts using automatic extension resolution' +description: 'Learn how to run scripts that require extensions.' weight: 04 --- -# Run extensions using Binary Provisioning +# Run extensions k6 supports [extensions](https://grafana.com/docs/k6//extensions/) as a way of extending k6 native functionality, and support a wider variety of use cases. -Using k6 with extensions requires users to build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries) that includes the extension, which can then be used to run a test script. With the Binary Provisioning feature, k6 users can run tests using extensions without having to manually build a k6 binary. +The Automatic Extension Resolution feature allows k6 users run tests using any of the [official extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) without having to manually build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries). + ## Before you begin -To use Binary Provisioning, you'll need: +To use Automatic Extension Resolution, you'll need: - k6 v1.2.0 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/). -## Set the Binary Provisioning environment flag +## Disable the Automatic Extension Resolution -Set the `K6_BINARY_PROVISIONING` environment variable to `true` to enable the feature: +This feature can be disable using the `K6_AUTO_EXTENSION_RESOLUTION` environment variable to `false`. {{< code >}} ```linux -export K6_BINARY_PROVISIONING=true +export K6_AUTO_EXTENSION_RESOLUTION=false ``` ```mac -export K6_BINARY_PROVISIONING=true +export K6_AUTO_EXTENSION_RESOLUTION=false ``` ```windows-powershell -$Env:K6_BINARY_PROVISIONING = "true" +$Env:K6_AUTO_EXTENSION_RESOLUTION = "false" ``` - {{< /code >}} ## Enable community extensions (Optional) By default [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) can be used. With the `K6_ENABLE_COMMUNITY_EXTENSIONS` the full list of available extensions is available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). - +tfalserue > When running tests in the cloud only the officially supported extensions are allowed. {{< code >}} @@ -59,9 +59,11 @@ $Env:K6_ENABLE_COMMUNITY_EXTENSIONS = "true" ``` {{< /code >}} -## Run a test +## Using unsupported extension + +Users requiring extensions not supported by the Automatic Extension Resolution can build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries). -After setting the `K6_BINARY_PROVISIONING` environment variable and logging in to Grafana Cloud, you can run a test using the `k6 cloud run` command: +## Run a test {{< code >}} From f405d6494d04a062935f6ae8c29cc19aed4985e4 Mon Sep 17 00:00:00 2001 From: pablochacin Date: Fri, 8 Aug 2025 17:36:14 +0200 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Heitor Tashiro Sergent --- ...ns-using-automatic-extension-resolution.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md index ce5d3efb18..f518d0f261 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md @@ -4,13 +4,11 @@ description: 'Learn how to run scripts that require extensions.' weight: 04 --- -# Run extensions +# Run scripts using automatic extension resolution k6 supports [extensions](https://grafana.com/docs/k6//extensions/) as a way of extending k6 native functionality, and support a wider variety of use cases. -The Automatic Extension Resolution feature allows k6 users run tests using any of the [official extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) without having to manually build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries). - - +The Automatic Extension Resolution feature allows k6 users to run tests using any of the [official extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) without having to manually build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries). ## Before you begin To use Automatic Extension Resolution, you'll need: @@ -19,7 +17,7 @@ To use Automatic Extension Resolution, you'll need: ## Disable the Automatic Extension Resolution -This feature can be disable using the `K6_AUTO_EXTENSION_RESOLUTION` environment variable to `false`. +This feature can be disabled by setting the `K6_AUTO_EXTENSION_RESOLUTION` environment variable to `false`. {{< code >}} @@ -37,11 +35,14 @@ $Env:K6_AUTO_EXTENSION_RESOLUTION = "false" ``` {{< /code >}} -## Enable community extensions (Optional) +## Enable community extensions + +By default [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) can be used. With the `K6_ENABLE_COMMUNITY_EXTENSIONS`, the full list of extensions is available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). +{{< admonition type="note" >}} + +When running tests in the cloud, only a subset of the officially supported extensions is allowed. -By default [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud) can be used. With the `K6_ENABLE_COMMUNITY_EXTENSIONS` the full list of available extensions is available, including the [community extensions](https://grafana.com/docs/k6/latest/extensions/explore/#community-extensions). -tfalserue -> When running tests in the cloud only the officially supported extensions are allowed. +{{< /admonition >}} {{< code >}} @@ -59,11 +60,11 @@ $Env:K6_ENABLE_COMMUNITY_EXTENSIONS = "true" ``` {{< /code >}} -## Using unsupported extension +## Use unsupported extensions Users requiring extensions not supported by the Automatic Extension Resolution can build a [custom k6 binary](https://grafana.com/docs/k6//extensions/#xk6-makes-custom-binaries). -## Run a test +## Run a test with extensions {{< code >}} From fc80a520d521b2864b1a2acf4e18ea7fb7f04d38 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Fri, 8 Aug 2025 18:58:55 +0200 Subject: [PATCH 6/6] update run script commands Signed-off-by: Pablo Chacin --- ...run-extensions-using-automatic-extension-resolution.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md index f518d0f261..4374093c9a 100644 --- a/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md +++ b/docs/sources/k6/next/extensions/run-extensions-using-automatic-extension-resolution.md @@ -69,19 +69,19 @@ Users requiring extensions not supported by the Automatic Extension Resolution c {{< code >}} ```linux -k6 cloud run --local-execution script.js +k6 run script.js ``` ```mac -k6 cloud run --local-execution --quiet script.js +k6 run script.js ``` ```windows-powershell -k6.exe cloud run --local-execution --quiet script.js +k6.exe run script.js ``` ```windows -k6.exe cloud run --local-execution --quiet script.js +k6.exe run script.js ``` {{< /code >}}