Git Product home page Git Product logo

samples's Introduction

banner

Cloud native FaaS platform for running Serverless workloads with ease

A+ good first follow on Twitter

👀 Overview

OpenFunction is a cloud-native open source FaaS (Function as a Service) platform aiming to let you focus on your business logic without having to maintain the underlying runtime environment and infrastructure. You only need to submit business-related source code in the form of functions.

OpenFunction features include:

  • Cloud agnostic and decoupled with cloud providers' BaaS
  • Pluggable architecture that allows multiple function runtimes
  • Support both sync and async functions
  • Unique async functions support that can consume events directly from event sources
  • Support generating OCI-Compliant container images directly from function source code.
  • Flexible autoscaling between 0 and N
  • Advanced async function autoscaling based on event sources' specific metrics
  • Simplified BaaS integration for both sync and async functions by introducing Dapr
  • Advanced function ingress & traffic management powered by K8s Gateway API
  • Flexible and easy-to-use events management framework

☸ Architecture

OpenFunction manages its components in the form of Custom Resource Definitions (CRD) throughout the lifecycle of a function, you can find more details in the Concepts section.

OpenFunction Events is OpenFunction's events framework, you can refer to OpenFunction Events for more information.

🚀 QuickStart

Install OpenFunction

To install OpenFunction, please refer to Installation Guide.

Create functions

You can find guides to create the sync and async functions in different languages here

Uninstall OpenFunction

To uninstall OpenFunction, please refer to Uninstallation Guide.

FAQ

When you encounter any problems when using OpenFunction, you can refer to the FAQ for help.

💻 Development

See the Development Guide to get started with developing this project.

🛣️ Roadmap

Here you can find OpenFunction roadmap.

🏘️ Community

Landscape



    

OpenFunction is a CNCF Sandbox project now which also enriches the CNCF Cloud Native Landscape.

📊 Status

Alt

samples's People

Contributors

benjaminhuo avatar linxuyalun avatar lizzzcai avatar penghuima avatar promisefru avatar tpiperatgod avatar wanjunlei avatar webup avatar wrongerror avatar x893675 avatar yangmao-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

samples's Issues

Documentation defect

There is a defect in this documentation.

In the beginning of third step, the command kubectl run --rm utils -it --image arunvelsriram/utils bash should be execute first, and following command kubectl run --rm utils -it --image arunvelsriram/utils bash .Then execute command kafkacat -L -b <kafka-server>-kafka-brokers:9092.

Is it really scaled to 0?

environment:Openfuntion v 0.4 Kubernetes v1.21.5 、Kubesphere v3.2.0
When i run pub/sub demo,It works fine .
The publisher continuously publishes messages, and the receiver can create up to 10 copies (the number of kafka topic partitions is also 10)

 subscription name: producer

 number of publishers: 2

 publish frequency: 100ms

 log frequency: 3s

 publish delay: 10s

 2021/11/05 02:12:44 OpenFuncAsync Function serving grpc: listening on port 8080

          0 published,   0/sec,   0 errors

          0 published,   0/sec,   0 errors

          0 published,   0/sec,   0 errors

 dapr client initializing for: 127.0.0.1:50001

         38 published,   3/sec,   0 errors

         98 published,   7/sec,   0 errors

        158 published,   9/sec,   0 errors

        218 published,  10/sec,   0 errors

        278 published,  12/sec,   0 errors

        338 published,  13/sec,   0 errors

        398 published,  13/sec,   0 errors

        458 published,  14/sec,   0 errors

        518 published,  14/sec,   0 errors

        578 published,  15/sec,   0 errors

        638 published,  15/sec,   0 errors

        698 published,  16/sec,   0 errors

        758 published,  16/sec,   0 errors

        818 published,  16/sec,   0 errors

        878 published,  16/sec,   0 errors

subscribe
image-20211105101643571

when I deleted the publisher

[root@master16 subscriber]# kubectl delete function autoscaling-producer
function.core.openfunction.io "autoscaling-producer" deleted

after a while, Subscribers shrink to 0

image-20211105103132386

But even after a long time, there will still be subscribers being created, ranging from 0-10 instances

image

you can see the time from picture , how is this going

Bysides, is there a specification in the yarm file of the function? like framework-context-spec
The names of deployment and pod seem to be named randomly, which is not easy to distinguish

Some YAML files and README.md documents still remain in v1beta1 format

Starting from version v1.1.0, the core v1beta1 API is deprecated and will be removed in the future. However, in some YAML files and README.md documents, there are still remain in v1beta1 format.
For example:
./functions/async/logs-handler-function/logs-handler-function.yaml: {"apiVersion":"core.openfunction.io/v1beta1","kind":"Function","metadata":{"annotations":{},"name":"logs-async-handler","namespace":"default"},"spec":{"build":{"builder":"openfunction/builder-go:latest","env":{"FUNC_CLEAR_SOURCE":"true","FUNC_NAME":"LogsHandler"},"srcRepo":{"revision":"main","sourceSubPath":"functions/async/logs-handler-function/","url":"https://github.com/OpenFunction/samples.git"}},"image":"openfunctiondev/logs-async-handler:v1","imageCredentials":{"name":"push-secret"},"serving":{"bindings":{"kafka-receiver":{"metadata":[{"name":"brokers","value":"kafka-server-kafka-brokers:9092"},{"name":"authRequired","value":"false"},{"name":"publishTopic","value":"logs"},{"name":"topics","value":"logs"},{"name":"consumerGroup","value":"logs-handler"}],"type":"bindings.kafka","version":"v1"},"notification-manager":{"metadata":[{"name":"url","value":"http://notification-manager-svc.kubesphere-monitoring-system.svc.cluster.local:19093/api/v2/alerts"}],"type":"bindings.http","version":"v1"}},"inputs":[{"component":"kafka-receiver","name":"kafka"}],"outputs":[{"component":"notification-manager","name":"notify","operation":"post"}],"runtime":"async","scaleOptions":{"keda":{"scaledObject":{"advanced":{"horizontalPodAutoscalerConfig":{"behavior":{"scaleDown":{"policies":[{"periodSeconds":15,"type":"Percent","value":50}],"stabilizationWindowSeconds":45},"scaleUp":{"stabilizationWindowSeconds":0}}}},"cooldownPeriod":60,"maxReplicaCount":10,"minReplicaCount":0,"pollingInterval":15}}},"template":{"containers":[{"imagePullPolicy":"IfNotPresent","name":"function"}]},"triggers":[{"metadata":{"bootstrapServers":"kafka-server-kafka-brokers.default.svc.cluster.local:9092","consumerGroup":"logs-handler","lagThreshold":"20","topic":"logs"},"type":"kafka"}]},"version":"v2.0.0"}}
./functions/async/pubsub/README.md:apiVersion: core.openfunction.io/v1beta1
./functions/knative/hello-world-go/README.md: apiVersion: core.openfunction.io/v1beta1
./functions/knative/hello-world-node/commonjs/README.md:apiVersion: core.openfunction.io/v1beta1
......

Long period of unresponsiveness while doing analyzing phase

When I ran the python sample command again, when it reached the analyzing stage, I found that it seemed to be stuck, and there was no response after waiting for a long time.

command:
pack build python-sample --builder openfunction/gcp-builder:v1 --env GOOGLE_FUNCTION_TARGET=hello_world --verbose

output:
(base) ➜ hello-world-python git:(main) pack build python-sample --builder openfunction/gcp-builder:v1 --env GOOGLE_FUNCTION_TARGET=hello_world --verbose
Builder openfunction/gcp-builder:v1 is untrusted
As a result, the phases of the lifecycle which require root access will be run in separate trusted ephemeral containers.
For more information, see https://medium.com/buildpacks/faster-more-secure-builds-with-pack-0-11-0-4d0c633ca619
Pulling image index.docker.io/openfunction/gcp-builder:v1
v1: Pulling from openfunction/gcp-builder
Digest: sha256:3d296221b2af792419753e04bee81e1b3a11531c31a75d731556c7d444ce43bc
Status: Image is up to date for openfunction/gcp-builder:v1
Selected run image openfunction/buildpacks-gcp-run:v1
Pulling image openfunction/buildpacks-gcp-run:v1
v1: Pulling from openfunction/buildpacks-gcp-run
Digest: sha256:17ef6b471598da30c935a7a1be861ca2b2d66e10b378f99ed546bc4a8d429a96
Status: Image is up to date for openfunction/buildpacks-gcp-run:v1
Pulling image buildpacksio/lifecycle:0.11.1
0.11.1: Pulling from buildpacksio/lifecycle
Digest: sha256:2ca9870d9472400792bdc2d43ded8df2642ffcf937e8cd01685836678c28780b
Status: Image is up to date for buildpacksio/lifecycle:0.11.1
Creating builder with the following buildpacks:
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
Provided Environment Variables
GOOGLE_FUNCTION_TARGET=hello_world
Using build cache volume pack-cache-library_python-sample_latest-a1e7d2840988.build
===> DETECTING
Running the detector on OS linux with:
Container Settings:
Args: /cnb/lifecycle/detector -app /workspace -log-level debug
System Envs: CNB_PLATFORM_API=0.6
Image: pack.local/builder/6b6e6f757a6567717967:latest
User:
Labels: map[author:pack]
Host Settings:
Binds: pack-layers-omuitrkdzg:/layers pack-app-ubbrfopbsb:/workspace
Network Mode:
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "hello_world"
[detector] ======== Output: [email protected] ========
[detector] Opting out: no project files or .dll files found
[detector] ======== Output: [email protected] ========
[detector] Opting out: no project files found and GOOGLE_BUILDABLE not set
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] pass: [email protected]
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: no project files or .dll files found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: no .go files found
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "hello_world"
[detector] ======== Output: [email protected] ========
[detector] Opting out: no .go files found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: no .go files found
[detector] ======== Output: [email protected] ========
[detector] Opting in: go.mod file not found, assuming GOPATH build
[detector] ======== Output: [email protected] ========
[detector] Opting out: no .go files found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml or .mvn/extensions.xml.
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "hello_world"
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: neither build.gradle nor build.gradle.kts found
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "hello_world"
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: META-INF/MANIFEST.MF not found
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml or .mvn/extensions.xml.
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml or .mvn/extensions.xml.
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: neither build.gradle nor build.gradle.kts found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting out: none of the following found: pom.xml, .mvn/extensions.xml, build.gradle, build.gradle.kts, META-INF/MANIFEST.MF, *.java, *.jar
[detector] ======== Output: [email protected] ========
[detector] Opting out: neither build.gradle nor build.gradle.kts found
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_CLEAR_SOURCE not set
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting in: found .py files
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "hello_world"
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting out: GOOGLE_ENTRYPOINT not set and Procfile not found
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] Resolving plan... (try #1)
[detector] 4 of 5 buildpacks participating
[detector] google.python.runtime 0.9.1
[detector] google.python.functions-framework 0.9.4
[detector] google.python.pip 0.9.2
[detector] google.utils.label 0.0.1
===> ANALYZING
Running the analyzer on OS linux with:
Container Settings:
Args: /cnb/lifecycle/analyzer -log-level debug -daemon -cache-dir /cache python-sample
System Envs: CNB_USER_ID=1000 CNB_GROUP_ID=1000 CNB_PLATFORM_API=0.6
Image: buildpacksio/lifecycle:0.11.1
User: root
Labels: map[author:pack]
Host Settings:
Binds: /var/run/docker.sock:/var/run/docker.sock pack-cache-library_python-sample_latest-a1e7d2840988.build:/cache pack-layers-omuitrkdzg:/layers pack-app-ubbrfopbsb:/workspace
Network Mode:

nodejs sample build fail

k logs builder-zx7hr-buildrun-mb8g2-vk45c-pod -c step-create
===> DETECTING
3 of 4 buildpacks participating
openfunction.nodejs.npm                 0.6.0
openfunction.nodejs.functions-framework 0.6.0
google.utils.label                      0.0.1
===> ANALYZING
Previous image with name "uestczshen/sample-node-esm-func:v1" not found
===> RESTORING
===> BUILDING
=== Node.js - NPM ([email protected]) ===
Generating package-lock.json.
WARNING: *** Improve build performance by generating and committing package-lock.json.
--------------------------------------------------------------------------------
Running "npm install --package-lock-only --quiet"
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/cloudevents (over 300000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cnb/.npm/_logs/2023-09-13T10_37_47_535Z-debug.log
Done "npm install --package-lock-only --quiet" (52m7.6884s)
Failure: (ID: b0ba1f57) npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/cloudevents (over 300000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cnb/.npm/_logs/2023-09-13T10_37_47_535Z-debug.log
ERROR: failed to build: exit status 1

maybe I should set the npm source https://registry.npm.taobao.org, but how to?

function.yaml

apiVersion: core.openfunction.io/v1beta2
kind: Function
metadata:
  name: node-sample
spec:
  version: "v1.0.0"
  image: "uestczshen/sample-node-esm-func:v1"
  imageCredentials:
    name: push-secret
  build:
    builder: "openfunction/builder-node:latest"
    env:
      FUNC_NAME: "helloESM"
      FUNC_TYPE: "http"
    srcRepo:
      url: "https://github.com/OpenFunction/samples.git"
      sourceSubPath: "functions/knative/hello-world-node/esm"
      revision: "main"
  serving:
    template:
      containers:
        - name: function
          imagePullPolicy: IfNotPresent 
    triggers:
      http:
        port: 8080

error on hello-word-go sample

Hi, I like the design of OpenFunction and want to explore it on my end. However, I am facing issues when running the sample.

  1. environment: minikube, Kubernetes v1.20.9
  2. follow steps in docs to install the dependencies
❯ k get functions
NAME              BUILDSTATE   SERVINGSTATE   BUILDER                         SERVING   AGE
function-sample   Failed                      function-sample-builder-kfgfc             4m37s
❯ k get taskrun
NAME                                                 SUCCEEDED   REASON           STARTTIME   COMPLETIONTIME
function-sample-builder-kfgfc-buildrun-7vwxm-zz7cb   False       CouldntGetTask   4m38s       4m38s

below is the error in the TaskRun.

completionTime: '2021-09-23T17:41:58Z'
conditions:
  - lastTransitionTime: '2021-09-23T17:41:58Z'
    message: >-
      failed to create task run pod
      "function-sample-builder-kfgfc-buildrun-7vwxm-zz7cb": admission webhook
      "sidecar-injector.dapr.io" denied the request: service account
      'system:serviceaccount:tekton-pipelines:tekton-pipelines-controller' not
      on the list of allowed controller accounts. Maybe invalid TaskSpec
    reason: CouldntGetTask
    status: 'False'
    type: Succeeded
podName: ''
startTime: '2021-09-23T17:41:58Z'
taskSpec:
  params:
    - default: Dockerfile
      description: Path to the Dockerfile
      name: DOCKERFILE
      type: string
    - default: .
      description: The root of the code
      name: CONTEXT_DIR
      type: string
    - description: The URL of the image that the build produces
      name: shp-output-image
      type: string
    - description: The context directory inside the source directory
      name: shp-source-context
      type: string
    - description: The source directory
      name: shp-source-root
      type: string
    - default: 'openfunction/builder:v1'
      description: Image containing the build tools/logic
      name: BUILDER_IMAGE
      type: string
    - description: The name of where to store the app image.
      name: APP_IMAGE
      type: string
    - default: ''
      description: A subpath within the source input where the source to build is located.
      name: SOURCE_SUBPATH
      type: string
    - default: web
      description: The default process type to set on the image.
      name: PROCESS_TYPE
      type: string
    - default: ''
      description: Reference to a run image to use.
      name: RUN_IMAGE
      type: string
    - default: ''
      description: >-
        The name of the persistent app cache image (if no cache workspace is
        provided).
      name: CACHE_IMAGE
      type: string
    - default: 'false'
      description: Do not write layer metadata or restore cached layers.
      name: SKIP_RESTORE
      type: string
    - default: '1000'
      description: The user ID of the builder image user.
      name: USER_ID
      type: string
    - default: '1000'
      description: The group ID of the builder image user.
      name: GROUP_ID
      type: string
    - default: empty-dir
      description: The name of the platform directory.
      name: PLATFORM_DIR
      type: string
    - default: ''
      description: >-
        Environment variables to set during _build-time_. The formate is
        `key1=value1,key2=value2`.
      name: ENV_VARS
      type: string
  results:
    - description: The digest of the image
      name: shp-image-digest
    - description: The compressed size of the image
      name: shp-image-size
    - description: The commit SHA of the cloned source.
      name: shp-source-default-commit-sha
  steps:
    - args:
        - '--url'
        - 'https://github.com/OpenFunction/samples.git'
        - '--target'
        - $(params.shp-source-root)
        - '--result-file-commit-sha'
        - $(results.shp-source-default-commit-sha.path)
      command:
        - /ko-app/git
      image: >-
        quay.io/shipwright/git:nightly-2021-08-07-1628312894@sha256:d0ba59e6d3b8407ae28147c55f6e04eaf0883c8ad38ee5b75a114963265e935e
      name: source-default
      resources: {}
      securityContext:
        runAsGroup: 1000
        runAsUser: 1000
    - args:
        - '-c'
        - |
          #!/usr/bin/env bash
          set -e

          for path in "/cache" "/tekton/home" "/layers" "/workspace/source"; do
            echo "> Setting permissions on '$path'..."
            chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$path"
          done

          echo "> Processing any environment variables..."
          ENV_DIR="/platform/env"

          echo "--> Creating 'env' directory: $ENV_DIR"
          mkdir -p "$ENV_DIR"

          envs=(`echo $(params.ENV_VARS) | tr ',' ' '`)

          for env in "${envs[@]}"; do
              IFS='=' read -r key value string <<< "$env"
              if [[ "$key" != "" && "$value" != "" ]]; then
                  path="${ENV_DIR}/${key}"
                  echo "--> Writing ${path}..."
                  echo -n "$value" > "$path"
              fi
          done
      command:
        - /usr/local/bin/bash
      image: >-
        docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
      name: prepare
      resources: {}
      securityContext:
        privileged: true
      volumeMounts:
        - mountPath: /cache
          name: cache
        - mountPath: /layers
          name: layers-dir
        - mountPath: /platform
          name: $(params.PLATFORM_DIR)
    - args:
        - '-app=/workspace/source/$(params.CONTEXT_DIR)'
        - '-cache-dir=/cache'
        - '-uid=$(params.USER_ID)'
        - '-gid=$(params.GROUP_ID)'
        - '-layers=/layers'
        - '-platform=/platform'
        - '-report=/layers/report.toml'
        - '-process-type=$(params.PROCESS_TYPE)'
        - '-skip-restore=$(params.SKIP_RESTORE)'
        - '-previous-image=$(params.APP_IMAGE)'
        - '-run-image=$(params.RUN_IMAGE)'
        - $(params.APP_IMAGE)
      command:
        - /cnb/lifecycle/creator
      image: $(params.BUILDER_IMAGE)
      imagePullPolicy: Always
      name: create
      resources: {}
      securityContext:
        runAsGroup: 1000
        runAsUser: 1000
      volumeMounts:
        - mountPath: /cache
          name: cache
        - mountPath: /layers
          name: layers-dir
        - mountPath: /platform
          name: $(params.PLATFORM_DIR)
    - args:
        - '-c'
        - >
          #!/usr/bin/env bash

          set -e

          cat /layers/report.toml | grep "digest" | cut -d'"' -f2 | cut -d'"'
          -f2 | tr -d '\n' | tee $(results.shp-image-digest.path)
      command:
        - /bin/sh
      image: >-
        docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
      name: results
      resources: {}
      volumeMounts:
        - mountPath: /layers
          name: layers-dir
  volumes:
    - name: cache
    - name: layers-dir
    - name: $(params.PLATFORM_DIR)
  workspaces:
    - name: source

Did I miss anything during the installation? Let me know if you need further information, thanks.

helloworld-go : no matches for kind "Function" in version "core.openfunction.io/v1beta1"

following hello-world-go, when i exec command

kubectl apply -f function-sample.yaml

An error occurred :

error: unable to recognize "function-sample.yaml": no matches for kind "Function" in version "core.openfunction.io/v1beta1"

can help me?

I just completely installed ofn. and the pods of ofn components were running that i have checked.

The following existing components will be skipped:
        - CertManager
        - IngressNginx
        - Dapr
        - Keda
        - Knative Serving
        - Tekton Pipelines
        - Shipwright
 ✓ Shipwright - Completed!
 ✓ OpenFunction - Completed!
🚀 Completed in 1m9.205258418s.

java outputs has null exception

When I deploy java demo according this link https://github.com/OpenFunction/samples/tree/main/functions/knative/java/with-output-binding, after deploy, I access function, but has exception as:

[main] INFO org.eclipse.jetty.server.Server - jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 18.0.1.1+2
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6f5ffd5c{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@5e792d1b{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
[main] INFO org.eclipse.jetty.server.Server - Started Server@ee6f42b2{STARTING}[11.0.9,sto=0] @397ms
plugin plugin-example:v1.0.0 exec pre hook for http function at 2023-03-08 11:01:55.Z
receive event: {"message":"Awesome OpenFunction!"}
Mar 08, 2023 11:01:55 AM dev.openfunction.invoker.runtime.SynchronizeRuntime$OpenFunctionServlet service
SEVERE: Failed to execute function
java.lang.NullPointerException: Cannot invoke "io.dapr.client.DaprClient.invokeBinding(java.lang.String, java.lang.String, byte[], java.util.Map)" because "this.daprClient" is null
        at dev.openfunction.invoker.context.UserContext.send(UserContext.java:116)
        at dev.openfunction.samples.OpenFunctionImpl.accept(OpenFunctionImpl.java:15)
        at dev.openfunction.invoker.runtime.SynchronizeRuntime$OpenFunctionServlet.service(SynchronizeRuntime.java:166)
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:508)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1375)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:463)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1297)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
        at org.eclipse.jetty.server.Server.handle(Server.java:562)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
        at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
        at java.base/java.lang.Thread.run(Unknown Source)

From above, it may be not init dapr client for java sdk.

Sample function Python fails to build: dial tcp 216.58.215.174:443: i/o timeout [id:65f44802]

Following the sample instructions: https://github.com/OpenFunction/samples/tree/main/functions/knative/hello-world-python

$ sudo pack build python-sample --builder openfunction/gcp-builder:v1 --env GOOGLE_FUNCTION_TARGET=hello_world
v1: Pulling from openfunction/gcp-builder
Digest: sha256:3c059c0cc83c98b43fc947f470162720a7b59dd45a7dd38af1c1f4ee54a24794
Status: Image is up to date for openfunction/gcp-builder:v1
v1: Pulling from buildpacks/gcp/run
Digest: sha256:4ba3727b3c1527ecb81e5e84db9447fd955859868c52d7b41bca97a1f6df4b9b
Status: Image is up to date for gcr.io/buildpacks/gcp/run:v1
0.13.3: Pulling from buildpacksio/lifecycle
Digest: sha256:9d194fc3997e8c448473431433908d932cd359b10b270f2b0f76ec795c8cae28
Status: Image is up to date for buildpacksio/lifecycle:0.13.3
===> ANALYZING
[analyzer] Previous image with name "python-sample" not found
===> DETECTING
[detector] 4 of 5 buildpacks participating
[detector] google.python.runtime             0.9.1
[detector] google.python.functions-framework 0.9.6
[detector] google.python.pip                 0.9.2
[detector] google.utils.label                0.0.2
===> RESTORING
===> BUILDING
[builder] === Python - Runtime ([email protected]) ===
[builder] Python version not specified, using the test available version.
[builder] 2022/12/02 10:17:02 [DEBUG] GET https://dl.google.com/runtimes/python/version.json
[builder] 2022/12/02 10:17:32 [ERR] GET https://dl.google.com/runtimes/python/version.json request failed: Get "https://dl.google.com/runtimes/python/version.json": dial tcp 216.58.215.174:443: i/o timeout
[builder] 2022/12/02 10:17:32 [DEBUG] GET https://dl.google.com/runtimes/python/version.json: retrying in 1s (3 left)
[builder] 2022/12/02 10:18:03 [ERR] GET https://dl.google.com/runtimes/python/version.json request failed: Get "https://dl.google.com/runtimes/python/version.json": dial tcp 216.58.215.174:443: i/o timeout
[builder] 2022/12/02 10:18:03 [DEBUG] GET https://dl.google.com/runtimes/python/version.json: retrying in 2s (2 left)
[builder] 2022/12/02 10:18:35 [ERR] GET https://dl.google.com/runtimes/python/version.json request failed: Get "https://dl.google.com/runtimes/python/version.json": dial tcp 216.58.215.174:443: i/o timeout
[builder] 2022/12/02 10:18:35 [DEBUG] GET https://dl.google.com/runtimes/python/version.json: retrying in 4s (1 left)
[builder] 2022/12/02 10:19:09 [ERR] GET https://dl.google.com/runtimes/python/version.json request failed: Get "https://dl.google.com/runtimes/python/version.json": dial tcp 216.58.215.174:443: i/o timeout
[builder] Failure: (ID: a800fcc9) fetching Python versions: requesting https://dl.google.com/runtimes/python/version.json: Get "https://dl.google.com/runtimes/python/version.json": GET https://dl.google.com/runtimes/python/version.json giving up after 4 attempt(s): Get "https://dl.google.com/runtimes/python/version.json": dial tcp 216.58.215.174:443: i/o timeout [id:65f44802]
[builder] --------------------------------------------------------------------------------
[builder] Sorry your project couldn't be built.
[builder] Our documentation explains ways to configure Buildpacks to better recognise your project:
[builder]  -> https://github.com/GoogleCloudPlatform/buildpacks/blob/main/README.md
[builder] If you think you've found an issue, please report it:
[builder]  -> https://github.com/GoogleCloudPlatform/buildpacks/issues/new
[builder] --------------------------------------------------------------------------------
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle. This may be the result of using an untrusted builder: failed with status code: 51

The machine is able to connect to https://dl.google.com/runtimes/python/version.json, but a 404 page is returned

$ curl https://dl.google.com/runtimes/python/version.json

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>  <ins>That’s all we know.</ins>

Failed to register: Function failed to register: invalid runtime: Async

I deploy functio async pubsub demo, and I get below error:
image

kubectl logs serving-hbhs8-deployment-v200-jtwxp-59787c577d-68btk
2023/02/23 10:28:35 Failed to register: Function failed to register: invalid runtime: Async

My sub function yaml is:

apiVersion: core.openfunction.io/v1beta1
kind: Function
metadata:
  name: autoscaling-subscriber
spec:
  version: "v2.0.0"
  image: openfunctiondev/autoscaling-subscriber:latest

  serving:
    runtime: "async"
    scaleOptions:
      keda:
        scaledObject:
          pollingInterval: 15
          minReplicaCount: 0
          maxReplicaCount: 10
          cooldownPeriod: 60
          advanced:
            horizontalPodAutoscalerConfig:
              behavior:
                scaleDown:
                  stabilizationWindowSeconds: 45
                  policies:
                  - type: Percent
                    value: 50
                    periodSeconds: 15
                scaleUp:
                  stabilizationWindowSeconds: 0
    triggers:
      - type: kafka
        metadata:
          topic: "sample-topic"
          bootstrapServers: kafka-server-kafka-brokers.default.svc.cluster.local:9092
          consumerGroup: autoscaling-subscriber
          lagThreshold: "20"
    template:
      containers:
        - name: function # DO NOT change this
          imagePullPolicy: IfNotPresent
    inputs:
      - name: producer
        component: kafka-server
        topic: "sample-topic"
    pubsub:
      kafka-server:
        type: pubsub.kafka
        version: v1
        metadata:
          - name: brokers
            value: "kafka-server-kafka-brokers:9092"
          - name: authRequired
            value: "false"
          - name: allowedTopics
            value: "sample-topic"
          - name: consumerID
            value: "autoscaling-subscriber"

Function build failed for poor network

I was trying to run demo logs-handler-function but it failed on step-create for golang connection problem,
微信截图_20211101163109
how to config goproxy in yaml?
can we add a option for poor network like --poor-network in OF?

Hello-world-dotnet build error

cd ./functions/knative/hello-world-dotnet
vi function-dotnet-sample.yaml:

apiVersion: core.openfunction.io/v1beta1
kind: Function
metadata:
name: dotnet-sample
namespace: default
spec:
version: "v1.0.0"
image: "geffzhang/sample-dotnet-func:v1"
imageCredentials:
name: push-secret
port: 8080 # default to 8080
build:
builder: "openfunction/gcp-builder:v1"
env:
GOOGLE_FUNCTION_TARGET: "helloworld"
GOOGLE_FUNCTION_SIGNATURE_TYPE: "http"
srcRepo:
url: "https://github.com/openfunction/samples.git"
sourceSubPath: "functions/knative/hello-world-dotnet"
revision: "release-0.6"
serving:
runtime: "knative" # default to knative
template:
containers:
- name: function
imagePullPolicy: IfNotPresent

kubectl apply -f function-dotnet-sample.yaml

geffzhang@edgevm1:~/openfunctionsamples/functions/knative/hello-world-dotnet$ sudo kubectl get functions
[sudo] password for geffzhang:
NAME BUILDSTATE SERVINGSTATE BUILDER SERVING URL AGE
dotnet-sample Failed builder-6c6ft 3d
function-sample Succeeded Running builder-rk8wj serving-24tnk http://openfunction.io/default/function-sample 3d

geffzhang@edgevm1:~/openfunctionsamples/functions/knative/hello-world-dotnet$ sudo kubectl get builders
NAME PHASE STATE REASON AGE
builder-6c6ft Build Failed Failed 75m

geffzhang@edgevm1:~/openfunctionsamples/functions/knative/hello-world-dotnet$ sudo kubectl get builds
NAME REGISTERED REASON BUILDSTRATEGYKIND BUILDSTRATEGYNAME CREATIONTIME
builder-6c6ft-build-4tgcn True Succeeded ClusterBuildStrategy openfunction 75m

geffzhang@edgevm1:~/openfunctionsamples/functions/knative/hello-world-dotnet$ sudo kubectl get builders -o yaml
apiVersion: v1
items:

  • apiVersion: core.openfunction.io/v1beta1
    kind: Builder
    metadata:
    creationTimestamp: "2022-04-24T07:47:01Z"
    generateName: builder-
    generation: 1
    labels:
    openfunction.io/function: dotnet-sample
    managedFields:
    • apiVersion: core.openfunction.io/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
      f:metadata:
      f:generateName: {}
      f:labels:
      .: {}
      f:openfunction.io/function: {}
      f:ownerReferences:
      .: {}
      k:{"uid":"4050ecd6-fb8f-4142-9b8b-89b1e50911c4"}: {}
      f:spec:
      .: {}
      f:builder: {}
      f:env:
      .: {}
      f:GOOGLE_FUNCTION_SIGNATURE_TYPE: {}
      f:GOOGLE_FUNCTION_TARGET: {}
      f:image: {}
      f:imageCredentials:
      .: {}
      f:name: {}
      f:port: {}
      f:srcRepo:
      .: {}
      f:revision: {}
      f:sourceSubPath: {}
      f:url: {}
      manager: openfunction
      operation: Update
      time: "2022-04-24T07:47:01Z"
    • apiVersion: core.openfunction.io/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
      f:status:
      .: {}
      f:phase: {}
      f:reason: {}
      f:resourceRef:
      .: {}
      f:shipwright.io/build: {}
      f:shipwright.io/buildRun: {}
      f:state: {}
      manager: openfunction
      operation: Update
      subresource: status
      time: "2022-04-24T07:47:25Z"
      name: builder-6c6ft
      namespace: default
      ownerReferences:
    • apiVersion: core.openfunction.io/v1beta1
      blockOwnerDeletion: true
      controller: true
      kind: Function
      name: dotnet-sample
      uid: 4050ecd6-fb8f-4142-9b8b-89b1e50911c4
      resourceVersion: "6571022"
      uid: 9403e275-630a-4b80-b776-ead01b593d92
      spec:
      builder: openfunction/gcp-builder:v1
      env:
      GOOGLE_FUNCTION_SIGNATURE_TYPE: http
      GOOGLE_FUNCTION_TARGET: helloworld
      image: geffzhang/sample-dotnet-func:v1
      imageCredentials:
      name: push-secret
      port: 8080
      srcRepo:
      revision: release-0.6
      sourceSubPath: functions/knative/hello-world-dotnet
      url: https://github.com/geffzhang/openfunctionsamples.git
      status:
      phase: Build
      reason: Failed
      resourceRef:
      shipwright.io/build: builder-6c6ft-build-4tgcn
      shipwright.io/buildRun: builder-6c6ft-buildrun-lp5pz
      state: Failed
      kind: List
      metadata:
      resourceVersion: ""
      selfLink: ""

geffzhang@edgevm1:~/openfunctionsamples/functions/knative/hello-world-dotnet$ sudo kubectl get buildruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
builder-6c6ft-buildrun-lp5pz False Failed 79m 78m

sudo kubectl --namespace default logs builder-6c6ft-buildrun-lp5pz --container=step-create
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()+MoveNext()
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider manifestProvider)
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(IWorkloadManifestProvider manifestProvider, String dotnetRootPath, String sdkVersion, String userProfileDir)
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir)
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
/workspace/source/functions/knative/hello-world-dotnet/helloworld.csproj : error MSB4242: at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)""

Sorry your project couldn't be built.
Our documentation explains ways to configure Buildpacks to better recognise your project:
-> https://github.com/GoogleCloudPlatform/buildpacks/blob/main/README.md
If you think you've found an issue, please report it:
-> https://github.com/GoogleCloudPlatform/buildpacks/issues/new

ERROR: failed to build: exit status 1

GoogleCloudPlatform/buildpacks#157

java-sample build failed due to network io timeout, can we do offline build?

I am following the java-sample steps.

~ kubectl apply -f java-function-sample.yml

~ cat java-function-sample.yml
apiVersion: core.openfunction.io/v1beta1
kind: Function
metadata:
  name: java-sample
spec:
  version: "v1.0.0"
  image: "harbor.local/sample-java-func:latest"
  imageCredentials:
    name: harbor-secret
  port: 80 # default to 8080
  build:
    builder: "openfunction/gcp-builder:v1"
    env:
      GOOGLE_FUNCTION_TARGET: "com.openfunction.HelloWorld"
      GOOGLE_FUNCTION_SIGNATURE_TYPE: "http"
    srcRepo:
      url: "https://github.com/OpenFunction/samples.git"
      sourceSubPath: "functions/knative/hello-world-java"
      revision: "main"
  serving:
    runtime: knative # default to knative
    template:
      containers:
        - name: function
          imagePullPolicy: Always

The builder failed when step-create, the error log is following:

 ===> DETECTING
 4 of 5 buildpacks participating
 google.java.runtime             0.9.1
 google.java.maven               0.9.0
 google.java.functions-framework 1.0.1
 google.utils.label              0.0.1
 ===> ANALYZING
 Previous image with name "harbor.local/sample-java-func:latest" not found
 ===> RESTORING
 ===> BUILDING
 === Java - Runtime ([email protected]) ===
 Using latest Java 11 runtime version. You can specify a different version with GOOGLE_RUNTIME_VERSION: https://github.com/GoogleCloudPlatform/buildpacks#configuration
 Failure: (ID: 2ff5e9d8) getting status code for https://api.adoptopenjdk.net/v3/assets/feature_releases/11/ga?architecture=x64&heap_size=normal&image_type=jdk&jvm_impl=hotspot&os=linux&page=0&page_size=1&project=jdk&sort_order=DESC&vendor=adoptopenjdk: Head "https://api.adoptopenjdk.net/v3/assets/feature_releases/11/ga?architecture=x64&heap_size=normal&image_type=jdk&jvm_impl=hotspot&os=linux&page=0&page_size=1&project=jdk&sort_order=DESC&vendor=adoptopenjdk": dial tcp 104.17.158.60:443: i/o timeout
 --------------------------------------------------------------------------------
 Sorry your project couldn't be built.
 Our documentation explains ways to configure Buildpacks to better recognise your project:
  -> https://github.com/GoogleCloudPlatform/buildpacks/blob/main/README.md
 If you think you've found an issue, please report it:
  -> https://github.com/GoogleCloudPlatform/buildpacks/issues/new
 --------------------------------------------------------------------------------
 ERROR: failed to build: exit status 1

Since many production environments cannot access internet, can we build Function from source code without internet?

When I follow the doc of the "hello-world-go" sample, the function build succeed but serving not running

the sample is samples/functions/knative/hello-world=go

when i build the function and deploy it in the cluster, the four containers of the builder pod run successfully, and the state of function build is succeed. However, i can not see any "serving ksvc", and when i do "kubectl get function", i see that the servingstate of the function is "created", not "running".

1

When i do "kubectl get serving", the serving does not have phase or state

2

What happens here? When i describe "function" or "serving", i can not get any helpful message.

Unsupported Kafka.spec.kafka.version: 2.8.0. Supported versions are: [3.2.0, 3.2.1, 3.2.3, 3.3.1, 3.3.2, 3.4.0]

When I deploy kafka as https://github.com/OpenFunction/samples/blob/release-0.6/Prerequisites.md#kafka, I get the follow error at pod strimzi-cluster-operator

io.strimzi.operator.cluster.model.KafkaVersion$UnsupportedKafkaVersionException: Unsupported Kafka.spec.kafka.version: 2.8.0. Supported versions are: [3.2.0, 3.2.1, 3.2.3, 3.3.1, 3.3.2, 3.4.0]
        at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.supportedVersion(KafkaVersion.java:180) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.VersionChangeCreator.<init>(VersionChangeCreator.java:87) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.versionChangeCreator(KafkaAssemblyOperator.java:371) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.versionChange(KafkaAssemblyOperator.java:380) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator.lambda$reconcile$2(KafkaAssemblyOperator.java:150) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[io.netty.netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
2023-03-07 11:05:49 WARN  AbstractOperator:525 - Reconciliation #8(timer) Kafka(default/kafka-openfunction-demo): Failed to reconcile
io.strimzi.operator.cluster.model.KafkaVersion$UnsupportedKafkaVersionException: Unsupported Kafka.spec.kafka.version: 2.8.0. Supported versions are: [3.2.0, 3.2.1, 3.2.3, 3.3.1, 3.3.2, 3.4.0]
        at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.supportedVersion(KafkaVersion.java:180) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.VersionChangeCreator.<init>(VersionChangeCreator.java:87) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.versionChangeCreator(KafkaAssemblyOperator.java:371) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.versionChange(KafkaAssemblyOperator.java:380) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator.lambda$reconcile$2(KafkaAssemblyOperator.java:150) ~[io.strimzi.cluster-operator-0.33.2.jar:0.33.2]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.SucceededFuture.addListener(SucceededFuture.java:88) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54) ~[io.vertx.vertx-core-4.3.7.jar:4.3.7]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[io.netty.netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.1.86.Final.jar:4.1.86.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

I change kafka version spec.kafka.version from 2.0.0 to 3.4.8, it work well.

The simultaneous use of one's own image in the build of Python functions does not take effect

Hello, when I used the description of openfunction to deploy a Python function as a service, I wanted to use my own image (which contains some data files), but when I declared spec build params RUN_ After IMAGE, the generated pod did not use the image I declared. Is there any problem with the declared image? It's quite urgent, online, etc

你好,我使用openfunction的描述去部署一个python函数为服务时,希望使用我自己的一个镜像(镜像里面有一些数据文件),但是在我声明了spec build params RUN_IMAGE后,生成的pod并没有使用我声明的镜像,是声明的有什么问题吗,挺急的,在线等

apiVersion: core.openfunction.io/v1beta1
kind: Function
metadata:
namespace: "abc"
name: "test--testtpy"
spec:
version: "v2.0.0"
image: "172.16.xxx.xxx:81/abc/test--testtpy:v2"
imageCredentials:
name: push-secret
port: 8080
build:
builder: "openfunction/gcp-builder:v1"
env:
GOOGLE_FUNCTION_TARGET: "hello_world"
GOOGLE_FUNCTION_SIGNATURE_TYPE: "http"
GOOGLE_FUNCTION_SOURCE: "main.py"
params:
RUN_IMAGE: "172.16.xxx.xxx:81/zhikong/ubuntu-20.04.4lts-block-inner:v2"
srcRepo:
url: "[email protected]:abc/test.git"
sourceSubPath: "/testtpy"
revision: "main"
credentials:
name: secret-git-ssh-auth2
serving:
scaleOptions:
minReplicas: 1
maxReplicas: 10
runtime: "knative"
template:
containers:
- name: function # DO NOT change this
imagePullPolicy: IfNotPresent
route:
gatewayRef:
name: openfunction
namespace: openfunction
rules:
- matches:
- path:
type: PathPrefix
value: "/faas/xxx/test/tt/py"

Internal error occurred: failed calling webhook

I0912 00:00:28.627015   63437 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.24.1 (linux/amd64) kubernetes/3ddd0f4" 'https://10.31.15.7:6443/apis/external.metrics.k8s.io/v1beta1?timeout=32s'
I0912 00:00:28.627947   63437 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.24.1 (linux/amd64) kubernetes/3ddd0f4" 'https://10.31.15.7:6443/apis/projectcalico.org/v3?timeout=32s'
I0912 00:00:28.629477   63437 round_trippers.go:553] GET https://10.31.15.7:6443/apis/external.metrics.k8s.io/v1beta1?timeout=32s 503 Service Unavailable in 2 milliseconds
I0912 00:00:28.629554   63437 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 1 ms Duration 2 ms
I0912 00:00:28.629596   63437 round_trippers.go:577] Response Headers:
I0912 00:00:28.629634   63437 round_trippers.go:580]     Cache-Control: no-cache, private
I0912 00:00:28.629671   63437 round_trippers.go:580]     Content-Type: text/plain; charset=utf-8
I0912 00:00:28.629706   63437 round_trippers.go:580]     X-Content-Type-Options: nosniff
I0912 00:00:28.629744   63437 round_trippers.go:580]     X-Kubernetes-Pf-Flowschema-Uid: d24d64c9-0ac8-4205-8348-bd562b45a666
I0912 00:00:28.629778   63437 round_trippers.go:580]     X-Kubernetes-Pf-Prioritylevel-Uid: 3ac48240-d767-40fd-be50-5f9d375c7e30
I0912 00:00:28.629817   63437 round_trippers.go:580]     Content-Length: 20
I0912 00:00:28.629853   63437 round_trippers.go:580]     Date: Mon, 11 Sep 2023 16:00:28 GMT
I0912 00:00:28.629887   63437 round_trippers.go:580]     Audit-Id: b63280a8-5111-4af1-a451-0539dbe852b3
I0912 00:00:28.633706   63437 request.go:1073] Response Body: service unavailable
I0912 00:00:28.633809   63437 round_trippers.go:553] GET https://10.31.15.7:6443/apis/projectcalico.org/v3?timeout=32s 503 Service Unavailable in 5 milliseconds
I0912 00:00:28.633820   63437 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 0 ms Duration 5 ms
I0912 00:00:28.633837   63437 round_trippers.go:577] Response Headers:
I0912 00:00:28.633847   63437 round_trippers.go:580]     Cache-Control: no-cache, private
I0912 00:00:28.633856   63437 round_trippers.go:580]     Content-Type: text/plain; charset=utf-8
I0912 00:00:28.633865   63437 round_trippers.go:580]     X-Content-Type-Options: nosniff
I0912 00:00:28.633874   63437 round_trippers.go:580]     X-Kubernetes-Pf-Flowschema-Uid: d24d64c9-0ac8-4205-8348-bd562b45a666
I0912 00:00:28.633883   63437 round_trippers.go:580]     X-Kubernetes-Pf-Prioritylevel-Uid: 3ac48240-d767-40fd-be50-5f9d375c7e30
I0912 00:00:28.633892   63437 round_trippers.go:580]     Content-Length: 20
I0912 00:00:28.633898   63437 round_trippers.go:580]     Date: Mon, 11 Sep 2023 16:00:28 GMT
I0912 00:00:28.633904   63437 round_trippers.go:580]     Audit-Id: 838e15b2-c845-47d3-9abb-645564a45195
I0912 00:00:28.638017   63437 request.go:1073] Response Body: service unavailable
I0912 00:00:28.641820   63437 request.go:1264] body was not decodable (unable to check for Status): couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:\"apiVersion,omitempty\""; Kind string "json:\"kind,omitempty\"" }
I0912 00:00:28.641840   63437 cached_discovery.go:83] skipped caching discovery info due to the server is currently unable to handle the request
I0912 00:00:28.645336   63437 request.go:1264] body was not decodable (unable to check for Status): couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:\"apiVersion,omitempty\""; Kind string "json:\"kind,omitempty\"" }
I0912 00:00:28.645353   63437 cached_discovery.go:83] skipped caching discovery info due to the server is currently unable to handle the request
I0912 00:00:28.646375   63437 request.go:1073] Request Body: {"apiVersion":"core.openfunction.io/v1beta2","kind":"Function","metadata":{"name":"function-sample","namespace":"default"},"spec":{"build":{"builder":"openfunction/builder-go:latest","env":{"FUNC_CLEAR_SOURCE":"true","FUNC_GOPROXY":"https://goproxy.cn","FUNC_NAME":"HelloWorld"},"srcRepo":{"revision":"main","sourceSubPath":"functions/knative/hello-world-go","url":"https://github.com/OpenFunction/samples.git"}},"image":"openfunctiondev/sample-go-func:v1","imageCredentials":{"name":"push-secret"},"serving":{"template":{"containers":[{"imagePullPolicy":"IfNotPresent","name":"function"}]},"triggers":{"http":{"port":8080}}},"version":"v2.0.0"}}
I0912 00:00:28.646427   63437 round_trippers.go:466] curl -v -XPOST  -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: kubectl/v1.24.1 (linux/amd64) kubernetes/3ddd0f4" 'https://10.31.15.7:6443/apis/core.openfunction.io/v1beta2/namespaces/default/functions?fieldManager=kubectl-create&fieldValidation=Strict'
I0912 00:00:38.649930   63437 round_trippers.go:553] POST https://10.31.15.7:6443/apis/core.openfunction.io/v1beta2/namespaces/default/functions?fieldManager=kubectl-create&fieldValidation=Strict 500 Internal Server Error in 10003 milliseconds
I0912 00:00:38.649954   63437 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 10003 ms Duration 10003 ms
I0912 00:00:38.649961   63437 round_trippers.go:577] Response Headers:
I0912 00:00:38.649969   63437 round_trippers.go:580]     Audit-Id: ae032296-cec4-42b5-92f0-e611cfa1c5ec
I0912 00:00:38.649976   63437 round_trippers.go:580]     Cache-Control: no-cache, private
I0912 00:00:38.649982   63437 round_trippers.go:580]     Content-Type: application/json
I0912 00:00:38.649987   63437 round_trippers.go:580]     X-Kubernetes-Pf-Flowschema-Uid: d24d64c9-0ac8-4205-8348-bd562b45a666
I0912 00:00:38.649994   63437 round_trippers.go:580]     X-Kubernetes-Pf-Prioritylevel-Uid: 3ac48240-d767-40fd-be50-5f9d375c7e30
I0912 00:00:38.650003   63437 round_trippers.go:580]     Content-Length: 619
I0912 00:00:38.650010   63437 round_trippers.go:580]     Date: Mon, 11 Sep 2023 16:00:38 GMT
I0912 00:00:38.650350   63437 request.go:1073] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Internal error occurred: failed calling webhook \"mfunctions.of.io\": failed to call webhook: Post \"https://openfunction-webhook-service.openfunction.svc:443/mutate-core-openfunction-io-v1beta2-function?timeout=10s\": context deadline exceeded","reason":"InternalError","details":{"causes":[{"message":"failed calling webhook \"mfunctions.of.io\": failed to call webhook: Post \"https://openfunction-webhook-service.openfunction.svc:443/mutate-core-openfunction-io-v1beta2-function?timeout=10s\": context deadline exceeded"}]},"code":500}
I0912 00:00:38.652411   63437 helpers.go:222] server response object: [{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "error when creating \"function-sample.yaml\": Internal error occurred: failed calling webhook \"mfunctions.of.io\": failed to call webhook: Post \"https://openfunction-webhook-service.openfunction.svc:443/mutate-core-openfunction-io-v1beta2-function?timeout=10s\": context deadline exceeded",
  "reason": "InternalError",
  "details": {
    "causes": [
      {
        "message": "failed calling webhook \"mfunctions.of.io\": failed to call webhook: Post \"https://openfunction-webhook-service.openfunction.svc:443/mutate-core-openfunction-io-v1beta2-function?timeout=10s\": context deadline exceeded"
      }
    ]
  },
  "code": 500
}]
Error from server (InternalError): error when creating "function-sample.yaml": Internal error occurred: failed calling webhook "mfunctions.of.io": failed to call webhook: Post "https://openfunction-webhook-service.openfunction.svc:443/mutate-core-openfunction-io-v1beta2-function?timeout=10s": context deadline exceeded

k8s 1.24.2 system ubuntu

use hello word sample.

apiVersion: core.openfunction.io/v1beta2
kind: Function
metadata:
  name: function-sample
spec:
  version: "v2.0.0"
  image: "openfunctiondev/sample-go-func:v1"
  imageCredentials:
    name: push-secret
  build:
    builder: openfunction/builder-go:latest
    env:
      FUNC_NAME: "HelloWorld"
      FUNC_CLEAR_SOURCE: "true"
      FUNC_GOPROXY: "https://goproxy.cn"
    srcRepo:
      url: "https://github.com/OpenFunction/samples.git"
      sourceSubPath: "functions/knative/hello-world-go"
      revision: "main"
  serving:
    template:
      containers:
        - name: function
          imagePullPolicy: IfNotPresent
    triggers:
      http:
        port: 8080

no samples about state management, such as redis, postgres.

no samples about state management, such as redis, postgres. so should I just refer to the docs of dapr? and I just use the dapr.NewClient() to do so.
In the sample of output and input with kafka, I find the code _, err := ctx.Send("target", greeting).
so can I use the inovation of this style in redis, postgres crud?

functions/Knative/hello-world-go build failed

I have install openfunction controller, shipwright, knative-serving successfully.

NAME READY STATUS RESTARTS AGE
openfunction-controller-manager-85595fb5fb-4zf68 2/2 Running 1 75m
NAME READY STATUS RESTARTS AGE
shipwright-build-controller-664579bfc9-nwh54 1/1 Running 0 25m

NAME READY STATUS RESTARTS AGE
3scale-kourier-control-7c7cc7cbdd-gcr8x 1/1 Running 0 4h49m
activator-6677ff99b7-tx2cd 1/1 Running 0 4h49m
autoscaler-55c7df76d9-d9ptk 1/1 Running 0 4h49m
controller-68c85ff597-dckcv 1/1 Running 0 4h49m
default-domain-59lf7 0/1 Error 0 79m
default-domain-76rtv 0/1 Error 0 4h49m
default-domain-8qw6j 0/1 Error 0 3h44m
default-domain-drrhk 0/1 Error 0 3h
default-domain-jbmkh 0/1 Error 0 4h6m
default-domain-kcjxg 0/1 Error 0 3h22m
default-domain-m2wmv 0/1 Error 0 153m
default-domain-nntjs 0/1 Error 0 101m
default-domain-q9brz 0/1 Error 0 4h27m
default-domain-qjc94 0/1 Error 0 80m
default-domain-r24hr 0/1 Error 0 127m
domain-mapping-7bc789d54-dnzcl 1/1 Running 0 4h49m
domainmapping-webhook-557cbfd6f5-4ckz6 1/1 Running 0 4h49m
webhook-7fd7cdb-gn82k 1/1 Running 0 4h49m

I use the function yaml from the sameple and use my private registry
And I already create the secret push-secret

apiVersion: core.openfunction.io/v1alpha1
kind: Function
metadata:
  name: function-sample
spec:
  version: "v1.0.0"
  image: "myPrivateRegistry/sample-go-func:latest"  
  imageCredentials:
    name: push-secret
  #port: 8080 # default to 8080
  build:
    builder: openfunction/builder:v1
    env:
      FUNC_NAME: "HelloWorld"
      FUNC_TYPE: "http"
      #FUNC_SRC: "main.py"
    srcRepo:
      url: "https://github.com/OpenFunction/samples.git"
      sourceSubPath: "functions/Knative/hello-world-go"
  serving:
    runtime: Knative
    template:
      containers:
        - name: function
          imagePullPolicy: Always

kubectl get builder function-sample-builder-v7ncm
NAME PHASE STATE AGE
function-sample-builder-v7ncm Build Failed 12m

build failed and I cannot see any information via kubectl describe builder function-sample-builder-v7ncm

Status:
  Phase:  Build
  Resource Ref:
    shipwright.io/build:     function-sample-builder-v7ncm-build-xkpd5
    shipwright.io/buildRun:  function-sample-builder-v7ncm-buildrun-fnf7p
  State:                     Failed
Events:                      <none>

I could not find any useful message in shipwright-build-controller

shipwright-build log file below

shipwright-build-controller.log

When I follow the doc of the 'multiple-functions-go' sample But failed

the sample is samples/functions/knative/multiple-functions-go

when I build the function locally and attempt to edit function-sample.yaml to deploy in the cluster. But it shows me that fn.spec.serving is necessary. Then I add fn.spec.serving.runtime: knative to the file, But a new error has occurred.

➜  multiple-functions-go git:(main) ✗ k get fn
NAME              BUILDSTATE   SERVINGSTATE   BUILDER   SERVING         ADDRESS   AGE
function-sample   Skipped      Failed                   serving-lt2wd             57s

BTW, how to get the log info for the function, Thx :)

couldn't find output binding serving-fv9tm-bindings-httpz-m5cbd

I'm trying the sample named with-output-binding, and function-front.yaml may confuse me. so I make my yaml based on the readme. k8s v1.26.0 openfunction/openfunction:v1.1.1
my serving config is as below:
‘‘‘
apiVersion: core.openfunction.io/v1beta2
serving:
scaleOptions:
minReplicas: 0
maxReplicas: 5
outputs:
- dapr:
name: httpz
operation: "post"
- dapr:
name: httpy
operation: "get"
bindings:
httpz:
type: bindings.http
version: v1
metadata:
- name: url
value: "http://10.0.0.127:14121/workwxsdk/proxy/service/corpid_to_opencorpid"
- name: direction
value: "output"
httpy:
type: bindings.http
version: v1
metadata:
- name : url
value: "http://10.0.0.127:30417/corp_customer/customer/info"
- name: direction
value: "output"
template:
containers:
- name: function
imagePullPolicy: IfNotPresent
triggers:
http:
port: 8080
’’’

and my code is as below:
req := CorpIDToOpenReq{ CorpID: "xxxxxxx", } data, _ := json.Marshal(req) bytes, err := ctx.Send("httpz", data) if err != nil { return ctx.ReturnOnInternalError(), err }
Then a error raised:
2023/09/07 02:04:14 httpz
2023/09/07 02:04:14 {httpz serving-fv9tm-bindings-httpz-m5cbd bindings.http map[] post}
2023/09/07 02:04:14 httpy
2023/09/07 02:04:14 {httpy serving-fv9tm-bindings-httpy-v2t64 bindings.http map[] get}
2023/09/07 02:04:14 [123 10 9 34 110 34 58 32 49 10 125]
2023/09/07 02:04:15 error invoking binding serving-fv9tm-bindings-httpz-m5cbd/post: rpc error: code = Internal desc = error when invoke output binding serving-fv9tm-bindings-httpz-m5cbd: couldn't find output binding serving-fv9tm-bindings-httpz-m5cbd

I print the output map, there's a key named httpz. and I want to invode a nodapr httpendpoint. so what's wrong with my code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.