This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
187 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM golang:1.13 | ||
|
||
# Prepare function environment | ||
COPY /compile-function.sh / | ||
|
||
# Install controller | ||
COPY server /server | ||
RUN chown 1000:1000 /server -R | ||
WORKDIR /server | ||
|
||
USER 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM golang:1.14 | ||
|
||
# Prepare function environment | ||
COPY /compile-function.sh / | ||
|
||
# Install controller | ||
COPY server /server | ||
RUN chown 1000:1000 /server -R | ||
WORKDIR /server | ||
|
||
USER 1000 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Golang runtime with go mod dependency management | ||
|
||
Implement go runtime using go mod for dependencies. | ||
|
||
## ☕ Usage | ||
|
||
When used, `go.mod` must declare the module kubeless. Example: | ||
|
||
``` | ||
module function | ||
go 1.14 | ||
require ( | ||
... | ||
) | ||
``` | ||
## Braking change notice | ||
|
||
This breaks compatibility with Go functions that use dep as package manager. | ||
|
||
To use legacy version, replace the config map with the definition in `golang_legacy.jsonnet` | ||
|
||
## TODO | ||
|
||
- [ ] Release official docker images and update `golang.jsonnet` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#!/bin/bash | ||
GO_VERSION="1.14" | ||
|
||
set -e | ||
|
||
# Copy function | ||
if [ ! -s "/kubeless/go.mod" ]; then | ||
rm /kubeless/go.mod | ||
fi | ||
cp /kubeless/* /server/function/ | ||
|
||
# Replace FUNCTION placeholder | ||
sed "s/<<FUNCTION>>/${KUBELESS_FUNC_NAME}/g" $GOPATH/src/controller/kubeless.tpl.go > $GOPATH/src/controller/kubeless.go | ||
# Remove vendored version of kubeless if exists | ||
rm -rf $GOPATH/src/kubeless/vendor/github.com/kubeless/kubeless | ||
sed "s/<<FUNCTION>>/${KUBELESS_FUNC_NAME}/g" /server/kubeless.go.tpl > /server/kubeless.go | ||
# Build command | ||
go build -o $KUBELESS_INSTALL_VOLUME/server $GOPATH/src/controller/kubeless.go > /dev/termination-log 2>&1 | ||
cd /server | ||
GOOS=linux GOARCH=amd64 go build -o $KUBELESS_INSTALL_VOLUME/server . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module function | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/sirupsen/logrus v1.6.0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.