Skip to content

Commit

Permalink
update for production fully
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed Apr 5, 2024
1 parent e6cf950 commit e406f0f
Show file tree
Hide file tree
Showing 36 changed files with 157 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Backend/Account/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/Account/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"HostAddress": "amqp://localhost:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "https"
}
3 changes: 2 additions & 1 deletion Backend/Account/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"HostAddress": "amqp://rabbitmq-service:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "http"
}
2 changes: 1 addition & 1 deletion Backend/RecommendationAlgo/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/RecommendationAlgo/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"HostAddress": "amqp://localhost:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "https"
}
3 changes: 2 additions & 1 deletion Backend/RecommendationAlgo/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"HostAddress": "amqp://rabbitmq-service:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "http"
}
2 changes: 1 addition & 1 deletion Backend/Render/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/Render/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"HostAddress": "amqp://localhost:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "https"
}
3 changes: 2 additions & 1 deletion Backend/Render/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"HostAddress": "amqp://rabbitmq-service:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "http"
}
2 changes: 1 addition & 1 deletion Backend/Upload/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/Upload/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"consulUri": "http://localhost:8500",
"POD_IP": "localhost",
"servicePort": "5008",
"serviceName": "OpenVisStreamer.Upload"
"serviceName": "OpenVisStreamer.Upload",
"httpScheme": "https"
}
3 changes: 2 additions & 1 deletion Backend/Upload/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"consulUri": "http://consul-service:8500",
"POD_IP": "localhost",
"servicePort": "8081",
"serviceName": "OpenVisStreamer.Upload"
"serviceName": "OpenVisStreamer.Upload",
"httpScheme": "http"
}
2 changes: 1 addition & 1 deletion Backend/VideoLibrary/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/VideoLibrary/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"HostAddress": "amqp://127.0.0.1:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "https"
}
8 changes: 4 additions & 4 deletions Backend/VideoLibrary/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
}
},
"ConnectionStrings": {
"DefaultConnection": "server=videolib-db-service;uid=admin;pwd=1234;database=VideolibDB;"
"DefaultConnection": "server=videolib-db-service;uid=admin;pwd=1234;database=videolibdb;"
},
"AllowedHosts": "*",
"consulUri": "http://consul-service:8500",
"POD_IP": "localhost",
"servicePort": "8081",
"serviceName": "OpenVisStreamer.VideoLibrary",

"RabbitMQ":{
"RabbitMQ": {
"HostAddress": "amqp://rabbitmq-service:5672",
"UserName": "guest",
"Password": "guest"
}
},
"httpScheme": "http"
}
2 changes: 1 addition & 1 deletion Backend/VideoStreamer/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"{configuration.GetValue<string>("httpScheme")}://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
3 changes: 2 additions & 1 deletion Backend/VideoStreamer/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"POD_IP": "localhost",
"servicePort": "5009",
"serviceName": "OpenVisStreamer.Streamer",
"PVstorageBucketPath": "D:\\PRJ\\OpenVidStreamer\\DEVstorageBucket"
"PVstorageBucketPath": "D:\\PRJ\\OpenVidStreamer\\DEVstorageBucket",
"httpScheme": "https"
}
3 changes: 2 additions & 1 deletion Backend/VideoStreamer/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"POD_IP": "localhost",
"servicePort": "8081",
"serviceName": "OpenVisStreamer.Streamer",
"PVstorageBucketPath": "/app/data"
"PVstorageBucketPath": "/app/data",
"httpScheme": "http"
}
11 changes: 8 additions & 3 deletions Frontend/openvidstreamer-fe/src/Pages/Upload/UploadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import axios from 'axios';
import './VideoUploadForm.css';
import {VideoCategory, VideoCategoryNames, VideoUploadDTO} from "../../Model/VideoUploadDTO.ts";
import {Label} from "flowbite-react"; // Assuming your CSS is in this file
import {Label} from "flowbite-react";
import {ApiServerBaseUrl} from "../../../configProvider.ts";
import {useStoreState} from "../../../persistenceProvider.ts"; // Assuming your CSS is in this file

const UploadPage = () => {
const [videoMetadata, setVideoMetadata] = useState<VideoUploadDTO>({
Expand All @@ -15,6 +17,8 @@ const UploadPage = () => {
const [thumbnailFile, setThumbnailFile] = useState(null);
const [uploadPercentage, setUploadPercentage] = useState(0);

const authToken = useStoreState('authToken');

const handleInputChange = (e) => {
setVideoMetadata({
...videoMetadata,
Expand All @@ -40,9 +44,10 @@ const UploadPage = () => {
formData.append('thumbnailFile', thumbnailFile);

try {
await axios.post('https://localhost:5008/upload', formData, {
await axios.post(ApiServerBaseUrl()+ '/upload/upload', formData, {
headers: {
'Content-Type': 'multipart/form-data'
'Content-Type': 'multipart/form-data',
"Authorization": "Bearer " + authToken
},
onUploadProgress: progressEvent => {
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
Expand Down
8 changes: 8 additions & 0 deletions OpenVidStreamerKubernetesFiles/accountDB-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ spec:
value: "12345"
ports:
- containerPort: 3306
volumeMounts:
- name: account-db-storage
mountPath: /var/lib/mysql
volumes:
- name: account-db-storage
persistentVolumeClaim:
claimName: account-db-pvc

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: account-db-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
2 changes: 1 addition & 1 deletion OpenVidStreamerKubernetesFiles/apigateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ spec:
spec:
containers:
- name: apigateway
image: <your-apigateway-image>:latest
image: openvidstreamer/apigateway:latest
ports:
- containerPort: 8081
4 changes: 2 additions & 2 deletions OpenVidStreamerKubernetesFiles/apigateway-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
app: apigateway
ports:
- protocol: TCP
port: 8081
targetPort: 8081
port: 8000
targetPort: 8000
15 changes: 4 additions & 11 deletions OpenVidStreamerKubernetesFiles/consul-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ spec:
app: consul
spec:
containers:
- name: consul
image: openvidstreamer/consul:latest
ports:
- containerPort: 8500
volumeMounts:
- name: consul-config
mountPath: /consul/config
volumes:
- name: consul-config
configMap:
name: consul-configmap
- name: consul
image: consul:1.15.4
ports:
- containerPort: 8500
2 changes: 2 additions & 0 deletions OpenVidStreamerKubernetesFiles/consul-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: Service
metadata:
name: consul-service
spec:
type: NodePort
ports:
- port: 8500
targetPort: 8500
nodePort: 32000
selector:
app: consul
35 changes: 0 additions & 35 deletions OpenVidStreamerKubernetesFiles/nfs-deployment.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions OpenVidStreamerKubernetesFiles/nfs-persistent-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: ""
15 changes: 15 additions & 0 deletions OpenVidStreamerKubernetesFiles/nfs-persistent-volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: ""
nfs:
path: "/exports"
server: 10.0.0.3
14 changes: 0 additions & 14 deletions OpenVidStreamerKubernetesFiles/nfs-service.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions OpenVidStreamerKubernetesFiles/render-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ spec:
fieldPath: status.podIP
- name: servicePort
value: "8081"
volumeMounts:
- mountPath: "/app/data"
name: nfs-storage
volumes:
- name: nfs-storage
persistentVolumeClaim:
claimName: nfs-pvc


8 changes: 8 additions & 0 deletions OpenVidStreamerKubernetesFiles/statisticsDB-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ spec:
value: "12345"
ports:
- containerPort: 3306
volumeMounts:
- name: statistics-db-storage
mountPath: /var/lib/mysql
volumes:
- name: statistics-db-storage
persistentVolumeClaim:
claimName: statistics-db-pvc

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: statistics-db-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 15Gi
12 changes: 11 additions & 1 deletion OpenVidStreamerKubernetesFiles/upload-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ spec:
fieldPath: status.podIP
- name: servicePort
value: "8081"

- name: NFS_SERVER
value: nfs-service
- name: NFS_PATH
value: "/exports"
volumeMounts:
- mountPath: "/app/data"
name: nfs-storage
volumes:
- name: nfs-storage
persistentVolumeClaim:
claimName: nfs-pvc
Loading

0 comments on commit e406f0f

Please sign in to comment.