diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7231dc0d6..abf1c4029 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -92,16 +92,6 @@ updates: # ignore minor python updates, e.g. 3.9 -> 3.12 - dependency-name: kyma-project/prod/external/library/python update-types: ["version-update:semver-minor"] - - package-ecosystem: "docker" - directory: "/components/runtimes/nodejs/nodejs18" - labels: - - "area/dependency" - - "kind/chore" - schedule: - interval: "weekly" - commit-message: - prefix: "nodejs18" - include: "scope" - package-ecosystem: "docker" directory: "/components/runtimes/nodejs/nodejs20" labels: @@ -128,20 +118,6 @@ updates: patterns: - "opentelemetry-*" - - package-ecosystem: "npm" - directory: "/components/runtimes/nodejs/nodejs18" - labels: - - "area/dependency" - - "kind/chore" - schedule: - interval: "weekly" - commit-message: - prefix: "npm-nodejs18" - include: "scope" - groups: - opentelemetry: - patterns: - - "@opentelemetry/*" - package-ecosystem: "npm" directory: "/components/runtimes/nodejs/nodejs20" labels: diff --git a/.github/workflows/_build.yaml b/.github/workflows/_build.yaml index b15e42f17..706de11f9 100644 --- a/.github/workflows/_build.yaml +++ b/.github/workflows/_build.yaml @@ -72,15 +72,6 @@ jobs: dockerfile: components/serverless/deploy/jobinit/Dockerfile tags: ${{ needs.compute-tags.outputs.tags }} - build-nodejs18: - needs: compute-tags - uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main - with: - name: function-runtime-nodejs18 - dockerfile: nodejs18/Dockerfile - context: components/runtimes/nodejs - tags: ${{ needs.compute-tags.outputs.tags }} - build-nodejs20: needs: compute-tags uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main diff --git a/components/runtimes/nodejs/nodejs18/Dockerfile b/components/runtimes/nodejs/nodejs18/Dockerfile deleted file mode 100644 index 7afd3db60..000000000 --- a/components/runtimes/nodejs/nodejs18/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM europe-docker.pkg.dev/kyma-project/prod/external/library/alpine:3.20.3 - -# https://pkgs.alpinelinux.org/packages?name=nodejs&branch=v3.18&repo=main&arch=&maintainer= -ENV NODE_VERSION=18.20.1-r0 - -RUN apk add --no-cache openssl3 -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.18/main nodejs=${NODE_VERSION} npm - -ARG NODE_ENV -ENV NODE_ENV $NODE_ENV -ENV npm_config_cache /tmp/ - -RUN mkdir -p /usr/src/app -RUN mkdir -p /usr/src/app/lib -WORKDIR /usr/src/app - -COPY --chown=root:root ./nodejs18/package.json /usr/src/app/ -RUN chmod 644 /usr/src/app/package.json - -RUN npm install && npm cache clean --force -COPY --chown=root:root ./lib /usr/src/app/lib -RUN chmod -R 755 /usr/src/app/lib - -COPY --chown=root:root ./server.mjs /usr/src/app/server.mjs -RUN chmod 644 /usr/src/app/server.mjs - -CMD ["npm", "start"] - -EXPOSE 8888 diff --git a/components/runtimes/nodejs/nodejs18/package.json b/components/runtimes/nodejs/nodejs18/package.json deleted file mode 100644 index 2cb3e98e8..000000000 --- a/components/runtimes/nodejs/nodejs18/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "nodejs18-runtime", - "version": "0.1.0", - "description": "NodeJS v18 container for kyma serverless", - "engines": { - "node": ">= 18.0.0" - }, - "scripts": { - "start": "node server.mjs" - }, - "dependencies": { - "@opentelemetry/api": "^1.4.0", - "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", - "@opentelemetry/instrumentation": "^0.53.0", - "@opentelemetry/instrumentation-express": "^0.43.0", - "@opentelemetry/instrumentation-http": "^0.53.0", - "@opentelemetry/propagator-b3": "^1.9.1", - "@opentelemetry/sdk-trace-node": "^1.9.1", - "@opentelemetry/tracing": "^0.24.0", - "@opentelemetry/sdk-metrics": "^1.15.1", - "@opentelemetry/exporter-prometheus": "^0.53.0", - "axios": "^1.3.3", - "co": "^4.6.0", - "express": ">=4.18.2", - "morgan": "*", - "mz": "^2.7.0", - "cloudevents": "^8.0.0" - } -} diff --git a/components/serverless/.golangci.yaml b/components/serverless/.golangci.yaml index 3a264843d..939ff6f15 100644 --- a/components/serverless/.golangci.yaml +++ b/components/serverless/.golangci.yaml @@ -18,8 +18,6 @@ issues: max-same-issues: 0 exclude: #exclude our internal deprecated fields - - "^SA1019: v1alpha2.Nodejs18 is deprecated:" - - "^SA1019: serverlessv1alpha2.Nodejs18 is deprecated:" - "^SA1019: status.RuntimeImageOverride is deprecated:" - "^SA1019: s.instance.Spec.Template is deprecated:" - "^SA1019: s.instance.Spec.Template.Labels 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 4c088e9eb..229f2450d 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 @@ -370,10 +370,8 @@ spec: type: object runtime: description: Specifies the runtime of the Function. The available - values are `nodejs18` - deprecated, `nodejs20`, - and `python312`. + values are `nodejs20` and `python312`. enum: - - nodejs18 - nodejs20 - python312 type: string diff --git a/components/serverless/internal/controllers/serverless/build_resources_test.go b/components/serverless/internal/controllers/serverless/build_resources_test.go index 1e5b48f72..ee17b39f3 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 ( - rtmNodeJS18 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.NodeJs18) rtmNodeJS20 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.NodeJs20) rtmPython312 = fnRuntime.GetRuntimeConfig(serverlessv1alpha2.Python312) ) @@ -449,25 +448,6 @@ func TestFunctionReconciler_buildJob(t *testing.T) { ExpectedMountsLen int ExpectedVolumeMounts []corev1.VolumeMount }{ - { - Name: "Success Node18", - Runtime: serverlessv1alpha2.NodeJs18, - ExpectedVolumesLen: 4, - ExpectedVolumes: []expectedVolume{ - {name: "sources", localObjectReference: cmName}, - {name: "runtime", localObjectReference: rtmNodeJS18.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 Node20", Runtime: serverlessv1alpha2.NodeJs20, diff --git a/components/serverless/internal/controllers/serverless/runtime/runtime.go b/components/serverless/internal/controllers/serverless/runtime/runtime.go index b15822541..77483353d 100644 --- a/components/serverless/internal/controllers/serverless/runtime/runtime.go +++ b/components/serverless/internal/controllers/serverless/runtime/runtime.go @@ -46,7 +46,7 @@ func fillConfigEnvVars(runtime serverlessv1alpha2.Runtime, config *Config) { func fillConfigFileNames(runtime serverlessv1alpha2.Runtime, config *Config) { switch runtime { - case serverlessv1alpha2.NodeJs18, serverlessv1alpha2.NodeJs20: + case serverlessv1alpha2.NodeJs20: 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 7b9ba3795..9c3883d2a 100644 --- a/components/serverless/internal/controllers/serverless/runtime/runtime_test.go +++ b/components/serverless/internal/controllers/serverless/runtime/runtime_test.go @@ -28,18 +28,6 @@ func TestGetRuntimeConfig(t *testing.T) { {Name: "PYTHONUNBUFFERED", Value: "TRUE"}}, }, }, - "nodejs18": { - name: "nodejs18 config", - runtime: serverlessv1alpha2.NodeJs18, - want: runtime.Config{ - Runtime: serverlessv1alpha2.NodeJs18, - DependencyFile: "package.json", - FunctionFile: "handler.js", - DockerfileConfigMapName: "dockerfile-nodejs18", - RuntimeEnvs: []corev1.EnvVar{ - {Name: "FUNC_RUNTIME", Value: "nodejs18"}}, - }, - }, "nodejs20": { name: "nodejs20 config", runtime: serverlessv1alpha2.NodeJs20, diff --git a/components/serverless/internal/controllers/serverless/utils.go b/components/serverless/internal/controllers/serverless/utils.go index 8885df0cd..7c4b51224 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.NodeJs18, serverlessv1alpha2.NodeJs20: + case serverlessv1alpha2.NodeJs20: return []corev1.VolumeMount{ { Name: "registry-config", diff --git a/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go b/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go index b634fbc1a..375b3eb8b 100644 --- a/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go +++ b/components/serverless/pkg/apis/serverless/v1alpha2/function_types.go @@ -26,9 +26,7 @@ type Runtime string const ( Python312 Runtime = "python312" - // Deprecated: Nodejs18 will be removed soon - NodeJs18 Runtime = "nodejs18" - NodeJs20 Runtime = "nodejs20" + NodeJs20 Runtime = "nodejs20" ) type FunctionType string @@ -167,8 +165,8 @@ const ( // Defines the desired state of the Function type FunctionSpec struct { - // Specifies the runtime of the Function. The available values are `nodejs18` - deprecated, `nodejs20`, and `python312`. - // +kubebuilder:validation:Enum=nodejs18;nodejs20;python312; + // Specifies the runtime of the Function. The available values are `nodejs20`, and `python312`. + // +kubebuilder:validation:Enum=nodejs20;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 d341b8f7c..f147c4369 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: nodejs18": { - fn: &serverlessv1alpha2.Function{ - ObjectMeta: fixMetadata, - Spec: serverlessv1alpha2.FunctionSpec{ - Runtime: serverlessv1alpha2.NodeJs18, - Source: serverlessv1alpha2.Source{ - Inline: &serverlessv1alpha2.InlineSource{Source: "a"}}, - }, - }, - }, "allowed runtime: nodejs20": { 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 248bc8668..29fe06913 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 NodeJs18, NodeJs20: + case NodeJs20: return validateNodeJSDependencies(dependencies) case Python312: return nil diff --git a/config/serverless/templates/busola-serverless-extension.yaml b/config/serverless/templates/busola-serverless-extension.yaml index 97b74d52f..b5bca3225 100644 --- a/config/serverless/templates/busola-serverless-extension.yaml +++ b/config/serverless/templates/busola-serverless-extension.yaml @@ -65,7 +65,7 @@ data: source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - name: header.runtime source: >- - spec.runtime = 'nodejs18' ? 'Node.js 18 - deprecated' : (spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) + spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) body: - widget: Tabs children: @@ -214,14 +214,14 @@ data: enum: [JavaScript, Python] trigger: [language] dynamicValue: | - spec.runtime in ['nodejs18', 'nodejs20'] ? 'JavaScript' : + spec.runtime in ['nodejs20'] ? 'JavaScript' : spec.runtime in ['python312'] ? 'Python' : '' - simple: true path: spec.runtime placeholder: placeholders.spec.runtime enum: | - $language = 'JavaScript' ? ['nodejs18', 'nodejs20'] : + $language = 'JavaScript' ? ['nodejs20'] : $language = 'Python' ? ['python312'] : [] subscribe: @@ -471,7 +471,7 @@ data: list: |- - name: header.runtime source: >- - spec.runtime = 'nodejs18' ? 'Node.js 18 - deprecated' : (spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) + spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) - name: header.sourceType source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - name: header.status @@ -582,7 +582,6 @@ data: Status: Status Runtime: Runtime 'Source Type': Source Type - spec.runtime.nodejs18: Node.js 18 - deprecated spec.runtime.nodejs20: Node.js 20 spec.runtime.python312: Python 3.12 spec.resourceConfiguration.build: Build diff --git a/config/serverless/templates/crds.yaml b/config/serverless/templates/crds.yaml index 869130bc4..8129e14b9 100644 --- a/config/serverless/templates/crds.yaml +++ b/config/serverless/templates/crds.yaml @@ -377,10 +377,8 @@ spec: type: object runtime: description: Specifies the runtime of the Function. The available - values are `nodejs18` - deprecated, `nodejs20`, - and `python312`. + values are `nodejs20` and `python312`. enum: - - nodejs18 - nodejs20 - python312 type: string diff --git a/config/serverless/templates/runtimes.yaml b/config/serverless/templates/runtimes.yaml index de3fe78dc..fdb573f38 100644 --- a/config/serverless/templates/runtimes.yaml +++ b/config/serverless/templates/runtimes.yaml @@ -1,36 +1,5 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: dockerfile-nodejs18 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: nodejs18 - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} - app.kubernetes.io/instance: {{ template "fullname" . }}-runtime-nodejs18 - app.kubernetes.io/component: {{ template "fullname" . }} -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_nodejs18) }} - 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-nodejs20 namespace: {{ .Release.Namespace }} diff --git a/config/serverless/values.yaml b/config/serverless/values.yaml index 101d159d1..74f77b64d 100644 --- a/config/serverless/values.yaml +++ b/config/serverless/values.yaml @@ -86,10 +86,6 @@ global: name: "registry-init" version: "v20240506-57d31b1d" directory: "prod" - function_runtime_nodejs18: - name: "function-runtime-nodejs18" - version: "main" - directory: "prod" function_runtime_nodejs20: name: "function-runtime-nodejs20" version: "main" diff --git a/docs/user/resources/06-10-function-cr.md b/docs/user/resources/06-10-function-cr.md index 932728bad..cba504418 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 `nodejs18` - deprecated, `nodejs20` and `python312`. | +| **runtime** (required) | string | Specifies the runtime of the Function. The available values are `nodejs20` 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 cfcae458e..833ecdb0f 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: `nodejs18` - deprecated, `nodejs20` and `python312`. | +| **FUNC_RUNTIME** | None | The name of the actual runtime. Possible values: `nodejs20` 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 bc458f6c1..97037da39 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 `nodejs18` - deprecated, `nodejs20` and `python312`. | +| **runtime** | Yes | Function | | Specifies the execution environment for your Function. The available values are `nodejs20` 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 cabd1db6c..6c879c1ed 100644 --- a/docs/user/technical-reference/07-70-function-specification.md +++ b/docs/user/technical-reference/07-70-function-specification.md @@ -142,12 +142,12 @@ See sample context details: See the detailed descriptions of these fields: -| Field | Description | -|-------|---------------------------------------------------------------------------------------------------------------------------------------------| -| **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 `nodejs18` - deprecated, `nodejs20` or `python312`. | -| **memory-limit** | Maximum amount of memory assigned to run a Function | +| Field | Description | +|-------|--------------------------------------------------------------------------------------------------------------------------------------------| +| **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 `nodejs20` or `python312`. | +| **memory-limit** | Maximum amount of memory assigned to run a Function | ## HTTP Requests diff --git a/hack/docker-compose.yaml b/hack/docker-compose.yaml index 600492232..85384d71d 100755 --- a/hack/docker-compose.yaml +++ b/hack/docker-compose.yaml @@ -13,12 +13,6 @@ services: context: ../ dockerfile: components/serverless/deploy/jobinit/Dockerfile # runtimes - function_runtime_nodejs18: - image: localhost:5000/kyma-project/function-runtime-nodejs18:local - platform: "linux/amd64" - build: - context: ../components/runtimes/nodejs - dockerfile: nodejs18/Dockerfile function_runtime_nodejs20: image: localhost:5000/kyma-project/function-runtime-nodejs20:local platform: "linux/amd64" diff --git a/sec-scanners-config.yaml b/sec-scanners-config.yaml index ca9d1c0f8..12a79a5ac 100644 --- a/sec-scanners-config.yaml +++ b/sec-scanners-config.yaml @@ -4,7 +4,6 @@ protecode: - europe-docker.pkg.dev/kyma-project/prod/serverless-operator:main - europe-docker.pkg.dev/kyma-project/prod/function-controller:main - europe-docker.pkg.dev/kyma-project/prod/function-build-init: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-python312:main - europe-docker.pkg.dev/kyma-project/prod/external/gcr.io/kaniko-project/executor:v1.23.2 diff --git a/tests/serverless-bench/fixtures/functions/nodejs18-l.yaml b/tests/serverless-bench/fixtures/functions/nodejs18-l.yaml deleted file mode 100644 index 8b8e7feef..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs18-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: nodejs18-l -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs18 - source: - inline: - dependencies: |- - { - "name": "nodejs18-l", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs18-m.yaml b/tests/serverless-bench/fixtures/functions/nodejs18-m.yaml deleted file mode 100644 index 7663feb57..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs18-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: nodejs18-m -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs18 - source: - inline: - dependencies: |- - { - "name": "nodejs18-m", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs18-s.yaml b/tests/serverless-bench/fixtures/functions/nodejs18-s.yaml deleted file mode 100644 index 891ac3132..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs18-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: nodejs18-s -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs18 - source: - inline: - dependencies: |- - { - "name": "nodejs18-s", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs18-xl.yaml b/tests/serverless-bench/fixtures/functions/nodejs18-xl.yaml deleted file mode 100644 index 3bce45d70..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs18-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: nodejs18-xl -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs18 - source: - inline: - dependencies: |- - { - "name": "nodejs18-xl", - "version": "0.0.1", - "dependencies": {} - } - source: |- - module.exports = { - main: function (event, context) { - return 'Hello Serverless' - } - } - diff --git a/tests/serverless-bench/fixtures/functions/nodejs18-xs.yaml b/tests/serverless-bench/fixtures/functions/nodejs18-xs.yaml deleted file mode 100644 index d5ee2537a..000000000 --- a/tests/serverless-bench/fixtures/functions/nodejs18-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: nodejs18-xs -spec: - scaleConfig: - maxReplicas: 1 - minReplicas: 1 - runtime: nodejs18 - source: - inline: - dependencies: |- - { - "name": "nodejs18-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 9468b225d..ecfe111a2 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="nodejs18-xs nodejs18-s nodejs18-m nodejs18-l nodejs18-xl nodejs20-xs nodejs20-s nodejs20-m nodejs20-l nodejs20-xl python312-s python312-m python312-l python312-xl" +ALL_FUNCTIONS="nodejs20-xs nodejs20-s nodejs20-m nodejs20-l nodejs20-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 29c5db272..709b378e5 100644 --- a/tests/serverless/internal/testsuite/api_gateway.go +++ b/tests/serverless/internal/testsuite/api_gateway.go @@ -21,7 +21,6 @@ import ( ) const ( - nodejs18 = "nodejs18" nodejs20 = "nodejs20" python312 = "python312" ) @@ -41,7 +40,6 @@ func FunctionAPIGatewayTest(restConfig *rest.Config, cfg internal.Config, logf * } python312Logger := logf.WithField(runtimeKey, "python312") - nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") nodejs20Logger := logf.WithField(runtimeKey, "nodejs20") genericContainer := utils.Container{ @@ -54,8 +52,6 @@ func FunctionAPIGatewayTest(restConfig *rest.Config, cfg internal.Config, logf * python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) - nodejs20Fn := function.NewFunction("nodejs20", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs20Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -67,10 +63,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(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), - ), executor.NewSerialTestRunner(nodejs20Logger, "NodeJS20 test", function.CreateFunction(nodejs20Logger, nodejs20Fn, "Create NodeJS20 Function", runtimes.BasicNodeJSFunction("Hello from nodejs20", serverlessv1alpha2.NodeJs20)), assertion.APIGatewayFunctionCheck("nodejs20", nodejs20Fn, coreCli, genericContainer.Namespace, nodejs20), diff --git a/tests/serverless/internal/testsuite/cloud_events.go b/tests/serverless/internal/testsuite/cloud_events.go index cee413234..525af23eb 100644 --- a/tests/serverless/internal/testsuite/cloud_events.go +++ b/tests/serverless/internal/testsuite/cloud_events.go @@ -36,7 +36,6 @@ func FunctionCloudEventsTest(restConfig *rest.Config, cfg internal.Config, logf } python312Logger := logf.WithField(runtimeKey, "python312") - nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") nodejs20Logger := logf.WithField(runtimeKey, "nodejs20") genericContainer := utils.Container{ @@ -49,7 +48,6 @@ func FunctionCloudEventsTest(restConfig *rest.Config, cfg internal.Config, logf publisherProxyMock := function.NewFunction("eventing-publisher-proxy", "kyma-system", cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) nodejs20Fn := function.NewFunction("nodejs20", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs20Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -64,12 +62,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(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), - assertion.CloudEventReceiveCheck(nodejs18Logger, "NodeJS18 cloud event binary check", cloudevents.EncodingBinary, nodejs18Fn.FunctionURL), - assertion.CloudEventSendCheck(nodejs18Logger, "NodeJS18 cloud event sent check", string(serverlessv1alpha2.NodeJs18), nodejs18Fn.FunctionURL, publisherProxyMock.FunctionURL), - ), executor.NewSerialTestRunner(nodejs20Logger, "NodeJS20 test", function.CreateFunction(nodejs20Logger, nodejs20Fn, "Create NodeJS20 Function", runtimes.NodeJSFunctionWithCloudEvent(serverlessv1alpha2.NodeJs20)), assertion.CloudEventReceiveCheck(nodejs20Logger, "NodeJS20 cloud event structured check", cloudevents.EncodingStructured, nodejs20Fn.FunctionURL), diff --git a/tests/serverless/internal/testsuite/light_runtimes.go b/tests/serverless/internal/testsuite/light_runtimes.go index ff140b016..01b052591 100644 --- a/tests/serverless/internal/testsuite/light_runtimes.go +++ b/tests/serverless/internal/testsuite/light_runtimes.go @@ -39,7 +39,6 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr } python312Logger := logf.WithField(runtimeKey, "python312") - nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") nodejs20Logger := logf.WithField(runtimeKey, "nodejs20") genericContainer := utils.Container{ @@ -52,8 +51,6 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) - nodejs20Fn := function.NewFunction("nodejs20", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs20Logger)) cm := configmap.NewConfigMap("test-serverless-configmap", genericContainer.WithLogger(nodejs20Logger)) @@ -62,6 +59,7 @@ func SimpleFunctionTest(restConfig *rest.Config, cfg internal.Config, logf *logr cmData := map[string]string{ cmEnvKey: cmEnvValue, } + sec := secret.NewSecret("test-serverless-secret", genericContainer.WithLogger(nodejs20Logger)) secEnvKey := "SECRET_ENV_KEY" secEnvValue := "Value taken as env from Secret" @@ -92,15 +90,9 @@ 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(nodejs18Logger, "NodeJS18 test", - configmap.CreateConfigMap(nodejs18Logger, cm, "Create Test ConfigMap", cmData), - secret.CreateSecret(nodejs18Logger, sec, "Create Test Secret", secretData), - function.CreateFunction(nodejs18Logger, nodejs18Fn, "Create NodeJS18 Function", runtimes.NodeJSFunctionWithEnvFromConfigMapAndSecret(cm.Name(), cmEnvKey, sec.Name(), secEnvKey, serverlessv1alpha2.NodeJs18)), - assertion.NewHTTPCheck(nodejs18Logger, "NodeJS18 pre update simple check through service", nodejs18Fn.FunctionURL, poll, fmt.Sprintf("%s-%s", cmEnvValue, secEnvValue)), - function.UpdateFunction(nodejs18Logger, nodejs18Fn, "Update NodeJS18 Function", runtimes.BasicNodeJSFunctionWithCustomDependency("Hello from updated nodejs18", serverlessv1alpha2.NodeJs18)), - assertion.NewHTTPCheck(nodejs18Logger, "NodeJS18 post update simple check through service", nodejs18Fn.FunctionURL, poll, "Hello from updated nodejs18"), - ), executor.NewSerialTestRunner(nodejs20Logger, "NodeJS20 test", + configmap.CreateConfigMap(nodejs20Logger, cm, "Create Test ConfigMap", cmData), + secret.CreateSecret(nodejs20Logger, sec, "Create Test Secret", secretData), function.CreateFunction(nodejs20Logger, nodejs20Fn, "Create NodeJS20 Function", runtimes.NodeJSFunctionWithEnvFromConfigMapAndSecret(cm.Name(), cmEnvKey, sec.Name(), secEnvKey, serverlessv1alpha2.NodeJs20)), assertion.NewHTTPCheck(nodejs20Logger, "NodeJS20 pre update simple check through service", nodejs20Fn.FunctionURL, poll, fmt.Sprintf("%s-%s", cmEnvValue, secEnvValue)), function.UpdateFunction(nodejs20Logger, nodejs20Fn, "Update NodeJS20 Function", runtimes.BasicNodeJSFunctionWithCustomDependency("Hello from updated nodejs20", serverlessv1alpha2.NodeJs20)), diff --git a/tests/serverless/internal/testsuite/tracing.go b/tests/serverless/internal/testsuite/tracing.go index 468cad23c..3f98c4235 100644 --- a/tests/serverless/internal/testsuite/tracing.go +++ b/tests/serverless/internal/testsuite/tracing.go @@ -47,7 +47,6 @@ func FunctionTracingTest(restConfig *rest.Config, cfg internal.Config, logf *log } python312Logger := logf.WithField(runtimeKey, "python312") - nodejs18Logger := logf.WithField(runtimeKey, "nodejs18") nodejs20Logger := logf.WithField(runtimeKey, "nodejs20") genericContainer := utils.Container{ @@ -60,8 +59,6 @@ func FunctionTracingTest(restConfig *rest.Config, cfg internal.Config, logf *log python312Fn := function.NewFunction("python312", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(python312Logger)) - nodejs18Fn := function.NewFunction("nodejs18", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs18Logger)) - nodejs20Fn := function.NewFunction("nodejs20", genericContainer.Namespace, cfg.KubectlProxyEnabled, genericContainer.WithLogger(nodejs20Logger)) logf.Infof("Testing function in namespace: %s", cfg.Namespace) @@ -84,10 +81,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(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), - ), executor.NewSerialTestRunner(nodejs20Logger, "NodeJS20 test", function.CreateFunction(nodejs20Logger, nodejs20Fn, "Create NodeJS20 Function", runtimes.BasicTracingNodeFunction(serverlessv1alpha2.NodeJs20, httpAppURL.String())), assertion.TracingHTTPCheck(nodejs20Logger, "NodeJS20 tracing headers check", nodejs20Fn.FunctionURL, poll),