Skip to content

Commit

Permalink
(apache#5489) Migrate groovy => yaml for ./e2e/yaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed Jun 11, 2024
1 parent 489f42e commit f54839d
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/actions/kamel-install-yaks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ description: 'Install YAKS artifacts'
inputs:
version:
description: "The YAKS version"
default: 0.19.1
default: 0.19.2
required: false
image-name:
description: "The YAKS operator image name"
Expand Down
2 changes: 1 addition & 1 deletion e2e/knative/files/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo -n "Checking yq ... "
if which yq > /dev/null 2>&1; then
echo "ok"
else
echo "not installed. (see https://mikefarah.gitbook.io/yq)"
echo "not found. (see https://mikefarah.gitbook.io/yq)"
exit 1
fi

Expand Down
22 changes: 0 additions & 22 deletions e2e/yaks/common/apache-kamelet-catalog/logger.groovy

This file was deleted.

24 changes: 24 additions & 0 deletions e2e/yaks/common/apache-kamelet-catalog/logger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# camel-k: language=yaml
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# timer-source is defined in the default Camel Kamelets catalog

- from:
uri: "kamelet:timer-source?message=Camel+K"
steps:
- log: "${body}"
6 changes: 5 additions & 1 deletion e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# YAKS_NAMESPACE=default yaks run -v ./e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml

config:
namespace:
temporary: true
pre:
- name: installation
run: |
kamel run logger.groovy -w -n $YAKS_NAMESPACE
kamel run logger.yaml -w -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
23 changes: 0 additions & 23 deletions e2e/yaks/common/kamelet-binding-http/display.groovy

This file was deleted.

25 changes: 25 additions & 0 deletions e2e/yaks/common/kamelet-binding-http/display.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# camel-k: language=yaml
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

- from:
uri: "knative:endpoint/display"
steps:
- log: "${body}"
- setBody:
simple: "${header.CamelCloudEventType}"
- log: "type: ${body}"
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: timer-source-binding-display
spec:
Expand Down
8 changes: 6 additions & 2 deletions e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# YAKS_NAMESPACE=default yaks run -v ./e2e/yaks/common/kamelet-binding-http/yaks-config.yaml

config:
namespace:
temporary: true
Expand All @@ -23,9 +27,9 @@ pre:
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kamel run display.groovy -w -n $YAKS_NAMESPACE
kamel run display.yaml -w -n $YAKS_NAMESPACE
cat timer-source-binding-display.yaml | sed 's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
kubectl wait kameletbinding timer-source-binding-display --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
kubectl wait pipe timer-source-binding-display --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
23 changes: 0 additions & 23 deletions e2e/yaks/common/kamelet/source-sink.groovy

This file was deleted.

26 changes: 26 additions & 0 deletions e2e/yaks/common/kamelet/source-sink.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# camel-k: language=yaml
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# timer-source is defined in the default Camel Kamelets catalog

- from:
uri: "kamelet:timer-source?message=Camel+K"
steps:
- to: "kamelet:echo-sink"
- to: "kamelet:echo-sink?prefix=nice+"
- log: "${body}"
6 changes: 5 additions & 1 deletion e2e/yaks/common/kamelet/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# YAKS_NAMESPACE=default yaks run -v ./e2e/yaks/common/kamelet/yaks-config.yaml

config:
namespace:
temporary: true
Expand All @@ -23,7 +27,7 @@ pre:
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f echo-sink.kamelet.yaml -n $YAKS_NAMESPACE
kamel run source-sink.groovy -w -n $YAKS_NAMESPACE
kamel run source-sink.yaml -w -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
19 changes: 0 additions & 19 deletions e2e/yaks/common/knative-sinkbinding/receiver.groovy

This file was deleted.

22 changes: 22 additions & 0 deletions e2e/yaks/common/knative-sinkbinding/receiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# camel-k: language=yaml
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

- from:
uri: "knative:channel/messages"
steps:
- log: "Received: ${body}"
6 changes: 5 additions & 1 deletion e2e/yaks/common/knative-sinkbinding/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# YAKS_NAMESPACE=default yaks run -v ./e2e/yaks/common/knative-sinkbinding/yaks-config.yaml

config:
namespace:
temporary: true
Expand All @@ -23,7 +27,7 @@ pre:
run: |
kubectl apply -n $YAKS_NAMESPACE -f messages-channel.yaml
kamel run receiver.groovy -w -n $YAKS_NAMESPACE
kamel run receiver.yaml -w -n $YAKS_NAMESPACE
kamel run source.yaml -w -n $YAKS_NAMESPACE -t knative.sink-binding=true
kubectl wait integration --all --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
Expand Down
60 changes: 60 additions & 0 deletions e2e/yaks/files/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

####
#
# This script takes care of Yaks setup
# https://github.com/citrusframework/yaks
#
####

YAKS_VERSION=0.19.2
YAKS_IMAGE=docker.io/citrusframework/yaks

set -e

# Get the os/arch
ARCH=$(uname -m)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')

echo -n "Checking yaks ... "
if which yaks > /dev/null 2>&1; then
echo "ok"
else
echo "not found."
YAKS_BUNDLE="linux-64bit"
if [[ $OS == "darwin" && $ARCH == "arm64" ]]; then
YAKS_BUNDLE="mac-arm64bit"
fi
YAKS_DOWNLOAD_URL="https://github.com/citrusframework/yaks/releases/download/v${YAKS_VERSION}/yaks-${YAKS_VERSION}-${YAKS_BUNDLE}.tar.gz"
echo "Downloading ${YAKS_DOWNLOAD_URL}" && curl -f -L ${YAKS_DOWNLOAD_URL} -o yaks.tar.gz
echo "Extracting yaks.tar.gz" && tar -zxf yaks.tar.gz

# Install the binary using the install command
TARGET_DIR="/usr/local/bin"
echo "Installing yaks-${YAKS_VERSION} to ${TARGET_DIR}"
sudo install -m 0755 yaks ${TARGET_DIR}
fi

echo "Installing the Yaks operator-image ${YAKS_IMAGE}:${YAKS_VERSION}"
yaks install --operator-image ${YAKS_IMAGE}:${YAKS_VERSION}

echo "Waiting for Yaks readiness ..."
kubectl wait --for=condition=available --timeout=300s deployment/yaks-operator
kubectl wait --for condition=Ready --timeout=300s pod -l app=yaks

0 comments on commit f54839d

Please sign in to comment.