Skip to content

Implement MEC015 and MEC016 APIs #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
  •  
  •  
  •  
91 changes: 90 additions & 1 deletion .meepctl-repocfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ repo:
- meep-loc-serv
- meep-metrics-engine
- meep-mg-manager
- meep-rnis
- meep-rnis
- meep-dai
- meep-tm
- meep-wais
- meep-ams
- meep-sandbox-ctrl
Expand Down Expand Up @@ -377,6 +379,8 @@ repo:
meep-metrics-engine: charts/meep-metrics-engine
meep-mg-manager: charts/meep-mg-manager
meep-rnis: charts/meep-rnis
meep-dai: charts/meep-dai
meep-tm: charts/meep-tm
meep-wais: charts/meep-wais
meep-ams: charts/meep-ams
meep-sandbox-ctrl: charts/meep-sandbox-ctrl
Expand All @@ -391,6 +395,8 @@ repo:
- meep-metrics-engine
- meep-mg-manager
- meep-rnis
- meep-dai
- meep-tm
- meep-wais
- meep-ams
- meep-sandbox-ctrl
Expand Down Expand Up @@ -741,6 +747,40 @@ repo:
codecov: false
# supports linting
lint: true
meep-tm:
# location of source code
src: go-apps/meep-tm
# location of binary
bin: bin/meep-tm
# location of deployment chart
chart: charts/meep-tm
# user supplied value file located @ .meep/user/values (use below file name)
chart-user-values: meep-tm.yaml
# extra build flags
build-flags:
- -mod=vendor
# enable meepctl build
build: true
# enable meepctl dockerize
dockerize: true
# enable meepctl deploy/delete
deploy: true
# supports code coverage measurement when built in codecov mode
codecov: true
# supports linting
lint: true
# location of API specifications
api:
- name: 'AdvantEDGE MEC Bandwidth Management REST API'
file: go-apps/meep-tm/api/bwm/swagger.yaml
- name: 'AdvantEDGE MEC Multi-access Traffic Steering REST API'
file: go-apps/meep-tm/api/mts/swagger.yaml
# location of user supplied API specifications
user-api:
# resources available to docker container image
docker-data:
# location of entry script
'entrypoint.sh': go-apps/meep-tm/entrypoint.sh
meep-wais:
# location of source code
src: go-apps/meep-wais
Expand Down Expand Up @@ -805,6 +845,40 @@ repo:
docker-data:
# location of entry script
'entrypoint.sh': go-apps/meep-vis/entrypoint.sh
meep-dai:
# location of source code
src: go-apps/meep-dai
# location of binary
bin: bin/meep-dai
# location of deployment chart
chart: charts/meep-dai
# user supplied value file located @ .meep/user/values (use below file name)
chart-user-values: meep-dai.yaml
# extra build flags
build-flags:
- -mod=vendor
# enable meepctl build
build: true
# enable meepctl dockerize
dockerize: true
# enable meepctl deploy/delete
deploy: true
# supports code coverage measurement when built in codecov mode
codecov: true
# supports onboarded device application instantiation
onboardedapp: true
# supports linting
lint: true
# location of API specifications
api:
- name: 'AdvantEDGE Device Application Interface Service REST API'
file: go-apps/meep-dai/api/swagger.yaml
# location of user supplied API specifications
user-api:
# resources available to docker container image
docker-data:
# location of entry script
'entrypoint.sh': go-apps/meep-dai/entrypoint.sh

#------------------------------
# Dependencies
Expand Down Expand Up @@ -975,6 +1049,11 @@ repo:
src: go-packages/meep-applications
# supports linting
lint: true
meep-bwm-client:
# location of source code
src: go-packages/meep-bwm-client
# supports linting
lint: false
meep-couch:
# location of source code
src: go-packages/meep-couch
Expand Down Expand Up @@ -1055,6 +1134,11 @@ repo:
src: go-packages/meep-model
# supports linting
lint: true
meep-mts-client:
# location of source code
src: go-packages/meep-mts-client
# supports linting
lint: false
meep-mq:
# location of source code
src: go-packages/meep-mq
Expand Down Expand Up @@ -1145,6 +1229,11 @@ repo:
src: go-packages/meep-websocket
# supports linting
lint: true
meep-dai-client:
# location of source code
src: go-packages/meep-dai-client
# supports linting
lint: false

# Javascript Packages
js-packages:
Expand Down
21 changes: 21 additions & 0 deletions charts/meep-dai/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
5 changes: 5 additions & 0 deletions charts/meep-dai/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0.0"
description: MEEP Device Application Interface Service Helm chart for Kubernetes
name: meep-dai
version: 1.0.0
32 changes: 32 additions & 0 deletions charts/meep-dai/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "meep-dai.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 "meep-dai.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 "meep-dai.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
13 changes: 13 additions & 0 deletions charts/meep-dai/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "{{ .Release.Namespace }}:{{ template "meep-dai.fullname" . }}"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: {{ template "meep-dai.fullname" . }}
namespace: {{ .Release.Namespace }}

35 changes: 35 additions & 0 deletions charts/meep-dai/templates/codecov-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if .Values.codecov.enabled}}
kind: PersistentVolume
apiVersion: v1
metadata:
name: meep-dai-codecov-pv
spec:
storageClassName: meep-dai-codecov-sc
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: {{ .Values.codecov.location }}

---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: meep-dai-codecov-sc
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: meep-dai-codecov-pvc
spec:
storageClassName: meep-dai-codecov-sc
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
{{- end}}
80 changes: 80 additions & 0 deletions charts/meep-dai/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "meep-dai.fullname" . }}
labels:
app: {{ template "meep-dai.name" . }}
chart: {{ template "meep-dai.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
meepOrigin: {{ .Values.meepOrigin }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
app: {{ template "meep-dai.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "meep-dai.name" . }}
release: {{ .Release.Name }}
meepOrigin: {{ .Values.meepOrigin }}
spec:
serviceAccountName: {{ .Values.serviceAccount }}
volumes:
- name: onboardedapp-storage
persistentVolumeClaim:
claimName: meep-dai-onboardedapp-pvc
{{- if .Values.codecov.enabled}}
- name: codecov-storage
persistentVolumeClaim:
claimName: meep-dai-codecov-pvc
{{- end}}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- if .Values.codecov.enabled}}
command: [ "/meep-dai" ]
args: [ "-test.coverprofile=/codecov/codecov-meep-dai.out", "__DEVEL--code-cov" ]
{{- end}}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.deployment.port }}
protocol: {{ .Values.deployment.protocol }}
- containerPort: 31120
protocol: TCP
- containerPort: 31121
protocol: TCP
- containerPort: 31122
protocol: TCP
- containerPort: 31123
protocol: TCP
- containerPort: 31124
protocol: TCP
env:
{{- range $key, $value := .Values.image.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
volumeMounts:
- name: onboardedapp-storage
mountPath: /onboardedapp-vol
{{- if .Values.codecov.enabled}}
- name: codecov-storage
mountPath: /codecov
{{- end}}
terminationGracePeriodSeconds: 5
initContainers:
{{- range $value := .Values.deployment.dependencies.system }}
- name: init-system-{{ $value }}
image: busybox:1.28
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nslookup {{ $value }}.kube-system ; do echo waiting for {{ $value }}; sleep 0.25; done;']
{{- end}}
{{- range $value := .Values.deployment.dependencies.namespace }}
- name: init-{{ $value }}
image: busybox:1.28
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nslookup {{ $value }} ; do echo waiting for {{ $value }}; sleep 0.25; done;']
{{- end}}
38 changes: 38 additions & 0 deletions charts/meep-dai/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Values.service.name -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $serviceName }}
labels:
app: {{ template "meep-dai.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range .Values.ingress.hosts }}
- http:
paths:
{{- range $path := .paths }}
- path: {{ $path.path }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $path.port }}
{{- end -}}
{{- if .name }}
host: {{ .name }}
{{- end }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
Loading