Skip to content

Commit

Permalink
Merge branch 'master' into feature/enable-documentDB
Browse files Browse the repository at this point in the history
Signed-off-by: Stanchev Aleksandar <[email protected]>
  • Loading branch information
alstanchev committed Jul 17, 2023
2 parents b98c76e + e714aec commit 176355e
Show file tree
Hide file tree
Showing 757 changed files with 32,087 additions and 5,192 deletions.
20 changes: 20 additions & 0 deletions .github/ct.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0

# consider helm install to be failed after 10 minutes
helm-extra-args: --timeout 10m
check-version-increment: true
debug: true
chart-dirs:
- deployment/helm
chart-repos:
- stable=https://charts.helm.sh/stable
- bitnami=https://charts.bitnami.com/bitnami
37 changes: 37 additions & 0 deletions .github/kubeval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0

#
# use kubeval to validate helm generated kubernetes manifest
#

set -o errexit
set -o pipefail

CHART_DIR=deployment/helm/ditto
KUBEVAL_VERSION="v0.16.1"
SCHEMA_LOCATION="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/"

# install kubeval
curl --silent --show-error --fail --location --output /tmp/kubeval.tar.gz https://github.com/instrumenta/kubeval/releases/download/"${KUBEVAL_VERSION}"/kubeval-linux-amd64.tar.gz
sudo tar -C /usr/local/bin -xf /tmp/kubeval.tar.gz kubeval

# add helm repos to resolve dependencies
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami

# validate chart
echo "helm dependency build..."
helm dependency build "${CHART_DIR}"

echo "kubeval(idating) ${CHART_DIR} chart..."
helm template "${CHART_DIR}" | kubeval --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}"
16 changes: 15 additions & 1 deletion .github/workflows/docker-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

jobs:
build:
if: github.repository == 'eclipse-ditto/ditto'
runs-on: ubuntu-latest
steps:
-
Expand Down Expand Up @@ -129,7 +130,20 @@ jobs:
tags: |
eclipse/ditto-connectivity:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-ui
name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
-
name: Install npm dependencies
run: npm install
working-directory: ./ui
-
name: Build UI with node
run: npm run build
working-directory: ./ui
-
name: Build and push ditto-ui image
uses: docker/build-push-action@v3
with:
context: ./ui
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm dependencies
run: npm install
working-directory: ./ui
- name: Build UI with node
run: npm run build
working-directory: ./ui
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
name: Release and publish Helm chart

env:
VERSION_HELM: "v3.11.2"
on:
workflow_dispatch:
inputs:
chartVersion:
description: 'Helm chart version'
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.VERSION_HELM }}

- name: Helm | Login
shell: bash
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | helm registry login -u eclipsedittobot --password-stdin registry-1.docker.io

- name: Helm | Package
shell: bash
run: helm package deployment/helm/ditto --dependency-update --version ${{ inputs.chartVersion }}

- name: Helm | Push
shell: bash
run: helm push ditto-${{ inputs.chartVersion }}.tgz oci://registry-1.docker.io/eclipse

- name: Helm | Logout
shell: bash
run: helm registry logout registry-1.docker.io

- name: Helm | Output
id: output
shell: bash
run: echo "image=registry-1.docker.io/eclipse/ditto:${{ inputs.chartVersion }}" >> $GITHUB_OUTPUT
129 changes: 129 additions & 0 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
name: Lint and test Helm chart

env:
CONFIG_OPTION_CHART_TESTING: "--config .github/ct.yml"
VERSION_CHART_TESTING: "v3.8.0"
VERSION_HELM: "v3.11.2"
VERSION_PYTHON: "3.9"
on:
pull_request:
paths:
- 'deployment/helm/**'
- '.github/workflows/helm-chart.yml'
- '.github/ct.yml'
- '.github/kubeval.sh'

jobs:
lint-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.VERSION_HELM }}
- uses: actions/setup-python@v4
with:
python-version: ${{ env.VERSION_PYTHON }}
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: ${{ env.VERSION_CHART_TESTING }}
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }}

kubeval-chart:
runs-on: ubuntu-latest
needs: lint-chart
strategy:
matrix:
# the versions supported by kubeval are the ones for
# which a folder exists at
# https://github.com/yannh/kubernetes-json-schema/
k8s:
- v1.25.2
- v1.26.4
- v1.27.1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch history for chart testing
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.VERSION_HELM }}
- name: Run kubeval
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
run: .github/kubeval.sh

install-chart:
name: install-chart
runs-on: ubuntu-latest
needs:
- lint-chart
- kubeval-chart
strategy:
matrix:
# the versions supported by chart-testing are the tags
# available for the docker.io/kindest/node image
# https://hub.docker.com/r/kindest/node/tags
k8s:
- v1.25.2
- v1.26.4
- v1.27.1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch history for chart testing
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.VERSION_HELM }}
- uses: actions/setup-python@v4
with:
python-version: ${{ env.VERSION_PYTHON }}
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: ${{ env.VERSION_CHART_TESTING }}
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create kind ${{ matrix.k8s }} cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
with:
node_image: kindest/node:${{ matrix.k8s }}
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }}
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Ensure license year for added files is the file's creation year
shell: bash
run: |
included_file_endings=".*\.(java|xml|yml)"
included_file_endings=".*\.(java|xml|yml|yaml)"
current_year=$(date +'%Y')
missing_counter=0
for file in ${{ steps.the-files.outputs.added }}; do
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ on:

# Run build for any PR
pull_request:
paths-ignore:
- 'README.md'
- 'RELEASE.md'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'deployment/**'
- 'documentation/**'

jobs:
build:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/push-dockerhub-on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ jobs:
eclipse/ditto-connectivity:${{ env.IMAGE_MINOR_TAG }}
eclipse/ditto-connectivity:${{ env.IMAGE_MAJOR_TAG }}
eclipse/ditto-connectivity:latest
-
name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
-
name: Install npm dependencies
run: npm install
working-directory: ./ui
-
name: Build UI with node
run: npm run build
working-directory: ./ui
-
name: Build and push ditto-ui
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG && inputs.dittoImage == 'ditto-ui'
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/push-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ jobs:
eclipse/ditto-connectivity:${{ env.IMAGE_MINOR_TAG }}
eclipse/ditto-connectivity:${{ env.IMAGE_MAJOR_TAG }}
eclipse/ditto-connectivity:latest
-
name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
-
name: Install npm dependencies
run: npm install
working-directory: ./ui
-
name: Build UI with node
run: npm run build
working-directory: ./ui
-
name: Build and push ditto-ui
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ deployment/helm/eclipse-ditto/requirements.lock
deployment/helm/eclipse-ditto/charts/*
.factorypath
ui/node_modules
ui/package.json
ui/package-lock.json
ui/dist

22 changes: 3 additions & 19 deletions .run/ConnectivityService.run.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
<!--
~ Copyright (c) 2022 Contributors to the Eclipse Foundation
~
~ See the NOTICE file(s) distributed with this work for additional
~ information regarding copyright ownership.
~
~ This program and the accompanying materials are made available under the
~ terms of the Eclipse Public License 2.0 which is available at
~ http://www.eclipse.org/legal/epl-2.0
~
~ SPDX-License-Identifier: EPL-2.0
-->
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ConnectivityService" type="Application" factoryName="Application" folderName="Ditto" nameIsGenerated="true">
<envs>
<env name="LOG_LEVEL_APPLICATION" value="INFO" />
<env name="CLEANUP_HISTORY_RETENTION_DURATION" value="6d" />
<env name="CONNECTION_EVENT_HISTORICAL_HEADERS_TO_PERSIST.0" value="ditto-originator" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.eclipse.ditto.connectivity.service.ConnectivityService" />
<module name="ditto-connectivity-service" />
<option name="VM_PARAMETERS" value="-Xms512m -Xmx512m --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.eclipse.ditto.services.connectivity.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
Loading

0 comments on commit 176355e

Please sign in to comment.