forked from knative-extensions/eventing-kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
3,588 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# This file is needed by kubebuilder but all functionality should exist inside | ||
# the hack/ files. | ||
|
||
CGO_ENABLED=0 | ||
GOOS=linux | ||
# Ignore errors if there are no images. | ||
CORE_IMAGES=$(shell find ./cmd -name main.go ! -path "./cmd/source/controller/*" ! -path "./cmd/channel/distributed/controller/*" ! -path "./cmd/channel/consolidated/controller/*" ! -path "./cmd/channel/consolidated/dispatcher/*" ! -path "./cmd/channel/distributed/dispatcher/*" | sed 's/main.go//') | ||
MIGRATE_IMAGE=./vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate/ | ||
TEST_IMAGES=$(shell find ./test/test_images ./vendor/knative.dev/eventing/test/test_images -mindepth 1 -maxdepth 1 -type d 2> /dev/null) | ||
KO_DOCKER_REPO=${DOCKER_REPO_OVERRIDE} | ||
BRANCH= | ||
TEST= | ||
IMAGE= | ||
|
||
# Guess location of openshift/release repo. NOTE: override this if it is not correct. | ||
OPENSHIFT=${CURDIR}/../../github.com/openshift/release | ||
|
||
# Build and install commands. | ||
install: | ||
for img in $(CORE_IMAGES); do \ | ||
go install $$img ; \ | ||
done | ||
#Build the controllers/dispatcher with a prefix to avoid problems | ||
go build -o $(GOPATH)/bin/source_controller ./cmd/source/controller/ | ||
go build -o $(GOPATH)/bin/consolidated_controller ./cmd/channel/consolidated/controller/ | ||
go build -o $(GOPATH)/bin/consolidated_dispatcher ./cmd/channel/consolidated/dispatcher/ | ||
go build -o $(GOPATH)/bin/distributed_controller ./cmd/channel/distributed/controller/ | ||
go build -o $(GOPATH)/bin/distributed_dispatcher ./cmd/channel/distributed/dispatcher/ | ||
go build -o $(GOPATH)/bin/migrate $(MIGRATE_IMAGE) | ||
.PHONY: install | ||
|
||
test-install: | ||
for img in $(TEST_IMAGES); do \ | ||
go install $$img ; \ | ||
done | ||
.PHONY: test-install | ||
|
||
test-e2e: | ||
sh openshift/e2e-tests.sh | ||
.PHONY: test-e2e | ||
|
||
# Requires ko 0.2.0 or newer. | ||
test-images: | ||
for img in $(TEST_IMAGES); do \ | ||
ko resolve --tags=latest -RBf $$img ; \ | ||
done | ||
.PHONY: test-images | ||
|
||
test-image-single: | ||
ko resolve --tags=latest -RBf test/test_images/$(IMAGE) | ||
.PHONY: test-image-single | ||
|
||
# Run make DOCKER_REPO_OVERRIDE=<your_repo> test-e2e-local if test images are available | ||
# in the given repository. Make sure you first build and push them there by running `make test-images`. | ||
# Run make BRANCH=<ci_promotion_name> test-e2e-local if test images from the latest CI | ||
# build for this branch should be used. Example: `make BRANCH=knative-v0.14.2 test-e2e-local`. | ||
# If neither DOCKER_REPO_OVERRIDE nor BRANCH are defined the tests will use test images | ||
# from the last nightly build. | ||
# If TEST is defined then only the single test will be run. | ||
test-e2e-local: | ||
./openshift/e2e-tests-local.sh $(TEST) | ||
.PHONY: test-e2e-local | ||
|
||
# Generate Dockerfiles used by ci-operator. The files need to be committed manually. | ||
generate-dockerfiles: | ||
rm -rf openshift/ci-operator/knative-images/* | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images $(CORE_IMAGES) | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images source_controller | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images distributed_controller | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images distributed_dispatcher | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images consolidated_controller | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images consolidated_dispatcher | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-images $(MIGRATE_IMAGE) | ||
|
||
rm -rf openshift/ci-operator/knative-test-images/* | ||
./openshift/ci-operator/generate-dockerfiles.sh openshift/ci-operator/knative-test-images $(TEST_IMAGES) | ||
.PHONY: generate-dockerfiles | ||
|
||
# Generate an aggregated knative release yaml file, as well as a CI file with replaced image references | ||
generate-release: | ||
./openshift/release/generate-release.sh $(RELEASE) | ||
.PHONY: generate-release | ||
|
||
# Update CI configuration in the $(OPENSHIFT) directory. | ||
# NOTE: Makes changes outside this repository. | ||
update-ci: | ||
sh ./openshift/ci-operator/update-ci.sh $(OPENSHIFT) $(CORE_IMAGES) | ||
.PHONY: update-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
# Initial set of approvers taken from eventing WG leads, Kafka approvers and original developers of the channel added | ||
# The OWNERS file is used by prow to automatically merge approved PRs. | ||
|
||
approvers: | ||
- technical-oversight-committee | ||
- knative-release-leads | ||
- eventing-writers | ||
- eventing-kafka-approvers | ||
- eventing-approvers | ||
|
||
reviewers: | ||
- eventing-writers | ||
- eventing-kafka-approvers | ||
|
||
- eventing-reviewers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD ${bin} /usr/bin/${bin} | ||
ENTRYPOINT ["/usr/bin/${bin}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Dockerfile to bootstrap build and test in openshift-ci | ||
|
||
FROM registry.ci.openshift.org/openshift/release:golang-1.16 | ||
|
||
# Add kubernetes repository | ||
ADD openshift/ci-operator/build-image/kubernetes.repo /etc/yum.repos.d/ | ||
|
||
RUN yum install -y kubectl ansible httpd-tools | ||
|
||
RUN GO111MODULE=on go get github.com/mikefarah/yq/v3 | ||
|
||
# Allow runtime users to add entries to /etc/passwd | ||
RUN chmod g+rw /etc/passwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[kubernetes] | ||
name=Kubernetes | ||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | ||
enabled=1 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
#!/bin/bash | ||
|
||
branch=${1-'knative-v0.19.1'} | ||
openshift=${2-'4.6'} | ||
promotion_disabled=${3-false} | ||
generate_continuous=true | ||
|
||
if [[ "$branch" == "knative-next" ]]; then | ||
promotion_name="knative-nightly" | ||
generate_continuous=false | ||
else | ||
promotion_name="$branch.0" | ||
fi | ||
|
||
core_images=$(find ./openshift/ci-operator/knative-images -mindepth 1 -maxdepth 1 -type d | LC_COLLATE=posix sort) | ||
test_images=$(find ./openshift/ci-operator/knative-test-images -mindepth 1 -maxdepth 1 -type d | LC_COLLATE=posix sort) | ||
function print_image_dependencies { | ||
for img in $core_images; do | ||
image_base=knative-eventing-kafka-$(basename $img) | ||
to_image=$(echo ${image_base//[_.]/-}) | ||
to_image=$(echo ${to_image//v0/upgrade-v0}) | ||
to_image=$(echo ${to_image//migrate/storage-version-migration}) | ||
to_image=$(echo ${to_image//kafka-kafka-/kafka-}) | ||
image_env=$(echo ${to_image//-/_}) | ||
image_env=$(echo ${image_env^^}) | ||
cat <<EOF | ||
- env: $image_env | ||
name: $to_image | ||
EOF | ||
done | ||
|
||
for img in $test_images; do | ||
image_base=knative-eventing-kafka-test-$(basename $img) | ||
to_image=$(echo ${image_base//_/-}) | ||
image_env=$(echo ${to_image//-/_}) | ||
image_env=$(echo ${image_env^^}) | ||
cat <<EOF | ||
- env: $image_env | ||
name: $to_image | ||
EOF | ||
done | ||
} | ||
|
||
image_deps=$(print_image_dependencies) | ||
|
||
cat <<EOF | ||
promotion: | ||
additional_images: | ||
knative-eventing-kafka-src: src | ||
disabled: $promotion_disabled | ||
cluster: https://api.ci.openshift.org | ||
namespace: openshift | ||
name: $promotion_name | ||
releases: | ||
initial: | ||
integration: | ||
name: "$openshift" | ||
namespace: ocp | ||
latest: | ||
integration: | ||
include_built_images: true | ||
name: "$openshift" | ||
namespace: ocp | ||
base_images: | ||
base: | ||
name: '$openshift' | ||
namespace: ocp | ||
tag: base | ||
build_root: | ||
project_image: | ||
dockerfile_path: openshift/ci-operator/build-image/Dockerfile | ||
canonical_go_repository: knative.dev/eventing-kafka | ||
binary_build_commands: make install | ||
test_binary_build_commands: make test-install | ||
tests: | ||
EOF | ||
if [[ "$openshift" != "4.7" ]]; then | ||
cat <<EOF | ||
- as: e2e-aws-ocp-${openshift//./} | ||
cluster_claim: | ||
architecture: amd64 | ||
cloud: aws | ||
owner: openshift-ci | ||
product: ocp | ||
timeout: 1h0m0s | ||
version: "$openshift" | ||
steps: | ||
test: | ||
- as: test | ||
cli: latest | ||
commands: make test-e2e | ||
dependencies: | ||
$image_deps | ||
from: src | ||
resources: | ||
requests: | ||
cpu: 100m | ||
timeout: 4h0m0s | ||
workflow: generic-claim | ||
EOF | ||
if [[ "$generate_continuous" == true ]]; then | ||
cat <<EOF | ||
- as: e2e-aws-ocp-${openshift//./}-continuous | ||
cluster_claim: | ||
architecture: amd64 | ||
cloud: aws | ||
owner: openshift-ci | ||
product: ocp | ||
timeout: 1h0m0s | ||
version: "4.8" | ||
cron: 0 */12 * * 1-5 | ||
steps: | ||
test: | ||
- as: test | ||
cli: latest | ||
commands: make test-e2e | ||
dependencies: | ||
$image_deps | ||
from: src | ||
resources: | ||
requests: | ||
cpu: 100m | ||
timeout: 4h0m0s | ||
workflow: generic-claim | ||
EOF | ||
fi | ||
else | ||
cat <<EOF | ||
- as: e2e-aws-ocp-${openshift//./} | ||
steps: | ||
cluster_profile: aws | ||
test: | ||
- as: test | ||
cli: latest | ||
commands: make test-e2e | ||
dependencies: | ||
$image_deps | ||
from: src | ||
resources: | ||
requests: | ||
cpu: 100m | ||
workflow: ipi-aws | ||
EOF | ||
if [[ "$generate_continuous" == true ]]; then | ||
cat <<EOF | ||
- as: e2e-aws-ocp-${openshift//./}-continuous | ||
cron: 0 */12 * * 1-5 | ||
steps: | ||
cluster_profile: aws | ||
test: | ||
- as: test | ||
cli: latest | ||
commands: make test-e2e | ||
dependencies: | ||
$image_deps | ||
from: src | ||
resources: | ||
requests: | ||
cpu: 100m | ||
workflow: ipi-aws | ||
EOF | ||
fi | ||
fi | ||
cat <<EOF | ||
resources: | ||
'*': | ||
limits: | ||
memory: 6Gi | ||
requests: | ||
cpu: 4 | ||
memory: 6Gi | ||
'bin': | ||
limits: | ||
memory: 6Gi | ||
requests: | ||
cpu: 4 | ||
memory: 6Gi | ||
images: | ||
EOF | ||
|
||
for img in $core_images; do | ||
image_base=$(basename $img) | ||
to_image=$(echo ${image_base//[_.]/-}) | ||
to_image=$(echo ${to_image//v0/upgrade-v0}) | ||
to_image=$(echo ${to_image//migrate/storage-version-migration}) | ||
to_image=$(echo ${to_image//kafka-kafka-/kafka-}) | ||
cat <<EOF | ||
- dockerfile_path: openshift/ci-operator/knative-images/$image_base/Dockerfile | ||
from: base | ||
inputs: | ||
bin: | ||
paths: | ||
- destination_dir: . | ||
source_path: /go/bin/$image_base | ||
to: knative-eventing-kafka-$to_image | ||
EOF | ||
done | ||
|
||
for img in $test_images; do | ||
image_base=$(basename $img) | ||
to_image=$(echo ${image_base//_/-}) | ||
cat <<EOF | ||
- dockerfile_path: openshift/ci-operator/knative-test-images/$image_base/Dockerfile | ||
from: base | ||
inputs: | ||
test-bin: | ||
paths: | ||
- destination_dir: . | ||
source_path: /go/bin/$image_base | ||
to: knative-eventing-kafka-test-$to_image | ||
EOF | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function generate_dockefiles() { | ||
local target_dir=$1; shift | ||
# Remove old images and re-generate, avoid stale images hanging around. | ||
for img in $@; do | ||
local image_base=$(basename $img) | ||
mkdir -p $target_dir/$image_base | ||
bin=$image_base envsubst < openshift/ci-operator/Dockerfile.in > $target_dir/$image_base/Dockerfile | ||
done | ||
} | ||
|
||
generate_dockefiles $@ |
5 changes: 5 additions & 0 deletions
5
openshift/ci-operator/knative-images/consolidated_controller/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD consolidated_controller /usr/bin/consolidated_controller | ||
ENTRYPOINT ["/usr/bin/consolidated_controller"] |
5 changes: 5 additions & 0 deletions
5
openshift/ci-operator/knative-images/consolidated_dispatcher/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD consolidated_dispatcher /usr/bin/consolidated_dispatcher | ||
ENTRYPOINT ["/usr/bin/consolidated_dispatcher"] |
5 changes: 5 additions & 0 deletions
5
openshift/ci-operator/knative-images/distributed_controller/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD distributed_controller /usr/bin/distributed_controller | ||
ENTRYPOINT ["/usr/bin/distributed_controller"] |
5 changes: 5 additions & 0 deletions
5
openshift/ci-operator/knative-images/distributed_dispatcher/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD distributed_dispatcher /usr/bin/distributed_dispatcher | ||
ENTRYPOINT ["/usr/bin/distributed_dispatcher"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD migrate /usr/bin/migrate | ||
ENTRYPOINT ["/usr/bin/migrate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Do not edit! This file was generate via Makefile | ||
FROM openshift/origin-base | ||
|
||
ADD mtcontroller /usr/bin/mtcontroller | ||
ENTRYPOINT ["/usr/bin/mtcontroller"] |
Oops, something went wrong.