Skip to content

Commit

Permalink
[ADD] ingress services, health_check for each service.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyrathoree committed Mar 13, 2020
1 parent 28006e5 commit 95da190
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 6 deletions.
8 changes: 8 additions & 0 deletions services/manager/api_manager/views/health_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response


@api_view(["GET"])
def health_check(request):
return Response(status=status.HTTP_200_OK)
18 changes: 13 additions & 5 deletions services/manager/deployment/ingress-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ spec:
paths:
- path: /manager/*
backend:
serviceName: manager
serviceName: "manager"
servicePort: 8000
# - path: /model_execution/*
# backend:
# serviceName: model-execution
# servicePort: 8200
- path: /session_manager/*
backend:
serviceName: "session-manager"
servicePort: 8100
- path: /weather_data_retrieval/*
backend:
serviceName: "weather-data-retrieval"
servicePort: 8200
- path: /model_execution/*
backend:
serviceName: "model-execution"
servicePort: 8300
2 changes: 2 additions & 0 deletions services/manager/manager/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from api_manager.views.session_create import start_session_pipeline
from api_manager.views.session_get import get_all_sessions, get_session
from api_manager.views.session_status import get_session_status, update_session_status
from api_manager.views.health_check import health_check

urlpatterns = [
path("admin/", admin.site.urls),
Expand All @@ -36,4 +37,5 @@
url(r"^session/(?P<session_id>\w+)/history", get_retrieved_data),
url(r"^session/(?P<session_id>\w+)/forecast", get_forecast_data),
url(r"^session/(?P<session_id>\w+)/summary", get_processed_data),
url(r"^ht", health_check),
]
8 changes: 8 additions & 0 deletions services/model_execution/ml_model/views/health_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response


@api_view(["GET"])
def health_check(request):
return Response(status=status.HTTP_200_OK)
8 changes: 7 additions & 1 deletion services/model_execution/model_execution/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path

from ml_model.views.forecast import forecast_weather
from ml_model.views.health_check import health_check

urlpatterns = [path("admin/", admin.site.urls), path("dark/forecast", forecast_weather)]
urlpatterns = [
path("admin/", admin.site.urls),
path("dark/forecast", forecast_weather),
url(r"^ht", health_check),
]
8 changes: 8 additions & 0 deletions services/session_manager/manager/views/health_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response


@api_view(["GET"])
def health_check(request):
return Response(status=status.HTTP_200_OK)
3 changes: 3 additions & 0 deletions services/session_manager/session_manager/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path

from manager.views.firestore_delete import delete_session
from manager.views.firestore_save import save_session
from manager.views.firestore_update import update_session
from manager.views.health_check import health_check

urlpatterns = [
path("admin/", admin.site.urls),
path(r"session/save", save_session),
path(r"session/update", update_session),
path(r"session/delete", delete_session),
url(r"^ht", health_check),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response


@api_view(["GET"])
def health_check(request):
return Response(status=status.HTTP_200_OK)
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path

from data_retrieval.views.data_retrieve import retrieve_historical_data
from data_retrieval.views.health_check import health_check

urlpatterns = [
path("admin/", admin.site.urls),
path("dark/history", retrieve_historical_data),
url(r"^ht", health_check),
]

0 comments on commit 95da190

Please sign in to comment.