Skip to content

Commit

Permalink
Support rust generic runtime (#688)
Browse files Browse the repository at this point in the history
* Support rust generic runtime

* Update webhook

* Update runner image

* Fix rust oauth2

* Fix vulnerability

* Fix vulnerability

* Remove unittest for go1.18

* Add default runner image for wasm
  • Loading branch information
jiangpengcheng authored Oct 23, 2023
1 parent da7ead5 commit 606dc73
Show file tree
Hide file tree
Showing 18 changed files with 369 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.18, 1.19, 1.20.4]
go-version: [1.19, 1.20.4]
steps:
- name: clean disk
run: |
Expand Down
19 changes: 15 additions & 4 deletions api/compute/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (o *OAuth2Config) GetMountFile() string {
}

func (o *OAuth2Config) AuthenticationParameters() string {
return fmt.Sprintf(`'{"privateKey":"%s","private_key":"%s","issuerUrl":"%s","issuer_url":"%s","audience":"%s","scope":"%s"}'`, o.GetMountFile(), o.GetMountFile(), o.IssuerURL, o.IssuerURL, o.Audience, o.Scope)
return fmt.Sprintf(`'{"credentials_url":"file://%s","privateKey":"%s","private_key":"%s","issuerUrl":"%s","issuer_url":"%s","audience":"%s","scope":"%s"}'`, o.GetMountFile(), o.GetMountFile(), o.GetMountFile(), o.IssuerURL, o.IssuerURL, o.Audience, o.Scope)
}

type GenericAuth struct {
Expand Down Expand Up @@ -234,9 +234,10 @@ type PodPolicy struct {
}

type Runtime struct {
Java *JavaRuntime `json:"java,omitempty"`
Python *PythonRuntime `json:"python,omitempty"`
Golang *GoRuntime `json:"golang,omitempty"`
Java *JavaRuntime `json:"java,omitempty"`
Python *PythonRuntime `json:"python,omitempty"`
Golang *GoRuntime `json:"golang,omitempty"`
GenericRuntime *GenericRuntime `json:"genericRuntime,omitempty"`
}

// JavaRuntime contains the java runtime configs
Expand Down Expand Up @@ -268,6 +269,16 @@ type GoRuntime struct {
Log *RuntimeLogConfig `json:"log,omitempty"`
}

// GenericRuntime contains the generic runtime configs
// +kubebuilder:validation:Optional
type GenericRuntime struct {
// +kubebuilder:validation:Required
FunctionFile string `json:"functionFile"`
// +kubebuilder:validation:Required
Language string `json:"language"`
FunctionFileLocation string `json:"functionFileLocation,omitempty"`
}

type SecretRef struct {
Path string `json:"path,omitempty"`
Key string `json:"key,omitempty"`
Expand Down
20 changes: 20 additions & 0 deletions api/compute/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -3620,6 +3632,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -6937,6 +6961,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
36 changes: 36 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functionmeshes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -3621,6 +3633,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -6938,6 +6962,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sinks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Loading

0 comments on commit 606dc73

Please sign in to comment.