Skip to content
Snippets Groups Projects
Commit 4914e772 authored by Panagiotis Karamolegkos's avatar Panagiotis Karamolegkos :v_tone2:
Browse files

Merge branch 'ip' into 'main'

Added Apache 2 Information on Files

See merge request !7
parents e8e7ee86 60ba209c
No related branches found
No related tags found
1 merge request!7Added Apache 2 Information on Files
Pipeline #56128 passed
Showing
with 216 additions and 141 deletions
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
stages:
- build
......
<!--
~ Copyright (c) 2024 University of Piraeus Research Centre
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ SPDX-License-Identifier: Apache-2.0
~
~ Contributors:
~ Panagiotis Karamolegkos (UPRC) - Author
-->
# Prerequisites
- A Kubernetes Cluster
......
# Author: Panagiotis Karamolegkos (UPRC)
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
# chmod -R 777 apply_yamls.sh
# ./apply_yamls.sh
......@@ -38,4 +56,4 @@ sleep 180 # Wait for Image to Download and Start
kubectl apply -f ./rl_model/rl-role.yaml
kubectl apply -f ./rl_model/rl-role-binding.yaml
kubectl apply -f ./rl_model/rl-model-deployment.yaml
sleep 300 # Wait for Image to Download and Start
\ No newline at end of file
sleep 300 # Wait for Image to Download and Start
# ONLY HERE AS AN EXAMPLE
# Author: Panagiotis Karamolegkos (UPRC)
apiVersion: v1
kind: Pod
metadata:
name: context-awareness-pod
spec:
containers:
- name: pdlc-ca
image: docker.io/hecodeco/pdlc-ca:v0.0.0 # Needs to be changed
volumeMounts:
- name: shared-volume
mountPath: /data
readOnly: true
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: shared-pvc-ro
# Author: Panagiotis Karamolegkos (UPRC)
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: apps/v1
kind: Deployment
......@@ -28,3 +45,4 @@ spec:
- name: shared-volume
persistentVolumeClaim:
claimName: shared-pvc-ro
# ONLY HERE AS AN EXAMPLE
# Author: Panagiotis Karamolegkos (UPRC)
apiVersion: v1
kind: Pod
metadata:
name: data-preprocessing-pod
spec:
containers:
- name: writer
image: docker.io/sonem/pdlc-writer:v0.0.2 # Needs to be changed
volumeMounts:
- name: shared-volume
mountPath: /data
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: shared-pvc-rw
\ No newline at end of file
# Author: Panagiotis Karamolegkos (UPRC)
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: apps/v1
kind: Deployment
......@@ -47,3 +64,4 @@ spec:
persistentVolumeClaim:
claimName: shared-pvc-rw
# Author: Panagiotis Karamolegkos (UPRC)
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding # RoleBinding
......@@ -13,3 +30,4 @@ roleRef:
kind: ClusterRole # Role
name: crd-resource-lister
apiGroup: rbac.authorization.k8s.io
# Author: Panagiotis Karamolegkos (UPRC)
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole # Role
......@@ -8,4 +25,4 @@ metadata:
rules:
- apiGroups: ["codeco.com", "codeco.he-codeco.eu"]
resources: ["acm-mons", "mdm-mons", "netma-mons", "codecoapps", "netma-topologies"]
verbs: ["get", "watch", "list"]
\ No newline at end of file
verbs: ["get", "watch", "list"]
# ONLY HERE AS AN EXAMPLE
# Author: Panagiotis Karamolegkos (UPRC)
apiVersion: v1
kind: Pod
metadata:
name: gnn-model-pod
spec:
containers:
- name: reader
image: docker.io/sonem/pdlc-reader:v0.0.2 # Needs to be changed
volumeMounts:
- name: shared-volume
mountPath: /data
readOnly: true
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: shared-pvc-ro
\ No newline at end of file
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding # RoleBinding
metadata:
......@@ -12,3 +31,4 @@ roleRef:
name: full-access-role
apiGroup: rbac.authorization.k8s.io
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole # Role
metadata:
......@@ -8,3 +27,4 @@ rules:
resources: ["*"]
verbs: ["*"]
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: apps/v1
kind: Deployment
metadata:
......@@ -30,4 +49,4 @@ spec:
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: shared-pvc-ro
\ No newline at end of file
claimName: shared-pvc-ro
# Copyright (c) 2024 University of Piraeus Research Centre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Panagiotis Karamolegkos (UPRC) - Author
apiVersion: apps/v1
kind: Deployment
metadata:
......@@ -51,3 +70,4 @@ spec:
- port: 5000
selector:
app: pdlc-gnn-inference
FROM python:3.8.10
WORKDIR /app
# Get the needed files
COPY reader.py /app
COPY requirements.txt /app
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Install requirements
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "-u", "reader.py"]
\ No newline at end of file
# Execute the following to create the images
docker build \
--tag sonem/pdlc-reader:v0.0.2 .
docker push sonem/pdlc-reader:v0.0.2
# Execute the following to make the image multiarchitectural
docker buildx build \
--push \
-f Dockerfile \
--platform linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8 \
--tag sonem/pdlc-reader:v0.0.2 .
\ No newline at end of file
# The code below is reading the content of the first line of the file a file
# in the /data directory and printing it to the console.
import os
import time
def read_and_print_first_line(filename):
# Wait until directory and file exist
while not os.path.exists(os.path.dirname(filename)):
time.sleep(1)
while not os.path.exists(filename):
time.sleep(1)
while True:
with open(filename, 'r') as file:
first_line = file.readline().strip() # Read the first line and remove any leading/trailing whitespaces
if first_line:
print(first_line)
else:
print("File is empty.")
time.sleep(2)
if __name__ == "__main__":
filename = "/data/current_time.txt"
read_and_print_first_line(filename)
\ No newline at end of file
FROM python:3.8.10
WORKDIR /app
# Get the needed files
COPY writer.py /app
COPY requirements.txt /app
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Install requirements
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "-u", "writer.py"]
\ No newline at end of file
# Execute the following to create the images
docker build \
--tag sonem/pdlc-writer:v0.0.2 .
docker push sonem/pdlc-writer:v0.0.2
# Execute the following to make the image multiarchitectural
docker buildx build \
--push \
-f Dockerfile \
--platform linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8 \
--tag sonem/pdlc-writer:v0.0.2 .
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment