Fix go env panic “plugin: not implemented” (#784)
This commit is contained in:
@@ -10,12 +10,12 @@ ADD server.go ${APP}
|
|||||||
|
|
||||||
WORKDIR ${APP}
|
WORKDIR ${APP}
|
||||||
RUN go get
|
RUN go get
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /server server.go
|
RUN go build -a -o /server server.go
|
||||||
|
|
||||||
FROM alpine:3.7
|
FROM ubuntu:18.04
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --from=builder /server /
|
COPY --from=builder /server /
|
||||||
RUN apk -U add ca-certificates
|
RUN apt update && apt install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENTRYPOINT ["/server"]
|
ENTRYPOINT ["/server"]
|
||||||
EXPOSE 8888
|
EXPOSE 8888
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ build_and_push_fetcher $FETCHER_IMAGE:$TAG
|
|||||||
|
|
||||||
build_and_push_builder $BUILDER_IMAGE:$TAG
|
build_and_push_builder $BUILDER_IMAGE:$TAG
|
||||||
|
|
||||||
ENV='python'
|
build_and_push_env_runtime python $REPO/python-env:$TAG
|
||||||
|
|
||||||
build_and_push_env_runtime $ENV $REPO/$ENV-env:$TAG
|
|
||||||
build_and_push_env_runtime jvm $REPO/jvm-env:$TAG
|
build_and_push_env_runtime jvm $REPO/jvm-env:$TAG
|
||||||
|
build_and_push_env_runtime go $REPO/go-env:$TAG
|
||||||
|
|
||||||
build_and_push_env_builder $ENV $REPO/$ENV-env-builder:$TAG $BUILDER_IMAGE:$TAG
|
build_and_push_env_builder python $REPO/python-env-builder:$TAG $BUILDER_IMAGE:$TAG
|
||||||
|
build_and_push_env_builder go $REPO/go-env-builder:$TAG $BUILDER_IMAGE:$TAG
|
||||||
|
|
||||||
build_and_push_fluentd $FLUENTD_IMAGE:$TAG
|
build_and_push_fluentd $FLUENTD_IMAGE:$TAG
|
||||||
|
|
||||||
|
|||||||
Executable
+63
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT=$(dirname $0)/../../..
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
fission fn delete --name hello-go-poolmgr || true
|
||||||
|
fission fn delete --name hello-go-nd || true
|
||||||
|
fission env delete --name go || true
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_builder() {
|
||||||
|
# wait for tiller ready
|
||||||
|
while true; do
|
||||||
|
kubectl --namespace fission-builder get pod -l envName=go|grep Running
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
test_fn() {
|
||||||
|
echo "Checking for valid response"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
response0=$(curl http://$FISSION_ROUTER/$1)
|
||||||
|
echo $response0 | grep -i $2
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
export -f wait_for_builder
|
||||||
|
export -f test_fn
|
||||||
|
|
||||||
|
cd $ROOT/examples/go
|
||||||
|
|
||||||
|
log "Creating environment for Golang"
|
||||||
|
fission env create --name go --image gcr.io/fission-ci/go-env:test --builder gcr.io/fission-ci/go-env-builder:test --period 5
|
||||||
|
|
||||||
|
timeout 90 bash -c "wait_for_builder"
|
||||||
|
|
||||||
|
log "Creating pool manager & new deployment function for Golang"
|
||||||
|
fission fn create --name hello-go-poolmgr --env go --src hello.go --entrypoint Handler
|
||||||
|
fission fn create --name hello-go-nd --env go --src hello.go --entrypoint Handler --executortype newdeploy
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
log "Creating route for new deployment function"
|
||||||
|
fission route create --function hello-go-poolmgr --url /hello-go-poolmgr --method GET
|
||||||
|
fission route create --function hello-go-nd --url /hello-go-nd --method GET
|
||||||
|
|
||||||
|
log "Waiting for router & pools to catch up"
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
log "Testing pool manager function"
|
||||||
|
timeout 60 bash -c "test_fn hello-go-poolmgr 'Hello'"
|
||||||
|
|
||||||
|
log "Testing new deployment function"
|
||||||
|
timeout 60 bash -c "test_fn hello-go-nd 'Hello'"
|
||||||
Reference in New Issue
Block a user