-
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.
feat(bridge): created a rest server service to abstract the raw data …
…retrival refactor: usage of standardized urn to identify raw resources. aligned router and writer
- Loading branch information
Showing
25 changed files
with
775 additions
and
77 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,58 @@ | ||
name: CI/CD odh-v2-core-writer | ||
|
||
on: | ||
push: | ||
paths: | ||
- "infrastructure/raw-data-bridge/**" | ||
- "infrastructure/helm/raw-data-bridge/**" | ||
- ".github/workflows/odh-v2-core-writer.yaml" | ||
workflow_dispatch: | ||
|
||
env: | ||
WORKING_DIRECTORY: infrastructure/raw-data-bridge | ||
KUBERNETES_NAMESPACE: core | ||
KUBERNETES_VALUE_PATH: infrastructure/helm/raw-data-bridge/values.yaml | ||
KUBERNETES_CHART_PATH: infrastructure/helm/raw-data-bridge/raw-data-bridge | ||
PROJECT_NAME: raw-data-bridge | ||
|
||
jobs: | ||
build: | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod' | ||
runs-on: ubuntu-22.04 | ||
concurrency: odh-v2-core-writer-build | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Manually build and push image | ||
run: cd ${{ env.WORKING_DIRECTORY }} && ./build.sh | ||
|
||
deploy: | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod' | ||
needs: | ||
- build | ||
runs-on: ubuntu-22.04 | ||
concurrency: odh-v2-core-writer-build-deploy | ||
environment: ${{ github.ref == 'refs/heads/main' && 'test' || github.ref == 'refs/heads/prod' && 'prod' || 'unknown' }} | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Deploy on cluster | ||
uses: noi-techpark/github-actions/helm-deploy@v2 | ||
with: | ||
k8s-name: ${{ env.PROJECT_NAME }} | ||
k8s-namespace: ${{ env.KUBERNETES_NAMESPACE }} | ||
chart-path: ${{ env.KUBERNETES_CHART_PATH }} | ||
values-file: ${{ env.KUBERNETES_VALUE_PATH }} | ||
aws-access-key-id: ${{ secrets[vars.AWS_KEY_ID] }} | ||
aws-secret-access-key: ${{ secrets[vars.AWS_KEY_SECRET] }} | ||
aws-eks-cluster-name: aws-main-eu-01 | ||
aws-region: eu-west-1 |
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
23 changes: 23 additions & 0 deletions
23
infrastructure/helm/raw-data-bridge/raw-data-bridge/.helmignore
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
6 changes: 6 additions & 0 deletions
6
infrastructure/helm/raw-data-bridge/raw-data-bridge/Chart.yaml
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,6 @@ | ||
apiVersion: v2 | ||
name: raw-data-bridge | ||
description: Resource Lookup service | ||
type: application | ||
version: 1.0.0 | ||
appVersion: "1.0.0" |
51 changes: 51 additions & 0 deletions
51
infrastructure/helm/raw-data-bridge/raw-data-bridge/templates/_helpers.tpl
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,51 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "raw-data-bridge.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 "raw-data-bridge.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 "raw-data-bridge.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "raw-data-bridge.labels" -}} | ||
helm.sh/chart: {{ include "raw-data-bridge.chart" . }} | ||
{{ include "raw-data-bridge.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "raw-data-bridge.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "raw-data-bridge.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
63 changes: 63 additions & 0 deletions
63
infrastructure/helm/raw-data-bridge/raw-data-bridge/templates/deployment.yaml
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,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "raw-data-bridge.fullname" . }} | ||
labels: | ||
{{- include "raw-data-bridge.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "raw-data-bridge.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "raw-data-bridge.labels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.env }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.service.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: http | ||
initialDelaySeconds: {{ .Values.health.delay }} | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: http | ||
initialDelaySeconds: {{ .Values.health.delay }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
15 changes: 15 additions & 0 deletions
15
infrastructure/helm/raw-data-bridge/raw-data-bridge/templates/service.yaml
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 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "raw-data-bridge.fullname" . }} | ||
labels: | ||
{{- include "raw-data-bridge.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "raw-data-bridge.selectorLabels" . | nindent 4 }} |
32 changes: 32 additions & 0 deletions
32
infrastructure/helm/raw-data-bridge/raw-data-bridge/values.yaml
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,32 @@ | ||
# Default values for raw-data-bridge. | ||
replicaCount: 1 | ||
|
||
image: | ||
repository: ghcr.io/noi-techpark/infrastructure-v2/raw-data-bridge | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "latest" | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
service: | ||
port: 2000 | ||
type: ClusterIP | ||
|
||
health: | ||
delay: 30 | ||
|
||
env: | ||
- name: APP_MONGO_URI | ||
value: mongodb://user:password@mongodb | ||
- name: APP_LOGLEVEL | ||
value: INFO | ||
|
||
podAnnotations: {} | ||
podLabels: {} | ||
resources: {} | ||
nodeSelector: {} | ||
tolerations: [] | ||
affinity: {} |
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,18 @@ | ||
image: | ||
repository: ghcr.io/noi-techpark/infrastructure-v2/raw-data-bridge | ||
pullPolicy: Always | ||
tag: "v1.0" | ||
|
||
env: | ||
- name: APP_MONGO_URI | ||
value: mongodb://mongodb-headless:27017/ | ||
- name: APP_LOGLEVEL | ||
value: INFO | ||
|
||
# resources: | ||
# limits: | ||
# cpu: 250m # 250m is equivalent to 0.25 CPU core | ||
# memory: 500Mi | ||
# requests: | ||
# cpu: 100m # 100m is equivalent to 0.1 CPU core | ||
# memory: 100Mi |
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,3 @@ | ||
APP_MONGO_URI=mongodb://mongodb | ||
|
||
APP_LOGLEVEL=DEBUG |
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
4 changes: 2 additions & 2 deletions
4
infrastructure/raw-writer/build.sh → infrastructure/raw-data-bridge/build.sh
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
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
Oops, something went wrong.