Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Update ballerina runtime version to 0.975.0 (#828)
Browse files Browse the repository at this point in the history
* Update ballerina runtime version to 0.975.0

* Update kubeless-non-rbac.jsonnet
  • Loading branch information
anuruddhal authored and andresmgot committed Jun 22, 2018
1 parent 4ec2a5f commit ee208e9
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docker/runtime/ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[project]
org-name = "kubeless"
version = "0.0.3"
version = "0.0.4"
2 changes: 1 addition & 1 deletion docker/runtime/ballerina/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ballerina/ballerina-platform:0.970.1
FROM ballerina/ballerina:0.975.0

USER 1000

Expand Down
4 changes: 3 additions & 1 deletion docker/runtime/ballerina/Dockerfile.init
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ballerina/ballerina-platform:0.970.1
FROM ballerina/ballerina-platform:0.975.0

USER 1000

WORKDIR /kubeless

# Install controller
ADD kubeless_run.tpl.bal /ballerina/files/src/

Expand Down
8 changes: 4 additions & 4 deletions docker/runtime/ballerina/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
init-image:
docker build -f Dockerfile.init -t kubeless/ballerina-init:0.970.1 .
docker build -f Dockerfile.init -t kubeless/ballerina-init:0.975.0 .

runtime-image:
env GOOS=linux GOARCH=amd64 go build $$GOPATH/src/github.com/kubeless/kubeless/pkg/function-proxy/proxy.go
docker build -f Dockerfile -t kubeless/ballerina:0.970.1 .
docker build -f Dockerfile -t kubeless/ballerina:0.975.0 .

push-init:
docker push kubeless/ballerina-init:0.970.1
docker push kubeless/ballerina-init:0.975.0

push-runtime:
docker push kubeless/ballerina:0.970.1
docker push kubeless/ballerina:0.975.0

# Mandatory jobs
build-all: init-image runtime-image
Expand Down
4 changes: 2 additions & 2 deletions docker/runtime/ballerina/kubeless/kubeless.bal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public type Event{
public type Event record {
string data;
string event_id;
string event_type;
Expand All @@ -7,7 +7,7 @@ public type Event{
map extensions;
};

public type Context{
public type Context record {
string function_name;
string time_out;
string runtime;
Expand Down
8 changes: 4 additions & 4 deletions docs/runtimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ By default Kubeless has support for the following runtimes:
- PHP: For the branch 7.2
- Golang: For the branch 1.10
- .NET: For the branch 2.0
- Ballerina: For the branch 0.970.1
- Ballerina: For the branch 0.975.0

You can see the list of supported runtimes executing:

```console
$ kubeless get-server-config
INFO[0000] Current Server Config:
INFO[0000] Supported Runtimes are: python2.7, python3.4, python3.6, nodejs6, nodejs8, ruby2.4, php7.2, go1.10, dotnetcore2.0, java1.8, ballerina0.970.1
INFO[0000] Supported Runtimes are: python2.7, python3.4, python3.6, nodejs6, nodejs8, ruby2.4, php7.2, go1.10, dotnetcore2.0, java1.8, ballerina0.975.0
```

Each runtime is encapsulated in a container image. The reference to these images are injected in the Kubeless configuration. You can find the source code of all runtimes in [`docker/runtime`](https://github.com/kubeless/kubeless/tree/master/docker/runtime).
Expand Down Expand Up @@ -380,7 +380,7 @@ The Ballerina functions should import the package `kubeless/kubeless`. This [pac

```console
$ kubeless function deploy foo
--runtime ballerina0.970.1
--runtime ballerina0.975.0
--from-file foo.bal
--handler foo.foo
```
Expand All @@ -396,7 +396,7 @@ foo
$ zip -r -j foo.zip foo/

$ kubeless function deploy foo
--runtime ballerina0.970.1
--runtime ballerina0.975.0
--from-file foo.zip
--handler hellowithconf.foo
```
Expand Down
8 changes: 4 additions & 4 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -807,27 +807,27 @@ get-nodejs-distroless-deps-verify:
kubeless function call get-nodejs-distroless-deps --data '{"hello": "world"}' | grep -q 'hello.*world.*date.*UTC'

get-ballerina:
kubeless function deploy get-ballerina --runtime ballerina0.970.1 --from-file ballerina/helloget.bal --handler helloget.foo
kubeless function deploy get-ballerina --runtime ballerina0.975.0 --from-file ballerina/helloget.bal --handler helloget.foo

get-ballerina-verify:
kubeless function call get-ballerina |egrep Hello.World.Ballerina

get-ballerina-custom-port:
kubeless function deploy get-ballerina-custom-port --runtime ballerina0.970.1 --handler helloget.foo --from-file ballerina/helloget.bal --port 8083
kubeless function deploy get-ballerina-custom-port --runtime ballerina0.975.0 --handler helloget.foo --from-file ballerina/helloget.bal --port 8083

get-ballerina-custom-port-verify:
kubectl get svc get-ballerina-custom-port -o yaml | grep 'targetPort: 8083'
kubeless function call get-ballerina-custom-port |egrep Hello.World.Ballerina

get-ballerina-data:
kubeless function deploy get-ballerina-data --runtime ballerina0.970.1 --from-file ballerina/hellowithdata.bal --handler hellowithdata.foo
kubeless function deploy get-ballerina-data --runtime ballerina0.975.0 --from-file ballerina/hellowithdata.bal --handler hellowithdata.foo

get-ballerina-data-verify:
kubeless function call get-ballerina-data --data '{"hello":"world"}' |egrep hello

get-ballerina-conf:
zip -r -j ballerina/bar.zip ballerina/hello_with_conf/
kubeless function deploy get-ballerina-conf --runtime ballerina0.970.1 --from-file ballerina/bar.zip --handler hello_with_conf.bar
kubeless function deploy get-ballerina-conf --runtime ballerina0.975.0 --from-file ballerina/bar.zip --handler hello_with_conf.bar
rm ballerina/bar.zip

get-ballerina-conf-verify:
Expand Down
8 changes: 4 additions & 4 deletions kubeless-non-rbac.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ local runtime_images ='[
"compiled": true,
"versions": [
{
"name": "ballerina0.970.1",
"version": "0.970.1",
"runtimeImage": "kubeless/ballerina@sha256:e9eb2b5e5fb6f8294afea7ad4c02be71d6878305d1d4542aab2e8d2ef50d8be0",
"initImage": "kubeless/ballerina-init@sha256:4030be0d7f513e4153993e6703d8b368a9ae8d093fcd9d322e3c1d8d30bf6eb2"
"name": "ballerina0.975.0",
"version": "0.975.0",
"runtimeImage": "kubeless/ballerina@sha256:e3d1159a7fe285ab206166e3397259b14a71aa39c9575da8ad400ecf7ff8054b",
"initImage": "kubeless/ballerina-init@sha256:f09c885bfdd48d481fd53eae4452fef4e7e6cb4b5221a2bbfbc4955b2a5f2f05"
}
],
"depName": "",
Expand Down
5 changes: 4 additions & 1 deletion pkg/langruntime/langruntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,16 @@ func (l *Langruntimes) GetCompilationContainer(runtime, funcName string, install
case strings.Contains(runtime, "dotnetcore"):
command = "/app/compile-function.sh " + installVolume.MountPath
case strings.Contains(runtime, "ballerina"):
//TODO: Remove ballerina pull and additional copy steps in next version update
command = fmt.Sprintf(
"mkdir /kubeless/func/ && "+
"mkdir -p /kubeless/func/ \\?/.ballerina/repo && "+
"cp -r /kubeless/*.bal /kubeless/func/ && "+
"touch /kubeless/kubeless.toml && "+
"cp -r /ballerina/files/src/kubeless_run.tpl.bal /kubeless/ && "+
"sed 's/<<FUNCTION>>/%s/g' /kubeless/kubeless_run.tpl.bal > /kubeless/kubeless_run.bal && "+
"rm /kubeless/kubeless_run.tpl.bal && "+
"ballerina pull kubeless/kubeless && "+
"cp -a \\?/.ballerina/caches/central.ballerina.io/* \\?/.ballerina/repo/ &&"+
"ballerina build kubeless_run.bal ", funcName)

default:
Expand Down

0 comments on commit ee208e9

Please sign in to comment.