Skip to content

Commit

Permalink
Enabling support for node18, node16, go1.19, go1.18, ruby3.1 and Remo…
Browse files Browse the repository at this point in the history
…ving support for node11, go1.15, python3.6, python3.7 (#660)

Co-authored-by: Rishabh Srivastav <[email protected]>
  • Loading branch information
rishabhsri18 and Rishabh Srivastav authored Jul 6, 2023
1 parent 6205e7d commit ce25d6d
Show file tree
Hide file tree
Showing 20 changed files with 631 additions and 159 deletions.
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# Releases

## v 0.6.26

* Enabling support for node18, node16, go1.19, go1.18, ruby3.1.
* Removing support for node11, go1.15, python3.6, python3.7

## v 0.6.25

* Support for multiple shapes(architectures) functions images:
Expand Down
12 changes: 6 additions & 6 deletions langs/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ var fallBackOlderVersions = map[string]LangHelper{}
func init() {
registerHelper(&DotnetLangHelper{Version: "6.0"})
registerHelper(&DotnetLangHelper{Version: "3.1"})
registerHelper(&GoLangHelper{Version: "1.15"})
registerHelper(&GoLangHelper{Version: "1.19"})
registerHelper(&GoLangHelper{Version: "1.18"})
// order matter, 'java' will pick up the first JavaLangHelper
registerHelper(&JavaLangHelper{version: "17"})
registerHelper(&JavaLangHelper{version: "11"})
registerHelper(&JavaLangHelper{version: "8"})
registerHelper(&NodeLangHelper{Version: "18"})
registerHelper(&NodeLangHelper{Version: "16"})
registerHelper(&NodeLangHelper{Version: "14"})
registerHelper(&NodeLangHelper{Version: "11"})
// order matter, 'python' will pick up the first PythonLangHelper
registerHelper(&PythonLangHelper{Version: "3.9"})
registerHelper(&PythonLangHelper{Version: "3.8"})
registerHelper(&PythonLangHelper{Version: "3.8.5"})
registerHelper(&PythonLangHelper{Version: "3.7"})
registerHelper(&PythonLangHelper{Version: "3.7.1"})
registerHelper(&PythonLangHelper{Version: "3.6"})

//New runtime support for Ruby 2.7
//New runtime support for Ruby 3.1
// order matter, 'ruby' will pick up the first RubyLangHelper
registerHelper(&RubyLangHelper{Version: "3.1"})
registerHelper(&RubyLangHelper{Version: "2.7"})

registerHelper(&KotlinLangHelper{})
Expand Down
3 changes: 2 additions & 1 deletion langs/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ func (h *GoLangHelper) DockerfileBuildCmds() []string {
r = append(r, "ENV GOFLAGS=\"-mod=vendor\"")
}
r = append(r, "COPY . .")
r = append(r, "RUN go mod tidy")
} else {
r = append(r, "ADD . /go/src/func/")
}

r = append(r, "RUN cd /go/src/func/ && go build -o func")
r = append(r, "RUN go build -o func -v")

return r
}
Expand Down
2 changes: 1 addition & 1 deletion langs/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (h *NodeLangHelper) DockerfileBuildCmds() []string {

r = append(r,
"ADD package.json /function/",
"RUN npm install",
"RUN npm install && chown -R $(id -u):$(id -g) node_modules",
)
}
return r
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPythonCall(t *testing.T) {
h.MkDir(funcName)
h.Cd(funcName)
h.Fn("init", "--name", funcName, "--runtime", "python3.6").AssertSuccess()
h.Fn("init", "--name", funcName, "--runtime", "python3.9").AssertSuccess()
appName := h.NewAppName()
h.Fn("deploy", "--local", appName).AssertSuccess()
h.Fn("invoke", appName, funcName).AssertSuccess()
Expand Down
6 changes: 4 additions & 2 deletions test/cli_docker_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import (
const dockerFile = `FROM golang:latest
FROM fnproject/go:dev as build-stage
WORKDIR /function
ADD . /go/src/func/
RUN cd /go/src/func/ && go build -o func
WORKDIR /go/src/func/
ENV GO111MODULE=on
COPY . .
RUN go build -o func -v
FROM fnproject/go
WORKDIR /function
COPY --from=build-stage /go/src/func/func /function/
Expand Down
11 changes: 9 additions & 2 deletions test/cli_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@ import (

var runtimes = []string{
"go",
"go1.19",
"go1.18",
"java",
"java8",
"java11",
"java17",
"kotlin",
"ruby",
"ruby3.1",
"ruby2.7",
"node",
"node18",
"node16",
"node14",
"python",
"python3.6",
"python3.7",
"python3.9",
"python3.8",
}

Expand Down
11 changes: 9 additions & 2 deletions test/cli_lang_boilerplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ var Runtimes = []struct {
callInput string
}{
{"go", ""},
{"go1.19", ""},
{"go1.18", ""},
{"dotnet", ""},
{"dotnet3.1", ""},
{"dotnet6.0", ""},
{"java", ""},
{"java8", ""},
{"java11", ""},
{"java17", ""},
{"kotlin", ""},
{"node", ""},
{"node18", ""},
{"node16", ""},
{"node14", ""},
{"ruby", ""},
{"ruby3.1", ""},
{"ruby2.7", ""},
{"python", ""},
{"python3.6", ""},
{"python3.7", ""},
{"python3.8", ""},
{"python3.9", ""},
}

func TestFnInitWithBoilerplateBuildsRuns(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions test/simplefunc/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/fnproject/cli/test/simplefunc

go 1.12
go 1.19

require github.com/fnproject/fdk-go v0.0.0-20181025170718-26ed643bea68
require github.com/fnproject/fdk-go v0.0.33
4 changes: 2 additions & 2 deletions test/simplefunc/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/fnproject/fdk-go v0.0.0-20181025170718-26ed643bea68 h1:T1Lm0ByviRKOUocQfjkVJ8EtinhJYwGVaoTQa2XVET0=
github.com/fnproject/fdk-go v0.0.0-20181025170718-26ed643bea68/go.mod h1:hzkP3qqXx+1pRBh2QVKr1I+jJ+5xrHIlh5z59XKZ/k0=
github.com/fnproject/fdk-go v0.0.33 h1:WwshAxOJ4pRauQKgaVkEADJEu4gNPqVfaY2AVW5KMqg=
github.com/fnproject/fdk-go v0.0.33/go.mod h1:hCpiyW8oIJpRdegoLf8PxKf9k+8mZZGeYgwSKOVG+K0=
3 changes: 3 additions & 0 deletions test/simplefunc/vendor/github.com/fnproject/fdk-go/.gitignore

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

2 changes: 1 addition & 1 deletion test/simplefunc/vendor/github.com/fnproject/fdk-go/LICENSE

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

23 changes: 23 additions & 0 deletions test/simplefunc/vendor/github.com/fnproject/fdk-go/NOTICE.txt

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

102 changes: 12 additions & 90 deletions test/simplefunc/vendor/github.com/fnproject/fdk-go/README.md

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

Loading

0 comments on commit ce25d6d

Please sign in to comment.