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

Commit

Permalink
Add kubeless package to ballerina central (#802)
Browse files Browse the repository at this point in the history
* Add kubeless package to ballerina central

* Push images to kubeless repo
  • Loading branch information
anuruddhal authored and andresmgot committed Jun 7, 2018
1 parent 8a9fdde commit 10477c7
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 15 deletions.
2 changes: 2 additions & 0 deletions docker/runtime/ballerina/.ballerina/.gitignore
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions docker/runtime/ballerina/.gitignore
@@ -0,0 +1,2 @@
target/
proxy
3 changes: 3 additions & 0 deletions docker/runtime/ballerina/Ballerina.toml
@@ -0,0 +1,3 @@
[project]
org-name = "kubeless"
version = "0.0.3"
2 changes: 1 addition & 1 deletion docker/runtime/ballerina/Dockerfile
Expand Up @@ -8,4 +8,4 @@ ENV FUNC_PROCESS="ballerina run kubeless_run.balx -c kubeless.toml"

ADD proxy /

CMD [ "/proxy" ]
CMD [ "/proxy" ]
3 changes: 1 addition & 2 deletions docker/runtime/ballerina/Dockerfile.init
Expand Up @@ -2,8 +2,7 @@ FROM ballerina/ballerina-platform:0.970.1

USER 1000

# Install controller & Kubeless type definitions
# Install controller
ADD kubeless_run.tpl.bal /ballerina/files/src/
ADD kubeless/kubeless.bal /ballerina/files/kubeless/

ENTRYPOINT [""]
2 changes: 1 addition & 1 deletion docker/runtime/ballerina/example/foo.bal
@@ -1,4 +1,4 @@
import kubeless;
import kubeless/kubeless;
import ballerina/io;

public function foo(kubeless:Event event, kubeless:Context context) returns (string|error) {
Expand Down
3 changes: 3 additions & 0 deletions docker/runtime/ballerina/kubeless/Package.md
@@ -0,0 +1,3 @@
# Kubeless

Types definition for Kubeless Events & Context.
2 changes: 1 addition & 1 deletion docker/runtime/ballerina/kubeless_run.tpl.bal
Expand Up @@ -16,7 +16,7 @@ import ballerina/http;
import ballerina/io;
import ballerina/config;
import func;
import kubeless;
import kubeless/kubeless;

// A service endpoint represents a listener
endpoint http:Listener listener {
Expand Down
6 changes: 3 additions & 3 deletions docs/runtimes.md
Expand Up @@ -354,7 +354,7 @@ kubeless function deploy fibonacci --from-file fibonacci.cs --handler module.han
#### Example

```ballerina
import kubeless;
import kubeless/kubeless;
import ballerina/io;
public function foo(kubeless:Event event, kubeless:Context context) returns (string|error) {
Expand All @@ -367,7 +367,7 @@ public function foo(kubeless:Event event, kubeless:Context context) returns (str

#### Description

The Ballerina functions should import the package `kubeless`. This [package](../docker/runtime/ballerina/kubeless/kubeless.bal) contains two types `Event` and `Context`.
The Ballerina functions should import the package `kubeless/kubeless`. This [package](../docker/runtime/ballerina/kubeless/kubeless.bal) contains two types `Event` and `Context`.

```console
$ kubeless function deploy foo
Expand All @@ -385,7 +385,7 @@ foo

$ zip -r -j foo.zip foo/

$ kubeless function deploy get-ballerina-conf
$ kubeless function deploy foo
--runtime ballerina0.970.1
--from-file foo.zip
--handler hellowithconf.foo
Expand Down
2 changes: 1 addition & 1 deletion examples/ballerina/hello_with_conf/hello_with_conf.bal
@@ -1,4 +1,4 @@
import kubeless;
import kubeless/kubeless;
import ballerina/io;
import ballerina/config;

Expand Down
2 changes: 1 addition & 1 deletion examples/ballerina/helloget.bal
@@ -1,4 +1,4 @@
import kubeless;
import kubeless/kubeless;

public function foo(kubeless:Event event, kubeless:Context context) returns (string|error) {
return "Hello World Ballerina";
Expand Down
2 changes: 1 addition & 1 deletion examples/ballerina/hellowithdata.bal
@@ -1,4 +1,4 @@
import kubeless;
import kubeless/kubeless;
import ballerina/io;

public function foo(kubeless:Event event, kubeless:Context context) returns (string|error) {
Expand Down
4 changes: 2 additions & 2 deletions kubeless-non-rbac.jsonnet
Expand Up @@ -210,8 +210,8 @@ local runtime_images ='[
{
"name": "ballerina0.970.1",
"version": "0.970.1",
"runtimeImage": "kubeless/ballerina@sha256:b1f4f0cb65258d3035ae9eec2ae37a7c0d7e4eac6b150da5fb7933668114a409",
"initImage": "kubeless/ballerina-init@sha256:5acecccb9d05d298606c8514ee16b25bab76e4a2f35eda30601bb7f229e01cfd"
"runtimeImage": "kubeless/ballerina@sha256:e9eb2b5e5fb6f8294afea7ad4c02be71d6878305d1d4542aab2e8d2ef50d8be0",
"initImage": "kubeless/ballerina-init@sha256:4030be0d7f513e4153993e6703d8b368a9ae8d093fcd9d322e3c1d8d30bf6eb2"
}
],
"depName": "",
Expand Down
3 changes: 1 addition & 2 deletions pkg/langruntime/langruntime.go
Expand Up @@ -344,8 +344,7 @@ func (l *Langruntimes) GetCompilationContainer(runtime, funcName string, install
command = "/app/compile-function.sh " + installVolume.MountPath
case strings.Contains(runtime, "ballerina"):
command = fmt.Sprintf(
"mkdir -p /kubeless/kubeless/ /kubeless/func/ && "+
"cp -r /ballerina/files/kubeless/*.bal /kubeless/kubeless/ && "+
"mkdir /kubeless/func/ && "+
"cp -r /kubeless/*.bal /kubeless/func/ && "+
"touch /kubeless/kubeless.toml && "+
"cp -r /ballerina/files/src/kubeless_run.tpl.bal /kubeless/ && "+
Expand Down

0 comments on commit 10477c7

Please sign in to comment.