Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless local target #850

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ install-serverless-latest-release: ## Install serverless from latest release
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-serverless-cr.yaml -n kyma-system
make -C ${OPERATOR_ROOT} check-serverless-installation

.PHONY: install-serverless-local-sources
install-serverless-local-sources: ## Install serverless from local sources
$(eval IMG_VERSION=local-$(shell date +'%Y%m%d-%H%M%S'))
IMG_VERSION=${IMG_VERSION} ./hack/build_all.sh

$(eval IMG=europe-docker.pkg.dev/kyma-project/dev/serverless-operator:${IMG_VERSION})
IMG_DIRECTORY="dev" IMG_VERSION=${IMG_VERSION} IMG=${IMG} make -C ${OPERATOR_ROOT} docker-build-local

k3d image import "${IMG}" -c kyma
IMG=${IMG} make install-serverless-custom-operator

.PHONY: remove-serverless
remove-serverless: ## Remove serverless-cr and serverless operator
make -C ${OPERATOR_ROOT} remove-serverless undeploy
Expand Down
15 changes: 15 additions & 0 deletions hack/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
HACK_DIR="./hack"

echo "New tag: $IMG_VERSION"
(cd "${HACK_DIR}" && pwd && docker compose build)

for i in $(yq '.services[].image' ${HACK_DIR}/docker-compose.yaml); do
IMAGE_NAME=$(echo "${i}" | cut -d ":" -f 1)
NEW_IMAGE_NAME="${IMAGE_NAME}:${IMG_VERSION}"
docker tag "${i}" "${NEW_IMAGE_NAME}"
set -x
k3d image import "${NEW_IMAGE_NAME}" -c kyma
set +x
done
39 changes: 39 additions & 0 deletions hack/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
services:
# serverless
function_controller:
image: europe-docker.pkg.dev/kyma-project/dev/function-controller:local
platform: "linux/amd64"
build:
context: ../
dockerfile: components/serverless/deploy/manager/Dockerfile
function_build_init:
image: europe-docker.pkg.dev/kyma-project/dev/function-build-init:local
platform: "linux/amd64"
build:
context: ../
dockerfile: components/serverless/deploy/jobinit/Dockerfile
# runtimes
function_runtime_nodejs18:
image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-nodejs18:local
platform: "linux/amd64"
build:
context: ../components/runtimes/nodejs
dockerfile: nodejs18/Dockerfile
function_runtime_nodejs20:
image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-nodejs20:local
platform: "linux/amd64"
build:
context: ../components/runtimes/nodejs
dockerfile: nodejs20/Dockerfile
function_runtime_python39:
image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-python39:local
platform: "linux/amd64"
build:
context: ../components/runtimes/python
dockerfile: python39/Dockerfile
function_runtime_python312:
image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-python312:local
platform: "linux/amd64"
build:
context: ../components/runtimes/python
dockerfile: python312/Dockerfile
Loading