Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Convert tenant service to Quarkus #4862

Closed
wants to merge 18 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 3 additions & 13 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@ set -e

echo "${VERSION}"

echo "Make"
make

echo "Build"
make docker_build

if [[ -v PUSH_REGISTRY ]]
then
echo "Logging in to registry"
docker login -u "${REGISTRY_USER}" -p "${REGISTRY_PASS}" "${DOCKER_REGISTRY}"
make TAG="${VERSION}" docker_tag docker_push
make buildpush
else
make IMAGE_PULL_POLICY=IfNotPresent buildpushkind
fi

echo "Push to registry"
make -j 4 docker_tag docker_push

echo "Generate templates"
make templates
4 changes: 2 additions & 2 deletions .github/scripts/olm_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export TEMPLATES=${PWD}/templates/build/enmasse-${TAG}

export OCP4_EXTERNAL_IMAGE_REGISTRY=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' image-registry):5000

echo "Running OLM tests"
time make TESTCASE=olm.** PROFILE=olm-pr systemtests
echo "OLM TESTS DISABLED"
#time make TESTCASE=olm.** PROFILE=olm-pr systemtests
2 changes: 1 addition & 1 deletion .github/scripts/publish_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

DOCVERSION=master
if [ "${RELEASE}" == "true" ]; then
DOCVERSION=${VERSION}
DOCVERSION=${TAG}
fi

echo "Publishing docs for version ${DOCVERSION}"
Expand Down
26 changes: 26 additions & 0 deletions .github/scripts/setup_kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.1/kind-$(uname)-amd64"
chmod +x ./kind

cat <<EOF | ./kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--enable-ssl-passthrough"}]'
2 changes: 1 addition & 1 deletion .github/scripts/smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ TAG=${TAG:-latest}
export TEMPLATES=${PWD}/templates/build/enmasse-${TAG}

echo "Running smoke tests"
time make PROFILE=smoke systemtests
time make PROFILE=systemtests systemtests
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* #4730: Enhance brokered address space's address controller (agent) to populate address plan status
* #4753: Resizing broker volumes broken on OpenShift 4
* #4823: Update snakeyaml/hibernate validation dependencies to latest micro releases.
* #4825: Bump Jackson 2.10.0 -> 2.10.4

## 0.31.4
* #4704: [OpenShift 3.11] Console returns 500 internal error when configured with custom certificate
Expand Down
3 changes: 1 addition & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ This document describes the development guidelines when writing and maintaining
## General considerations

As EnMasse is a polyglot project with multiple languages in the same repo, it uses `make` as a
single entry point for invoking a full project build. Make will invoke the language-specific build
single entry point for invoking a full project build. Make will invoke the language-specific build
system.
systems.

### Introducing new dependencies

Expand Down
54 changes: 0 additions & 54 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ The EnMasse java and node modules are built using maven. All docker images are b
To run EnMasse you need a Kubernetes cluster. Most EnMasse developers use [OKD](https://www.okd.io/)
for running tests on their machine.

## Checking out for Go

If you want to work with the Go parts of this repository, you will need to perform the
following steps.

### Create a Go workspace

Create a new directory and set the `GOPATH` environment variable:

export GOPATH=/home/user/my-enmasse-gobase
mkdir -p $GOPATH/src/github.com/enmasseproject

### Clone the git repository into this workspace

cd $GOPATH/src/github.com/enmasseproject
git clone https://github.com/enmasseproject/enmasse

## Building

### Pre-installation
Expand Down Expand Up @@ -85,20 +68,6 @@ external registries.
kubectl config set-context $(kubectl config current-context) --namespace=enmasse-infra

kubectl apply -f templates/build/enmasse-latest/install/bundles/enmasse
kubectl apply -f templates/build/enmasse-latest/install/components/example-plans
kubectl apply -f templates/build/enmasse-latest/install/components/example-authservices

#### Deploying to an OKD instance assuming already logged in with cluster-admin permissions

oc new-project enmasse-infra || oc project enmasse-infra
oc apply -f templates/build/enmasse-latest/install/bundles/enmasse
oc apply -f templates/build/enmasse-latest/install/components/example-plans
oc apply -f templates/build/enmasse-latest/install/components/example-authservices


#### Running smoketests against a deployed instance

make PROFILE=smoke systemtests

### Running full systemtest suite

Expand Down Expand Up @@ -176,17 +145,6 @@ Use this command to change environment variables values for the deployment

Where $CMD is `oc` or `kubectl` command depends of the environment.

The following deployment names are available depending on their types and EnMasse configuration:

* `address-space-controller`
* `admin`
* `keycloak-controller`
* `standard-controller`
* `service-broker`
* `topic-forwarder`
* `mqtt-gateway`
* `mqtt-lwt`

For forwarding port from the remote pod to the local host invoke following command (it will lock terminal) and then
connect with development tool to the forwarded port on localhost

Expand Down Expand Up @@ -232,18 +190,6 @@ container.
value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
```

#### NodeJS components

If you have a NodeJS component running in a pod that you wish to debug, temporarily edit the deployment and add the
NodeJS debug option `--inspect` to a `_NODE_OPTIONS` environment variable to the container. By default, NodeJS
will listen on port 9229.

```yaml
- env:
- name: _NODE_OPTIONS
value: --inspect
```

#### Port Forwarding

On OpenShift, you can then issue a `oc port-forward <pod> <LOCAL_PORT>:<REMOTE_PORT>` command to conveniently route
Expand Down
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ GO_DIRS = \
broker-plugin

DOCKER_DIRS = \
agent \
topic-forwarder \
address-space-controller \
none-authservice \
standard-controller \
keycloak-plugin \
mqtt-gateway \
mqtt-lwt \
service-broker \
console/console-init \
olm-manifest \
iot/iot-tenant-service \
Expand Down Expand Up @@ -96,13 +87,13 @@ coverage_go:
buildpush:
$(MAKE)
$(MAKE) docker_build
$(MAKE) docker_tag
$(MAKE) docker_push
$(MAKE) -j 4 docker_tag
$(MAKE) -j 4 docker_push

buildpushkind:
$(MAKE)
$(MAKE) docker_build
$(MAKE) docker_tag
$(MAKE) -j 4 docker_tag
$(MAKE) kind_load_image

clean_java:
Expand Down Expand Up @@ -175,7 +166,7 @@ manifests:
@echo "Skipping generating manifests from source"
else
manifests: controller-gen
$(CONTROLLER_GEN) crd paths=./pkg/apis/enmasse/v1beta2 output:dir=./templates/shared-infra
$(CONTROLLER_GEN) crd paths=./pkg/apis/enmasse/v1beta2 output:dir=./templates/crds
endif

#endregion
Expand Down
8 changes: 8 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ ifeq ($(MAVEN_BATCH),true)
MAVEN_ARGS+=-B
endif

ifneq (, $(shell which podman))
QUARKUS_CONTAINER_RUNTIME=podman
else ifneq (, $(shell which docker))
QUARKUS_CONTAINER_RUNTIME=docker
else
$(error "No container runtime found for native Quarkus build. You need either 'podman' or 'docker')
endif

all: init build test package

init:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.java.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
endif

package_java:
$(IMAGE_ENV) IMAGE_ENV="$(IMAGE_ENV)" mvn package -DskipTests $(MAVEN_ARGS)
$(IMAGE_ENV) IMAGE_ENV="$(IMAGE_ENV)" mvn package -DskipTests $(MAVEN_ARGS) $(MAVEN_PACKAGE_ARGS)

package: package_java
endif
Expand Down
12 changes: 3 additions & 9 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,11 @@ make PROFILE=${PROFILE} TESTCASE="**.SmokeTest" systemtests
```

Where $PROFILE can be:

* systemtests
* soak
* iot
* shared
* isolated
* shared-iot
* isolated-iot
* smoke
* smoke-iot
* acceptance
* upgrade
* olm
* soak

## Running upgrade test

Expand Down
12 changes: 0 additions & 12 deletions address-space-controller/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions address-space-controller/Makefile

This file was deleted.

7 changes: 0 additions & 7 deletions address-space-controller/README.md

This file was deleted.

Loading