Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
wistefan committed Jan 10, 2024
0 parents commit 0b51516
Show file tree
Hide file tree
Showing 39 changed files with 1,044 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
push:

jobs:
it:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk

- name: Execute tests
id: test
run: |
cd it
mvn clean test integration-test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
access-node
7 changes: 7 additions & 0 deletions it/charts/accessnode/blockchain-connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: blockchain-connector
description: blockchain-connector Helm-Chart

type: application
version: 0.1.0
appVersion: "1.1.0"
45 changes: 45 additions & 0 deletions it/charts/accessnode/blockchain-connector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "blockchain-connector.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "blockchain-connector.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "blockchain-connector.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Common labels
*/}}
{{- define "blockchain-connector.labels" -}}
app.kubernetes.io/name: {{ include "blockchain-connector.name" . }}
helm.sh/chart: {{ include "blockchain-connector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "blockchain-connector.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{ include "blockchain-connector.labels" . | nindent 4 }}
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: {{ include "blockchain-connector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
{{ include "blockchain-connector.labels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
env:
- name: SPRING_LOGGING_LEVEL_ROOT
value: {{ .Values.deployment.logLevel }}
- name: SPRING_R2DBC_PASSWORD
value: {{ .Values.db.password }}
- name: SPRING_R2DBC_USERNAME
value: {{ .Values.db.username }}
- name: SPRING_FLYWAY_USERNAME
value: {{ .Values.db.username }}
- name: SPRING_FLYWAY_PASSWORD
value: {{ .Values.db.password }}
- name: SPRING_R2DBC_URL
value: "r2dbc:postgresql://{{ .Values.db.host }}:5432/mktdb"
- name: SPRING_FLYWAY_URL
value: "jdbc:postgresql://{{ .Values.db.host }}:5432/mktdb"
- name: DLT_ADAPTER_DOMAIN
value: {{ .Values.deployment.dltAdapter.domain }}
- name: BLOCKCHAIN_RPC_ADDRESS
value: {{ .Values.deployment.blockchain.rpcAddress }}
- name: BLOCKCHAIN_USER_ETHEREUM_ADDRESS
value: {{ .Values.deployment.blockchain.userEthereumAddress }}
- name: BLOCKCHAIN_SUBSCRIPTION_ACTIVE
value: {{ .Values.deployment.blockchain.subscription.active | quote }}
- name: BROKER_EXTERNAL_DOMAIN
value: {{ .Values.deployment.broker.externalDomain }}
- name: BROKER_INTERNAL_DOMAIN
value: {{ .Values.deployment.broker.internalDomain }}
- name: NGSI_SUBSCRIPTION_NOTIFICATION_ENDPOINT
value: {{ .Values.deployment.ngsiSubscription.notificationEndpoint }}
- name: NGSI_SUBSCRIPTION_ENTITY_TYPES
value: {{ .Values.deployment.ngsiSubscription.entityTypes }}
- name: BROKER_ADAPTER_DOMAIN
value: {{ .Values.deployment.brokerAdapter.domain }}
- name: BROKER_ADAPTER_PATHS_SUBSCRIPTIONS
value: {{ .Values.deployment.brokerAdapter.paths.subscriptions }}
- name: BROKER_ADAPTER_PATHS_ENTITIES
value: {{ .Values.deployment.brokerAdapter.paths.entities }}
- name: OPERATOR_ORGANIZATION_ID
value: {{ .Values.deployment.operator.organizationId }}
ports:
- containerPort: {{ .Values.service.port}}
name: http
protocol: TCP
18 changes: 18 additions & 0 deletions it/charts/accessnode/blockchain-connector/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "blockchain-connector.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{ include "blockchain-connector.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
# same as scorpio, makes other config easier
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "blockchain-connector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
38 changes: 38 additions & 0 deletions it/charts/accessnode/blockchain-connector/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
deployment:
image:
repository: in2kizuna/blockchain-connector
# -- tag of the image to be used
tag: v2.0.1
# -- specification of the image pull policy
pullPolicy: IfNotPresent
logLevel: DEBUG
dltAdapter:
domain: http://dlt-adapter:8080
blockchain:
rpcAddress: http://blockchain-testnode.testnode.svc.cluster.local:8545/
userEthereumAddress: 0x40ec977Bd68917E8ffd7A4F3a439ab77149B86e5
subscription:
active: false
broker:
externalDomain: http://scorpio:9090
internalDomain: http://scorpio:9090
ngsiSubscription:
notificationEndpoint: http://blockchain-connector:8080/notifications/broker
entityTypes: catalog,individual,organization,product,product-offering,category,service-specification,product-offering-price,resource-specification,product-specification
brokerAdapter:
domain: http://broker-adapter:8080
paths:
entites: /api/v2/entities
subscriptions: /api/v2/subscriptions
operator:
organizationId: FIWARE_TEST_PROVIDER
db:
host: postgresql-connector
password: postgres
username: postgres

service:
port: 9090
type: ClusterIP

fullnameOverride: blockchain-connector
7 changes: 7 additions & 0 deletions it/charts/accessnode/broker-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: broker-adapter
description: broker-adapter Helm-Chart

type: application
version: 0.1.0
appVersion: "1.1.0"
45 changes: 45 additions & 0 deletions it/charts/accessnode/broker-adapter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "broker-adapter.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "broker-adapter.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "broker-adapter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Common labels
*/}}
{{- define "broker-adapter.labels" -}}
app.kubernetes.io/name: {{ include "broker-adapter.name" . }}
helm.sh/chart: {{ include "broker-adapter.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
40 changes: 40 additions & 0 deletions it/charts/accessnode/broker-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "broker-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{ include "broker-adapter.labels" . | nindent 4 }}
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: {{ include "broker-adapter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
{{ include "broker-adapter.labels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
env:
- name: BROKER_EXTERNAL_DOMAIN
value: {{ .Values.deployment.broker.externalDomain }}
- name: BROKER_INTERNAL_DOMAIN
value: {{ .Values.deployment.broker.internalDomain }}
- name: BROKER_PATHS_ENTITIES
value: /ngsi-ld/v1/entities
- name: BROKER_PATHS_SUBSCRIPTIONS
value: /ngsi-ld/v1/subscriptions
ports:
- containerPort: {{ .Values.service.port}}
name: http
protocol: TCP
18 changes: 18 additions & 0 deletions it/charts/accessnode/broker-adapter/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "broker-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{ include "broker-adapter.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
# same as scorpio, makes other config easier
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "broker-adapter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
17 changes: 17 additions & 0 deletions it/charts/accessnode/broker-adapter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
deployment:
image:
repository: in2kizuna/broker-adapter
# -- tag of the image to be used
tag: v2.0.0
# -- specification of the image pull policy
pullPolicy: IfNotPresent
logLevel: DEBUG
broker:
externalDomain: http://scorpio:9090
internalDomain: http://scorpio:9090

service:
port: 8080
type: ClusterIP

fullnameOverride: broker-adapter
7 changes: 7 additions & 0 deletions it/charts/accessnode/dlt-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: dlt-adapter
description: dlt-adapter Helm-Chart

type: application
version: 0.1.0
appVersion: "1.2"
Loading

0 comments on commit 0b51516

Please sign in to comment.