blob: e6fc57a3f2fe670f9ebd6031fddaec0959d8d585 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
version: "3"
#dotenv: [.env]
vars:
EXPERIMENTAL_COMMON_VER: common1.18.4{{.SUFFIX}}
EXPERIMENTAL_COMMON: "{{.BASEIMG}}/openserverless-runtime-common:{{.EXPERIMENTAL_COMMON_VER}}"
EXPERIMENTAL_RUNTIMES: "python"
tasks:
debug-experimental:
desc: debug a runtime
requires: { vars: [RT, VER] }
dir: "runtime/experimental/{{.RT}}/{{.VER}}"
cmds:
- >
{{.DRY}} docker run -p 8080:8080 -ti
--entrypoint=/bin/bash -v $PWD:/mnt
-e OW_COMPILER=/mnt/bin/compile
"{{.BASEIMG}}/openserverless-runtime-{{.RT}}:{{.VER}}-{{.TAG}}"
build-experimental-runtime:
requires: { vars: [RT, VER] }
dir: "runtime/experimental/{{.RT}}/{{.VER}}"
cmds:
- |
RUNTIME="{{.BASEIMG}}/openserverless-runtime-{{.RT}}:{{.VER}}-{{.TAG}}"
PLATFORMS=$(cat platforms.txt)
if test -n "{{.PUSH}}"
then
{{.DRY}} docker buildx build -t "$RUNTIME" --build-arg COMMON="{{.EXPERIMENTAL_COMMON}}" --platform "$PLATFORMS" . --push
else {{.DRY}} docker buildx build -t "$RUNTIME" --build-arg COMMON="{{.EXPERIMENTAL_COMMON}}" . --load
fi
echo "Built $RUNTIME on platforms $PLATFORMS"
build-experimental-lang:
desc: build images for experimental runtimes
requires: { vars: [RT] }
vars:
DIRS:
sh: ls -d runtime/experimental/{{.RT}}/v* || echo ""
cmds:
- for: { var: DIRS }
task: build-experimental-runtime
vars:
VER: "{{base .ITEM}}"
build-experimental-runtimes:
silent: true
requires: { vars: [TAG, EXPERIMENTAL_RUNTIMES] }
vars:
RT_REGEX:
sh: echo "{{.EXPERIMENTAL_RUNTIMES}}" | tr ',' '|'
SPECIFIC_RT:
sh: echo "{{.TAG}}" | grep -E -o '({{.RT_REGEX}})' || echo ''
cmds:
- |
if [ -z "{{.SPECIFIC_RT}}" ];
then
echo "==> BUILDING RUNTIMES {{.EXPERIMENTAL_RUNTIMES}}"
for ITEM in `echo {{.EXPERIMENTAL_RUNTIMES}} | tr ',' ' '`; do
echo "==> BUILDING $ITEM:{{.TAG}}"
task x:build-experimental-lang RT=$ITEM TAG="{{.TAG}}" PUSH="{{.PUSH}}" DRY={{.DRY}}
done
else echo "Build {{.SPECIFIC_RT}}"
task x:build-experimental-lang RT={{.SPECIFIC_RT}} TAG="{{.TAG}}" PUSH="{{.PUSH}}" DRY={{.DRY}}
fi
debug-experimental-proxied-runtime:
desc: debug a runtime proxied
requires: { vars: [RT, VER] }
cmds:
- >
{{.DRY}} docker run -p 8081:8080 -e OW_ACTIVATE_PROXY_SERVER=1 -ti
--entrypoint=/mnt/proxy-experimental -v $PWD:/mnt
"{{.BASEIMG}}/openserverless-runtime-{{.RT}}:{{.VER}}-{{.TAG}}" -debug
debug-experimental-proxy:
desc: debug a runtime proxy
requires: { vars: [RT, VER] }
cmds:
- export GOOS=linux; go build -o proxy-experimental
- task: debug-experimental-proxied-runtime
# deprecated - use task tag
experimental-tag:
silent: true
cmds:
- echo "deprecated - use task tag with RT=experimental"
#- git tag -d $(git tag)
#- git tag -f experimental-$(date +%y%m%d%H%M)
#- env PAGER= git tag