Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 9bc24c8

Browse files
authored
Remove duplicated triggers code (#871)
* Update vendor. Subsitute glide with dep * Update scripts and CI config * Update manifests * Update code * Manifest fix * Fix log line search * Set proper parameter * Fix image name * Fix makefile * Change image in manifest * add containre name in kubectl logs -n kubeless -l kubeless=controller * Add docs * Remove unused manifests * More docs * Use latest images
1 parent 3d1c0cd commit 9bc24c8

File tree

11,155 files changed

+107772
-3923447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,155 files changed

+107772
-3923447
lines changed

.circleci/config.yml

+14-145
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ defaults: &defaults
99
working_directory: /home/circleci/.go_workspace/src/github.com/kubeless/kubeless
1010
environment:
1111
GOPATH: /home/circleci/.go_workspace
12-
CONTROLLER_IMAGE_NAME: bitnami/kubeless-controller-manager
12+
CONTROLLER_IMAGE_NAME: kubeless/function-controller
1313
BUILDER_IMAGE_NAME: kubeless/function-image-builder
14-
KAFKA_CONTROLLER_IMAGE_NAME: bitnami/kafka-trigger-controller
15-
NATS_CONTROLLER_IMAGE_NAME: bitnami/nats-trigger-controller
16-
KINESIS_CONTROLLER_IMAGE_NAME: bitnami/kinesis-trigger-controller
1714
CGO_ENABLED: "0"
1815
TEST_DEBUG: "1"
1916
GKE_VERSION: 1.9.7-gke.3
2017
MINIKUBE_VERSION: v0.25.2
21-
MANIFESTS: kubeless kubeless-non-rbac kubeless-openshift kafka-zookeeper kafka-zookeeper-openshift nats kinesis
18+
MANIFESTS: kubeless kubeless-non-rbac kubeless-openshift
2219
exports: &exports
2320
# It is not possible to resolve env vars in the environment section:
2421
# https://discuss.circleci.com/t/using-environment-variables-in-config-yml-not-working/14237
@@ -27,65 +24,13 @@ exports: &exports
2724
echo "export CONTROLLER_TAG=${CONTROLLER_TAG}" >> $BASH_ENV
2825
echo "export CONTROLLER_IMAGE=${CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
2926
echo "export FUNCTION_IMAGE_BUILDER=${BUILDER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
30-
echo "export KAFKA_CONTROLLER_IMAGE=${KAFKA_CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
31-
echo "export NATS_CONTROLLER_IMAGE=${NATS_CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
32-
echo "export KINESIS_CONTROLLER_IMAGE=${KINESIS_CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
3327
echo "export KUBECFG_JPATH=/home/circleci/src/github.com/kubeless/kubeless/ksonnet-lib" >> $BASH_ENV
3428
echo "export PATH=$(pwd)/bats/libexec:$PATH" >> $BASH_ENV
3529
restore_workspace: &restore_workspace
3630
run: |
3731
make bootstrap
3832
sudo cp -r /tmp/go/bin/* /usr/local/bin/
3933
cp -r /tmp/go/src/github.com/kubeless/kubeless/*yaml .
40-
should_test: &should_test
41-
run: |
42-
case $CIRCLE_JOB in
43-
# In case of GKE we will only want to build if it is
44-
# a build of a branch in the kubeless/kubeless repository
45-
GKE)
46-
echo $CIRCLE_PULL_REQUESTS
47-
if [[ -n "$GKE_ADMIN" && -z "$CIRCLE_PULL_REQUESTS" ]]; then
48-
export SHOULD_TEST=1
49-
fi
50-
;;
51-
# In kase of minikube+kafka we want to test it if
52-
# it is a Pull Request related to Kafka (discovered from the PR title)
53-
# or if the build is from the "master" branch
54-
minikube_kafka)
55-
if [[ -n "$CIRCLE_PULL_REQUESTS" ]]; then
56-
pr_kafka_title=$(curl -H "Authorization: token $ACCESS_TOKEN" "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/${CIRCLE_PR_NUMBER}" | grep title || true)
57-
fi
58-
if [[ -z "$CIRCLE_PULL_REQUESTS" || "$pr_kafka_title" == "" || "$pr_kafka_title" =~ ^.*(Kafka|kafka|KAFKA).*$ ]]; then
59-
export SHOULD_TEST=1
60-
fi
61-
;;
62-
# In kase of minikube+NATS we want to test it if
63-
# it is a Pull Request related to NATS (discovered from the PR title)
64-
# or if the build is from the "master" branch
65-
minikube_nats)
66-
if [[ -n "$CIRCLE_PULL_REQUESTS" ]]; then
67-
pr_nats_title=$(curl -H "Authorization: token $ACCESS_TOKEN" "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/${TRAVIS_PULL_REQUEST}" | grep title || true)
68-
fi
69-
if [[ -z "$CIRCLE_PULL_REQUESTS" || "$pr_nats_title" == "" || "$pr_nats_title" =~ ^.*(Nats|nats|NATS).*$ ]]; then
70-
export SHOULD_TEST=1
71-
fi
72-
;;
73-
# In kase of minikube+Kinesis we want to test it if
74-
# it is a Pull Request related to Kinesis (discovered from the PR title)
75-
# or if the build is from the "master" branch
76-
minikube_kinesis)
77-
if [[ -n "$CIRCLE_PULL_REQUESTS" ]]; then
78-
pr_kinesis_title=$(curl -H "Authorization: token $ACCESS_TOKEN" "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/${TRAVIS_PULL_REQUEST}" | grep title || true)
79-
fi
80-
if [[ -z "$CIRCLE_PULL_REQUESTS" || "$pr_kinesis_title" == "" || "$pr_kinesis_title" =~ ^.*(Kinesis|kinesis).*$ ]]; then
81-
export SHOULD_TEST=1
82-
fi
83-
;;
84-
esac
85-
echo "Should test? $SHOULD_TEST"
86-
if [[ "$SHOULD_TEST" != "1" ]]; then
87-
circleci step halt
88-
fi
8934
#### End of definitions
9035

9136
workflows:
@@ -102,26 +47,10 @@ workflows:
10247
<<: *build_allways
10348
requires:
10449
- build
105-
- minikube_core_triggers:
106-
<<: *build_allways
107-
requires:
108-
- build
10950
- minikube_build_functions:
11051
<<: *build_allways
11152
requires:
11253
- build
113-
- minikube_kafka:
114-
<<: *build_allways
115-
requires:
116-
- build
117-
- minikube_nats:
118-
<<: *build_allways
119-
requires:
120-
- build
121-
- minikube_kinesis:
122-
<<: *build_allways
123-
requires:
124-
- build
12554
- GKE:
12655
<<: *build_allways
12756
requires:
@@ -132,11 +61,7 @@ workflows:
13261
only: master
13362
requires:
13463
- minikube
135-
- minikube_core_triggers
13664
- minikube_build_functions
137-
- minikube_kafka
138-
- minikube_nats
139-
- minikube_kinesis
14065
- GKE
14166
- release:
14267
filters:
@@ -146,11 +71,7 @@ workflows:
14671
ignore: /.*/
14772
requires:
14873
- minikube
149-
- minikube_core_triggers
15074
- minikube_build_functions
151-
- minikube_kafka
152-
- minikube_nats
153-
- minikube_kinesis
15475
- GKE
15576
jobs:
15677
build:
@@ -190,7 +111,7 @@ jobs:
190111
at: /tmp/go
191112
- <<: *exports
192113
- <<: *restore_workspace
193-
- run: ./script/pull-or-build-image.sh controller-image
114+
- run: ./script/pull-or-build-image.sh function-controller
194115
- run: ./script/integration-tests minikube deployment
195116
- run: ./script/integration-tests minikube basic
196117
build-cross-binaries:
@@ -206,21 +127,6 @@ jobs:
206127
- run: make VERSION=${CIRCLE_TAG} binary-cross
207128
- store_artifacts:
208129
path: bundles
209-
minikube_core_triggers:
210-
<<: *defaults
211-
machine: true
212-
steps:
213-
- checkout
214-
- <<: *exports
215-
- attach_workspace:
216-
at: /tmp/go
217-
- <<: *restore_workspace
218-
- run: sudo apt-get update -y
219-
- run: sudo apt-get install -y apache2-utils
220-
- run: ./script/pull-or-build-image.sh controller-image
221-
- run: ./script/integration-tests minikube deployment
222-
- run: ./script/integration-tests minikube cronjob
223-
- run: ./script/integration-tests minikube http
224130
minikube_build_functions:
225131
<<: *defaults
226132
machine: true
@@ -230,7 +136,7 @@ jobs:
230136
- attach_workspace:
231137
at: /tmp/go
232138
- <<: *restore_workspace
233-
- run: ./script/pull-or-build-image.sh controller-image
139+
- run: ./script/pull-or-build-image.sh function-controller
234140
- run: ./script/pull-or-build-image.sh function-image-builder
235141
- run: "echo '{\"host\": \"unix:///var/run/docker.sock\", \"storage-driver\": \"overlay2\", \"insecure-registries\" : [\"0.0.0.0/0\"]}' > /tmp/daemon.json"
236142
- run: sudo mv /tmp/daemon.json /etc/docker/daemon.json
@@ -241,54 +147,20 @@ jobs:
241147
- run: "sed -i.bak 's/function-registry-tls-verify: \"true\"/function-registry-tls-verify: \"false\"/g' kubeless.yaml"
242148
- run: ./script/integration-tests minikube deployment
243149
- run: ./script/integration-tests minikube prebuilt_functions
244-
minikube_kafka:
245-
<<: *defaults
246-
machine: true
247-
steps:
248-
- <<: *should_test
249-
- checkout
250-
- <<: *exports
251-
- attach_workspace:
252-
at: /tmp/go
253-
- <<: *restore_workspace
254-
- run: ./script/pull-or-build-image.sh controller-image
255-
- run: ./script/pull-or-build-image.sh kafka-controller-image
256-
- run: ./script/integration-tests minikube deployment
257-
- run: ./script/integration-tests minikube kafka
258-
minikube_nats:
259-
<<: *defaults
260-
machine: true
261-
steps:
262-
- <<: *should_test
263-
- checkout
264-
- <<: *exports
265-
- attach_workspace:
266-
at: /tmp/go
267-
- <<: *restore_workspace
268-
- run: ./script/pull-or-build-image.sh controller-image
269-
- run: ./script/pull-or-build-image.sh nats-controller-image
270-
- run: ./script/integration-tests minikube deployment
271-
- run: ./script/integration-tests minikube nats
272-
minikube_kinesis:
273-
<<: *defaults
274-
machine: true
275-
steps:
276-
- <<: *should_test
277-
- checkout
278-
- <<: *exports
279-
- attach_workspace:
280-
at: /tmp/go
281-
- <<: *restore_workspace
282-
- run: ./script/pull-or-build-image.sh controller-image
283-
- run: ./script/pull-or-build-image.sh kinesis-controller-image
284-
- run: ./script/integration-tests minikube deployment
285-
- run: ./script/integration-tests minikube kinesis
286150
GKE:
287151
<<: *defaults
288152
docker:
289153
- image: circleci/golang:1.9
290154
steps:
291-
- <<: *should_test
155+
- run: |
156+
# In case of GKE we will only want to build if it is
157+
# a build of a branch in the kubeless/kubeless repository
158+
if [[ -n "$GKE_ADMIN" && -z "$CIRCLE_PULL_REQUESTS" ]]; then
159+
export SHOULD_TEST=1
160+
fi
161+
if [[ "$SHOULD_TEST" != "1" ]]; then
162+
circleci step halt
163+
fi
292164
- checkout
293165
- <<: *exports
294166
- attach_workspace:
@@ -298,7 +170,7 @@ jobs:
298170
- run: ./script/enable-gcloud.sh $(pwd) > /dev/null
299171
- run: echo "export ESCAPED_GKE_CLUSTER=$(echo ${GKE_CLUSTER}-ci-${CIRCLE_BRANCH:-$CIRCLE_TAG} | sed 's/[^a-z0-9-]//g')" >> $BASH_ENV
300172
- run: ./script/start-gke-env.sh $ESCAPED_GKE_CLUSTER $ZONE $GKE_VERSION $GKE_ADMIN > /dev/null
301-
- run: ./script/pull-or-build-image.sh controller-image
173+
- run: ./script/pull-or-build-image.sh function-controller
302174
- run: ./script/pull-or-build-image.sh kafka-controller-image
303175
- run: ./script/integration-tests gke_${GKE_PROJECT}_${ZONE}_${ESCAPED_GKE_CLUSTER} deployment
304176
- run: ./script/integration-tests gke_${GKE_PROJECT}_${ZONE}_${ESCAPED_GKE_CLUSTER} basic
@@ -316,9 +188,6 @@ jobs:
316188
images=(
317189
$CONTROLLER_IMAGE_NAME
318190
$BUILDER_IMAGE_NAME
319-
$KAFKA_CONTROLLER_IMAGE_NAME
320-
$NATS_CONTROLLER_IMAGE_NAME
321-
$KINESIS_CONTROLLER_IMAGE_NAME
322191
)
323192
for image in "${images[@]}"; do
324193
echo "Pulling ${image}:${CONTROLLER_TAG}"

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,8 @@ artifacts/
155155
# Kubeless specific
156156
bats/
157157
bundles/
158-
docker/controller-manager/kubeless-controller-manager
159-
docker/kafka-controller/kafka-controller
158+
docker/function-controller/kubeless-function-controller
160159
docker/function-image-builder/imbuilder
161-
docker/nats-controller/nats-controller
162-
docker/kinesis-controller/kinesis-controller
163160
ksonnet-lib/
164161
kubeless-openshift.yaml
165162
kubeless-non-rbac.yaml

0 commit comments

Comments
 (0)