From 4010e8d7e0a55d8a36b47cd0b4e55fa5ca1cf1d2 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Thu, 7 Mar 2024 10:34:27 +0100 Subject: [PATCH] Remove Nodejs16 --- components/runtimes/Makefile | 22 --------------- components/serverless/.golangci.yaml | 1 - .../serverless.kyma-project.io_functions.yaml | 4 +-- .../serverless/build_resources_test.go | 20 ------------- .../controllers/serverless/runtime/runtime.go | 2 +- .../serverless/runtime/runtime_test.go | 12 -------- .../internal/controllers/serverless/utils.go | 2 +- .../controllers/serverless/utils_test.go | 23 +++++++-------- .../serverless/v1alpha2/function_types.go | 6 ++-- .../v1alpha2/function_x_validation_test.go | 10 ------- .../serverless/v1alpha2/runtime_validation.go | 2 +- .../busola-serverless-extension.yaml | 11 ++++---- config/serverless/templates/crds.yaml | 4 +-- config/serverless/templates/runtimes.yaml | 28 ------------------- config/serverless/values.yaml | 4 --- docs/user/resources/06-10-function-cr.md | 2 +- .../05-20-env-variables.md | 2 +- .../07-60-function-configuration-file.md | 2 +- .../07-70-function-specification.md | 2 +- sec-scanners-config.yaml | 1 - .../fixtures/functions/nodejs16-l.yaml | 26 ----------------- .../fixtures/functions/nodejs16-m.yaml | 26 ----------------- .../fixtures/functions/nodejs16-s.yaml | 26 ----------------- .../fixtures/functions/nodejs16-xl.yaml | 26 ----------------- .../fixtures/functions/nodejs16-xs.yaml | 26 ----------------- tests/serverless-bench/run-benchmarks.sh | 2 +- .../internal/testsuite/api_gateway.go | 8 ------ .../internal/testsuite/cloud_events.go | 8 ------ .../internal/testsuite/light_runtimes.go | 9 ------ .../serverless/internal/testsuite/tracing.go | 7 ----- 30 files changed, 29 insertions(+), 295 deletions(-) delete mode 100644 tests/serverless-bench/fixtures/functions/nodejs16-l.yaml delete mode 100644 tests/serverless-bench/fixtures/functions/nodejs16-m.yaml delete mode 100644 tests/serverless-bench/fixtures/functions/nodejs16-s.yaml delete mode 100644 tests/serverless-bench/fixtures/functions/nodejs16-xl.yaml delete mode 100644 tests/serverless-bench/fixtures/functions/nodejs16-xs.yaml diff --git a/components/runtimes/Makefile b/components/runtimes/Makefile index 460cc7ca3..02655cfad 100644 --- a/components/runtimes/Makefile +++ b/components/runtimes/Makefile @@ -3,33 +3,11 @@ ROOT := $(shell pwd) release: build-images push-images .PHONY: build-images - build-function-runtime-nodejs16-image \ build-function-runtime-python39-image .PHONY: push-images - push-function-runtime-nodejs16-image \ push-function-runtime-python39-image - -## nodejs16 -FUNCTION_RUNTIME_IMAGE_NODEJS16 = function-runtime-nodejs16 -FUNCTION_RUNTIME_NODEJS16_IMG_NAME:=$(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(FUNCTION_RUNTIME_IMAGE_NODEJS16) - -.PHONY: build-function-runtime-nodejs16-image push-function-runtime-nodejs16-image -build-function-runtime-nodejs16-image: - docker build -t $(FUNCTION_RUNTIME_IMAGE_NODEJS16) $(ROOT)/nodejs16/ - -push-function-runtime-nodejs16-image: - docker tag $(FUNCTION_RUNTIME_IMAGE_NODEJS16) $(FUNCTION_RUNTIME_NODEJS16_IMG_NAME):$(DOCKER_TAG) - docker push $(FUNCTION_RUNTIME_NODEJS16_IMG_NAME):$(DOCKER_TAG) -ifeq ($(JOB_TYPE), postsubmit) - @echo "Sign image with Cosign" - cosign version - cosign sign -key ${KMS_KEY_URL} $(FUNCTION_RUNTIME_NODEJS16_IMG_NAME):$(DOCKER_TAG) -else - @echo "Image signing skipped" -endif - ## python39 FUNCTION_RUNTIME_IMAGE_PYTHON39 = function-runtime-python39 FUNCTION_RUNTIME_PYTHON39_IMG_NAME:=$(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(FUNCTION_RUNTIME_IMAGE_PYTHON39) diff --git a/components/serverless/.golangci.yaml b/components/serverless/.golangci.yaml index 082440cf3..220200160 100644 --- a/components/serverless/.golangci.yaml +++ b/components/serverless/.golangci.yaml @@ -12,7 +12,6 @@ linters: issues: exclude: #exclude our internal deprecated fields - - "^SA1019: serverlessv1alpha2.NodeJs16 is deprecated:" - "^SA1019: serverlessv1alpha2.Python39 is deprecated:" - "^SA1019: status.RuntimeImageOverride is deprecated:" - "^SA1019: s.instance.Spec.Template is deprecated:" diff --git a/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml b/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml index 7c5ffb593..82a90e4e3 100644 --- a/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml +++ b/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml @@ -368,10 +368,8 @@ spec: type: object runtime: description: Specifies the runtime of the Function. The available - values are `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, - and `python312`. + values are `nodejs18`, `python39` - deprecated, and `python312`. enum: - - nodejs16 - nodejs18 - python39 - python312 diff --git a/components/serverless/internal/controllers/serverless/build_resources_test.go b/components/serverless/internal/controllers/serverless/build_resources_test.go index 17cef65e5..e69b72d47 100644 --- a/components/serverless/internal/controllers/serverless/build_resources_test.go +++ b/components/serverless/internal/controllers/serverless/build_resources_test.go @@ -17,7 +17,6 @@ import ( ) var ( - rtmNodeJS16 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.NodeJs16) rtmNodeJS18 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.NodeJs18) rtmPython39 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.Python39) rtmPython312 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.Python312) @@ -432,25 +431,6 @@ func TestFunctionReconciler_buildJob(t *testing.T) { ExpectedMountsLen int ExpectedVolumeMounts []corev1.VolumeMount }{ - { - Name: "Success Node16", - Runtime: serverlessv1alpha2.NodeJs16, - ExpectedVolumesLen: 4, - ExpectedVolumes: []expectedVolume{ - {name: "sources", localObjectReference: cmName}, - {name: "runtime", localObjectReference: rtmNodeJS16.DockerfileConfigMapName}, - {name: "credentials", localObjectReference: dockerCfg.ActiveRegistryConfigSecretName}, - {name: "registry-config", localObjectReference: packageRegistryConfigSecretName}, - }, - ExpectedMountsLen: 5, - ExpectedVolumeMounts: []corev1.VolumeMount{ - {Name: "sources", MountPath: "/workspace/src/package.json", SubPath: FunctionDepsKey, ReadOnly: true}, - {Name: "sources", MountPath: "/workspace/src/handler.js", SubPath: FunctionSourceKey, ReadOnly: true}, - {Name: "runtime", MountPath: "/workspace/Dockerfile", SubPath: "Dockerfile", ReadOnly: true}, - {Name: "credentials", MountPath: "/docker", ReadOnly: true}, - {Name: "registry-config", MountPath: "/workspace/registry-config/.npmrc", SubPath: ".npmrc", ReadOnly: true}, - }, - }, { Name: "Success Node18", Runtime: serverlessv1alpha2.NodeJs18, diff --git a/components/serverless/internal/controllers/serverless/runtime/runtime.go b/components/serverless/internal/controllers/serverless/runtime/runtime.go index 8836a7bdd..c5e1cdf91 100644 --- a/components/serverless/internal/controllers/serverless/runtime/runtime.go +++ b/components/serverless/internal/controllers/serverless/runtime/runtime.go @@ -53,7 +53,7 @@ func fillConfigEnvVars(runtime serverlessv1alpha2.Runtime, config *Config) { func fillConfigFileNames(runtime serverlessv1alpha2.Runtime, config *Config) { switch runtime { - case serverlessv1alpha2.NodeJs16, serverlessv1alpha2.NodeJs18: + case serverlessv1alpha2.NodeJs18: config.DependencyFile = "package.json" config.FunctionFile = "handler.js" return diff --git a/components/serverless/internal/controllers/serverless/runtime/runtime_test.go b/components/serverless/internal/controllers/serverless/runtime/runtime_test.go index 2b24f1a0b..dc85dab49 100644 --- a/components/serverless/internal/controllers/serverless/runtime/runtime_test.go +++ b/components/serverless/internal/controllers/serverless/runtime/runtime_test.go @@ -41,18 +41,6 @@ func TestGetRuntimeConfig(t *testing.T) { {Name: "PYTHONUNBUFFERED", Value: "TRUE"}}, }, }, - "nodej16": { - name: "nodejs16 config", - runtime: serverlessv1alpha2.NodeJs16, - want: runtime.Config{ - Runtime: serverlessv1alpha2.NodeJs16, - DependencyFile: "package.json", - FunctionFile: "handler.js", - DockerfileConfigMapName: "dockerfile-nodejs16", - RuntimeEnvs: []corev1.EnvVar{ - {Name: "FUNC_RUNTIME", Value: "nodejs16"}}, - }, - }, "nodej18": { name: "nodejs18 config", runtime: serverlessv1alpha2.NodeJs18, diff --git a/components/serverless/internal/controllers/serverless/utils.go b/components/serverless/internal/controllers/serverless/utils.go index 2b3070ba6..c5b6645ab 100644 --- a/components/serverless/internal/controllers/serverless/utils.go +++ b/components/serverless/internal/controllers/serverless/utils.go @@ -100,7 +100,7 @@ func getArg(args []string, arg string) string { func getPackageConfigVolumeMountsForRuntime(rtm serverlessv1alpha2.Runtime) []corev1.VolumeMount { switch rtm { - case serverlessv1alpha2.NodeJs16, serverlessv1alpha2.NodeJs18: + case serverlessv1alpha2.NodeJs18: return []corev1.VolumeMount{ { Name: "registry-config", diff --git a/components/serverless/internal/controllers/serverless/utils_test.go b/components/serverless/internal/controllers/serverless/utils_test.go index 658d7b950..cf5d74e6f 100644 --- a/components/serverless/internal/controllers/serverless/utils_test.go +++ b/components/serverless/internal/controllers/serverless/utils_test.go @@ -1,10 +1,11 @@ package serverless import ( + "testing" + serverlessv1alpha2 "github.com/kyma-project/serverless/components/serverless/pkg/apis/serverless/v1alpha2" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" ) func Test_calculateGitImageTag(t *testing.T) { @@ -26,10 +27,10 @@ func Test_calculateGitImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "nodejs18", }, }, - want: "5e75a855ada0eb1fc5534e42387566508e03a1ef0d927ac281d5248a0ef1d0cc", + want: "4480d14ea252bf15f18c6632caff283b55beb6f38d5cf8cc43b1b116a151e78d", }, { name: "should use runtimeOverride", @@ -44,7 +45,7 @@ func Test_calculateGitImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "python312", RuntimeImageOverride: "nodejs18", }, }, @@ -63,11 +64,11 @@ func Test_calculateGitImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "nodejs18", RuntimeImageOverride: "", }, }, - want: "5e75a855ada0eb1fc5534e42387566508e03a1ef0d927ac281d5248a0ef1d0cc", + want: "4480d14ea252bf15f18c6632caff283b55beb6f38d5cf8cc43b1b116a151e78d", }, } for _, tt := range tests { @@ -96,7 +97,7 @@ func Test_calculateInlineImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "nodejs18", }, Status: serverlessv1alpha2.FunctionStatus{ Commit: "commit", @@ -105,7 +106,7 @@ func Test_calculateInlineImageTag(t *testing.T) { }, }, }, - want: "61373f52b742aec1e1be9b8b6a9984ea087524deffe6bb38f1788c0ae4d7d62b", + want: "e6ca45293444d4f6f1b43437f96cd2606842bf7cf9e14a126f52c0b7c216c677", }, { name: "should use runtimeOverride", @@ -120,7 +121,7 @@ func Test_calculateInlineImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "python312", RuntimeImageOverride: "nodejs18", }, Status: serverlessv1alpha2.FunctionStatus{ @@ -145,7 +146,7 @@ func Test_calculateInlineImageTag(t *testing.T) { Dependencies: "", }, }, - Runtime: "nodejs16", + Runtime: "nodejs18", RuntimeImageOverride: "", }, Status: serverlessv1alpha2.FunctionStatus{ @@ -155,7 +156,7 @@ func Test_calculateInlineImageTag(t *testing.T) { }, }, }, - want: "61373f52b742aec1e1be9b8b6a9984ea087524deffe6bb38f1788c0ae4d7d62b", + want: "e6ca45293444d4f6f1b43437f96cd2606842bf7cf9e14a126f52c0b7c216c677", }, } for _, tt := range tests { diff --git a/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go b/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go index b27234c23..347aaf2e2 100644 --- a/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go +++ b/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go @@ -28,8 +28,6 @@ const ( // Deprecated: Python39 will be removed soon Python39 Runtime = "python39" Python312 Runtime = "python312" - // Deprecated: Nodejs16 will be removed soon - NodeJs16 Runtime = "nodejs16" NodeJs18 Runtime = "nodejs18" ) @@ -169,8 +167,8 @@ const ( // Defines the desired state of the Function type FunctionSpec struct { - // Specifies the runtime of the Function. The available values are `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, and `python312`. - // +kubebuilder:validation:Enum=nodejs16;nodejs18;python39;python312; + // Specifies the runtime of the Function. The available values are `nodejs18`, `python39` - deprecated, and `python312`. + // +kubebuilder:validation:Enum=nodejs18;python39;python312; Runtime Runtime `json:"runtime"` // Specifies the runtime image used instead of the default one. diff --git a/components/serverless/pkg/apis/serverless/v1alpha2/function_x_validation_test.go b/components/serverless/pkg/apis/serverless/v1alpha2/function_x_validation_test.go index 20d4933cc..136e530fa 100644 --- a/components/serverless/pkg/apis/serverless/v1alpha2/function_x_validation_test.go +++ b/components/serverless/pkg/apis/serverless/v1alpha2/function_x_validation_test.go @@ -299,16 +299,6 @@ func Test_XKubernetesValidations_Valid(t *testing.T) { }, }, }, - "allowed runtime: nodejs16": { - fn: &serverlessv1alpha2.Function{ - ObjectMeta: fixMetadata, - Spec: serverlessv1alpha2.FunctionSpec{ - Runtime: serverlessv1alpha2.NodeJs16, - Source: serverlessv1alpha2.Source{ - Inline: &serverlessv1alpha2.InlineSource{Source: "a"}}, - }, - }, - }, "allowed runtime: nodejs18": { fn: &serverlessv1alpha2.Function{ ObjectMeta: fixMetadata, diff --git a/components/serverless/pkg/apis/serverless/v1alpha2/runtime_validation.go b/components/serverless/pkg/apis/serverless/v1alpha2/runtime_validation.go index 9af4d840c..2da59a768 100644 --- a/components/serverless/pkg/apis/serverless/v1alpha2/runtime_validation.go +++ b/components/serverless/pkg/apis/serverless/v1alpha2/runtime_validation.go @@ -8,7 +8,7 @@ import ( func ValidateDependencies(runtime Runtime, dependencies string) error { switch runtime { - case NodeJs16, NodeJs18: + case NodeJs18: return validateNodeJSDependencies(dependencies) case Python39, Python312: return nil diff --git a/config/serverless/templates/busola-serverless-extension.yaml b/config/serverless/templates/busola-serverless-extension.yaml index 82c3f4cad..1e41d8d31 100644 --- a/config/serverless/templates/busola-serverless-extension.yaml +++ b/config/serverless/templates/busola-serverless-extension.yaml @@ -63,7 +63,7 @@ data: source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - name: header.runtime source: >- - spec.runtime = 'nodejs16' ? 'Node.js 16 - deprecated' : (spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18' : (spec.runtime = 'python312' ? 'Python 3.12' : spec.runtime))) + spec.runtime = spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18' : (spec.runtime = 'python312' ? 'Python 3.12' : spec.runtime)) body: - widget: Tabs children: @@ -212,19 +212,19 @@ data: enum: [JavaScript, Python] trigger: [language] dynamicValue: | - spec.runtime in ['nodejs16', 'nodejs18'] ? 'JavaScript' : + spec.runtime in ['nodejs18'] ? 'JavaScript' : spec.runtime in ['python39', 'python312'] ? 'Python' : '' - simple: true path: spec.runtime placeholder: placeholders.spec.runtime enum: | - $language = 'JavaScript' ? ['nodejs16', 'nodejs18'] : + $language = 'JavaScript' ? ['nodejs18'] : $language = 'Python' ? ['python39', 'python312'] : [] subscribe: language: | - $language = 'JavaScript' ? ($exists($root.spec.runtime) and $root.spec.runtime != 'python39') ? $root.spec.runtime : 'nodejs16' : + $language = 'JavaScript' ? ($exists($root.spec.runtime) and $root.spec.runtime != 'python39') ? $root.spec.runtime : 'nodejs18' : $language = 'Python' ? 'python39' : '' - path: spec.resourceConfiguration.function.profile @@ -422,7 +422,7 @@ data: list: |- - name: header.runtime source: >- - spec.runtime = 'nodejs16' ? 'Node.js 16 - deprecated' : (spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18' : (spec.runtime = 'python312' ? 'Python 3.12' : spec.runtime))) + spec.runtime = spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18' : (spec.runtime = 'python312' ? 'Python 3.12' : spec.runtime)) - name: header.sourceType source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - name: header.status @@ -533,7 +533,6 @@ data: Status: Status Runtime: Runtime 'Source Type': Source Type - spec.runtime.nodejs16: Node.js 16 - deprecated spec.runtime.nodejs18: Node.js 18 spec.runtime.python39: Python 3.9 spec.runtime.python312: Python 3.12 diff --git a/config/serverless/templates/crds.yaml b/config/serverless/templates/crds.yaml index 8ab0536aa..71c0cb27b 100644 --- a/config/serverless/templates/crds.yaml +++ b/config/serverless/templates/crds.yaml @@ -367,10 +367,8 @@ spec: type: object runtime: description: Specifies the runtime of the Function. The available - values are `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, - and `python312`. + values are `nodejs18`, `python39` - deprecated, and `python312`. enum: - - nodejs16 - nodejs18 - python39 - python312 diff --git a/config/serverless/templates/runtimes.yaml b/config/serverless/templates/runtimes.yaml index 54d40adc3..12e9d4b32 100644 --- a/config/serverless/templates/runtimes.yaml +++ b/config/serverless/templates/runtimes.yaml @@ -1,33 +1,5 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: dockerfile-nodejs16 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: nodejs16 -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_nodejs16) }} - FROM ${base_image} - USER root - ARG SRC_DIR=/src - - RUN mkdir -p /usr/src/app/function - WORKDIR /usr/src/app/function - - COPY /registry-config/* /usr/src/app/function/ - COPY $SRC_DIR/package.json /usr/src/app/function/package.json - - RUN npm install --omit=dev - COPY $SRC_DIR /usr/src/app/function - RUN ls -l /usr/src/app/function - WORKDIR /usr/src/app - - USER 1000 ---- -apiVersion: v1 -kind: ConfigMap metadata: name: dockerfile-nodejs18 namespace: {{ .Release.Namespace }} diff --git a/config/serverless/values.yaml b/config/serverless/values.yaml index a478539de..703c099ce 100644 --- a/config/serverless/values.yaml +++ b/config/serverless/values.yaml @@ -82,10 +82,6 @@ global: name: "function-build-init" version: "main" directory: "prod" - function_runtime_nodejs16: - name: "function-runtime-nodejs16" - version: "main" - directory: "prod" function_runtime_nodejs18: name: "function-runtime-nodejs18" version: "main" diff --git a/docs/user/resources/06-10-function-cr.md b/docs/user/resources/06-10-function-cr.md index e8617f828..0ed4570f0 100644 --- a/docs/user/resources/06-10-function-cr.md +++ b/docs/user/resources/06-10-function-cr.md @@ -122,7 +122,7 @@ spec: | **resourceConfiguration.​function** | object | Specifies resources requested by the Function's Pod. | | **resourceConfiguration.​function.​profile** | string | Defines the name of the predefined set of values of the resource. Can't be used together with **Resources**. | | **resourceConfiguration.​function.​resources** | object | Defines the amount of resources available for the Pod. Can't be used together with **Profile**. For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). | -| **runtime** (required) | string | Specifies the runtime of the Function. The available values are `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, and `python312`. | +| **runtime** (required) | string | Specifies the runtime of the Function. The available values are `nodejs18`, `python39` - deprecated, and `python312`. | | **runtimeImageOverride** | string | Specifies the runtime image used instead of the default one. | | **scaleConfig** | object | Defines the minimum and maximum number of Function's Pods to run at a time. When it is configured, a HorizontalPodAutoscaler will be deployed and will control the **Replicas** field to scale the Function based on the CPU utilisation. | | **scaleConfig.​maxReplicas** (required) | integer | Defines the maximum number of Function's Pods to run at a time. | diff --git a/docs/user/technical-reference/05-20-env-variables.md b/docs/user/technical-reference/05-20-env-variables.md index 57075067c..8413e236f 100644 --- a/docs/user/technical-reference/05-20-env-variables.md +++ b/docs/user/technical-reference/05-20-env-variables.md @@ -15,7 +15,7 @@ Every runtime provides its own unique environment configuration which can be rea | **FUNC_PORT** | `8080` | The right port a server listens to. | | **SERVICE_NAMESPACE** | None | The namespace where the right Function exists in a cluster. | | **KUBELESS_INSTALL_VOLUME** | `/kubeless` | Full path to volume mount with users source code. | -| **FUNC_RUNTIME** | None | The name of the actual runtime. Possible values: `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, and `python312`. | +| **FUNC_RUNTIME** | None | The name of the actual runtime. Possible values: `nodejs18`, `python39` - deprecated, and `python312`. | | **TRACE_COLLECTOR_ENDPOINT** | None | Full address of OpenTelemetry Trace Collector is exported if the trace collector's endpoint is present. | | **PUBLISHER_PROXY_ADDRESS** | `http://eventing-publisher-proxy.kyma-system.svc .cluster.local/publish` | Full address of the Publisher Proxy service. | diff --git a/docs/user/technical-reference/07-60-function-configuration-file.md b/docs/user/technical-reference/07-60-function-configuration-file.md index 451b9fd61..47cb252ea 100644 --- a/docs/user/technical-reference/07-60-function-configuration-file.md +++ b/docs/user/technical-reference/07-60-function-configuration-file.md @@ -117,7 +117,7 @@ See all parameter descriptions. |----------------------------------------------------------------|:--------:| ---------| ---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **name** | Yes | Function | | Specifies the name of your Function. | | **namespace** | No | Function | `default` | Defines the namespace in which the Function is created. | -| **runtime** | Yes | Function | | Specifies the execution environment for your Function. The available values are `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, and `python312`. | +| **runtime** | Yes | Function | | Specifies the execution environment for your Function. The available values are `nodejs18`, `python39` - deprecated, and `python312`. | | **runtimeImageOverride** | No | Function | | Specifies the runtimes image which must be used instead of default one. | | **labels** | No | Function | | Specifies the Function's Pod labels. | | **source** | Yes | Function | | Provides details on the type and location of your Function's source code and dependencies. | diff --git a/docs/user/technical-reference/07-70-function-specification.md b/docs/user/technical-reference/07-70-function-specification.md index 6f4a7e88b..e71e570fc 100644 --- a/docs/user/technical-reference/07-70-function-specification.md +++ b/docs/user/technical-reference/07-70-function-specification.md @@ -146,7 +146,7 @@ See the detailed descriptions of these fields: |-------|-------------------------------------------------------------------------------------------| | **function-name** | Name of the invoked Function | | **timeout** | Time, in seconds, after which the system cancels the request to invoke the Function | -| **runtime** | Environment used to run the Function. You can use `nodejs16` - deprecated, `nodejs18`, `python39` - deprecated, or `python312`. | +| **runtime** | Environment used to run the Function. You can use `nodejs18`, `python39` - deprecated, or `python312`. | | **memory-limit** | Maximum amount of memory assigned to run a Function | ## HTTP Requests diff --git a/sec-scanners-config.yaml b/sec-scanners-config.yaml index 2229c34d9..900f5b34b 100644 --- a/sec-scanners-config.yaml +++ b/sec-scanners-config.yaml @@ -5,7 +5,6 @@ protecode: - europe-docker.pkg.dev/kyma-project/prod/function-controller:main - europe-docker.pkg.dev/kyma-project/prod/function-webhook:main - europe-docker.pkg.dev/kyma-project/prod/function-build-init:main - - europe-docker.pkg.dev/kyma-project/prod/function-runtime-nodejs16:main - europe-docker.pkg.dev/kyma-project/prod/function-runtime-nodejs18:main - europe-docker.pkg.dev/kyma-project/prod/function-runtime-nodejs20:main - europe-docker.pkg.dev/kyma-project/prod/function-runtime-python39:main diff --git a/tests/serverless-bench/fixtures/functions/nodejs16-l.yaml b/tests/serverless-bench/fixtures/functions/nodejs16-l.yaml deleted file mode 100644 index addbde828..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs16-l.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: serverless.kyma-project.io/v1alpha2 -kind: Function -metadata: - labels: - serverless.kyma-project.io/function-resources-preset: L - name: nodejs16-l -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs16 - source: - inline: - dependencies: |- - { - "name": "nodejs16-l", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs16-m.yaml b/tests/serverless-bench/fixtures/functions/nodejs16-m.yaml deleted file mode 100644 index c8c58f1c1..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs16-m.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: serverless.kyma-project.io/v1alpha2 -kind: Function -metadata: - labels: - serverless.kyma-project.io/function-resources-preset: M - name: nodejs16-m -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs16 - source: - inline: - dependencies: |- - { - "name": "nodejs16-m", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs16-s.yaml b/tests/serverless-bench/fixtures/functions/nodejs16-s.yaml deleted file mode 100644 index d073c06e5..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs16-s.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: serverless.kyma-project.io/v1alpha2 -kind: Function -metadata: - labels: - serverless.kyma-project.io/function-resources-preset: S - name: nodejs16-s -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs16 - source: - inline: - dependencies: |- - { - "name": "nodejs16-s", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs16-xl.yaml b/tests/serverless-bench/fixtures/functions/nodejs16-xl.yaml deleted file mode 100644 index 1da17cadc..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs16-xl.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: serverless.kyma-project.io/v1alpha2 -kind: Function -metadata: - labels: - serverless.kyma-project.io/function-resources-preset: XL - name: nodejs16-xl -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs16 - source: - inline: - dependencies: |- - { - "name": "nodejs16-xl", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs16-xs.yaml b/tests/serverless-bench/fixtures/functions/nodejs16-xs.yaml deleted file mode 100644 index 391006148..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs16-xs.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: serverless.kyma-project.io/v1alpha2 -kind: Function -metadata: - labels: - serverless.kyma-project.io/function-resources-preset: XS - name: nodejs16-xs -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs16 - source: - inline: - dependencies: |- - { - "name": "nodejs16-xs", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/run-benchmarks.sh b/tests/serverless-bench/run-benchmarks.sh index 33e4e3984..0ff51a8a3 100755 --- a/tests/serverless-bench/run-benchmarks.sh +++ b/tests/serverless-bench/run-benchmarks.sh @@ -3,7 +3,7 @@ set -o pipefail # Fail a pipe if any sub-command fails. -ALL_FUNCTIONS="nodejs16-xs nodejs16-s nodejs16-m nodejs16-l nodejs16-xl nodejs18-xs nodejs18-s nodejs18-m nodejs18-l nodejs18-xl python39-s python39-m python39-l python39-xl python312-s python312-m python312-l python312-xl" +ALL_FUNCTIONS="nodejs18-xs nodejs18-s nodejs18-m nodejs18-l nodejs18-xl python39-s python39-m python39-l python39-xl python312-s python312-m python312-l python312-xl" export TEST_NAMESPACE="${NAMESPACE:-serverless-benchmarks}" export TEST_CONCURRENCY="${CONCURRENCY:-50}" diff --git a/tests/serverless/internal/testsuite/api_gateway.go b/tests/serverless/internal/testsuite/api_gateway.go index bbf7b4ca3..6c69aa41a 100644 --- a/tests/serverless/internal/testsuite/api_gateway.go +++ b/tests/serverless/internal/testsuite/api_gateway.go @@ -21,7 +21,6 @@ import ( ) const ( - nodejs16 = "nodejs16" nodejs18 = "nodejs18" python39 = "python39" python312 = "python312" @@ -43,7 +42,6 @@ func FunctionAPIGatewayTest(restConfig *rest.Config, cfg internal.Config, logf * python312Logger := logf.WithField(runtimeKey, "python312") python39Logger := logf.WithField(runtimeKey, "python39") - nodejs16Logger := logf.WithField(runtimeKey, "nodejs16") nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") genericContainer := utils.Container{ @@ -58,8 +56,6 @@ func FunctionAPIGatewayTest(restConfig *rest.Config, cfg internal.Config, logf * python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs16Fn := function.NewFunction("nodejs16", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs16Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -75,10 +71,6 @@ func FunctionAPIGatewayTest(restConfig *rest.Config, cfg internal.Config, logf * function.CreateFunction(python312Logger, python312Fn, "Create Python312 Function", runtimes.BasicPythonFunction("Hello from python312", serverlessv1alpha2.Python312)), assertion.APIGatewayFunctionCheck("python312", python312Fn, coreCli, genericContainer.Namespace, python312), ), - executor.NewSerialTestRunner(nodejs16Logger, "NodeJS16 test", - function.CreateFunction(nodejs16Logger, nodejs16Fn, "Create NodeJS16 Function", runtimes.BasicNodeJSFunction("Hello from nodejs16", serverlessv1alpha2.NodeJs16)), - assertion.APIGatewayFunctionCheck("nodejs16", nodejs16Fn, coreCli, genericContainer.Namespace, nodejs16), - ), executor.NewSerialTestRunner(nodejs18Logger, "NodeJS18 test", function.CreateFunction(nodejs18Logger, nodejs18Fn, "Create NodeJS18 Function", runtimes.BasicNodeJSFunction("Hello from nodejs18", serverlessv1alpha2.NodeJs18)), assertion.APIGatewayFunctionCheck("nodejs18", nodejs18Fn, coreCli, genericContainer.Namespace, nodejs18), diff --git a/tests/serverless/internal/testsuite/cloud_events.go b/tests/serverless/internal/testsuite/cloud_events.go index eddd913b1..87d5f04c9 100644 --- a/tests/serverless/internal/testsuite/cloud_events.go +++ b/tests/serverless/internal/testsuite/cloud_events.go @@ -37,7 +37,6 @@ func FunctionCloudEventsTest(restConfig *rest.Config, cfg internal.Config, logf python39Logger := logf.WithField(runtimeKey, "python39") python312Logger := logf.WithField(runtimeKey, "python312") - nodejs16Logger := logf.WithField(runtimeKey, "nodejs16") nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") genericContainer := utils.Container{ @@ -51,7 +50,6 @@ func FunctionCloudEventsTest(restConfig *rest.Config, cfg internal.Config, logf publisherProxyMock := function.NewFunction("eventing-publisher-proxy", "kyma-system", cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) python39Fn := function.NewFunction("python39", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python39Logger)) python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs16Fn := function.NewFunction("nodejs16", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs16Logger)) nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -72,12 +70,6 @@ func FunctionCloudEventsTest(restConfig *rest.Config, cfg internal.Config, logf assertion.CloudEventReceiveCheck(python312Logger, "Python312 cloud event binary check", cloudevents.EncodingBinary, python312Fn.FunctionURL), assertion.CloudEventSendCheck(python312Logger, "Python312 cloud event sent check", string(serverlessv1alpha2.Python312), python312Fn.FunctionURL, publisherProxyMock.FunctionURL), ), - executor.NewSerialTestRunner(nodejs16Logger, "NodeJS16 test", - function.CreateFunction(nodejs16Logger, nodejs16Fn, "Create NodeJS16 Function", runtimes.NodeJSFunctionWithCloudEvent(serverlessv1alpha2.NodeJs16)), - assertion.CloudEventReceiveCheck(nodejs16Logger, "NodeJS16 cloud event structured check", cloudevents.EncodingStructured, nodejs16Fn.FunctionURL), - assertion.CloudEventReceiveCheck(nodejs16Logger, "NodeJS16 cloud event binary check", cloudevents.EncodingBinary, nodejs16Fn.FunctionURL), - assertion.CloudEventSendCheck(nodejs16Logger, "NodeJS16 cloud event sent check", string(serverlessv1alpha2.NodeJs16), nodejs16Fn.FunctionURL, publisherProxyMock.FunctionURL), - ), executor.NewSerialTestRunner(nodejs18Logger, "NodeJS18 test", function.CreateFunction(nodejs18Logger, nodejs18Fn, "Create NodeJS18 Function", runtimes.NodeJSFunctionWithCloudEvent(serverlessv1alpha2.NodeJs18)), assertion.CloudEventReceiveCheck(nodejs18Logger, "NodeJS18 cloud event structured check", cloudevents.EncodingStructured, nodejs18Fn.FunctionURL), diff --git a/tests/serverless/internal/testsuite/light_runtimes.go b/tests/serverless/internal/testsuite/light_runtimes.go index 976dfad59..3943d8097 100644 --- a/tests/serverless/internal/testsuite/light_runtimes.go +++ b/tests/serverless/internal/testsuite/light_runtimes.go @@ -40,7 +40,6 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr python39Logger := logf.WithField(runtimeKey, "python39") python312Logger := logf.WithField(runtimeKey, "python312") - nodejs16Logger := logf.WithField(runtimeKey, "nodejs16") nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") genericContainer := utils.Container{ @@ -55,8 +54,6 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs16Fn := function.NewFunction("nodejs16", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs16Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) cm := configmap.NewConfigMap("test-serverless-configmap", genericContainer.WithLogger(nodejs18Logger)) @@ -101,12 +98,6 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr function.UpdateFunction(python312Logger, python312Fn, "Update Python312 Function", runtimes.BasicPythonFunctionWithCustomDependency("Hello From updated python", serverlessv1alpha2.Python312)), assertion.NewHTTPCheck(python312Logger, "Python312 post update simple check through service", python312Fn.FunctionURL, poll, "Hello From updated python"), ), - executor.NewSerialTestRunner(nodejs16Logger, "NodeJS16 test", - function.CreateFunction(nodejs16Logger, nodejs16Fn, "Create NodeJS16 Function", runtimes.BasicNodeJSFunction("Hello from nodejs16", serverlessv1alpha2.NodeJs16)), - assertion.NewHTTPCheck(nodejs16Logger, "NodeJS16 pre update simple check through service", nodejs16Fn.FunctionURL, poll, "Hello from nodejs16"), - function.UpdateFunction(nodejs16Logger, nodejs16Fn, "Update NodeJS16 Function", runtimes.BasicNodeJSFunctionWithCustomDependency("Hello from updated nodejs16", serverlessv1alpha2.NodeJs16)), - assertion.NewHTTPCheck(nodejs16Logger, "NodeJS16 post update simple check through service", nodejs16Fn.FunctionURL, poll, "Hello from updated nodejs16"), - ), executor.NewSerialTestRunner(nodejs18Logger, "NodeJS18 test", configmap.CreateConfigMap(nodejs18Logger, cm, "Create Test ConfigMap", cmData), secret.CreateSecret(nodejs18Logger, sec, "Create Test Secret", secretData), diff --git a/tests/serverless/internal/testsuite/tracing.go b/tests/serverless/internal/testsuite/tracing.go index 4d9183fc1..3692a7fd1 100644 --- a/tests/serverless/internal/testsuite/tracing.go +++ b/tests/serverless/internal/testsuite/tracing.go @@ -48,7 +48,6 @@ func FunctionTracingTest(restConfig *rest.Config, cfg internal.Config, logf *log python39Logger := logf.WithField(runtimeKey, "python39") python312Logger := logf.WithField(runtimeKey, "python312") - nodejs16Logger := logf.WithField(runtimeKey, "nodejs16") nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") genericContainer := utils.Container{ @@ -63,8 +62,6 @@ func FunctionTracingTest(restConfig *rest.Config, cfg internal.Config, logf *log python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs16Fn := function.NewFunction("nodejs16", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs16Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -91,10 +88,6 @@ func FunctionTracingTest(restConfig *rest.Config, cfg internal.Config, logf *log function.CreateFunction(python312Logger, python312Fn, "Create Python312 Function", runtimes.BasicTracingPythonFunction(serverlessv1alpha2.Python312, httpAppURL.String())), assertion.TracingHTTPCheck(python312Logger, "Python312 tracing headers check", python312Fn.FunctionURL, poll), ), - executor.NewSerialTestRunner(nodejs16Logger, "NodeJS16 test", - function.CreateFunction(nodejs16Logger, nodejs16Fn, "Create NodeJS16 Function", runtimes.BasicTracingNodeFunction(serverlessv1alpha2.NodeJs16, httpAppURL.String())), - assertion.TracingHTTPCheck(nodejs16Logger, "NodeJS16 tracing headers check", nodejs16Fn.FunctionURL, poll), - ), executor.NewSerialTestRunner(nodejs18Logger, "NodeJS18 test", function.CreateFunction(nodejs18Logger, nodejs18Fn, "Create NodeJS18 Function", runtimes.BasicTracingNodeFunction(serverlessv1alpha2.NodeJs18, httpAppURL.String())), assertion.TracingHTTPCheck(nodejs18Logger, "NodeJS18 tracing headers check", nodejs18Fn.FunctionURL, poll),