Skip to content

Commit

Permalink
Changes to handle aimlfw hosted vm restart
Browse files Browse the repository at this point in the history
Issue-Id: AIMLFW-63

Change-Id: I03d4890a855de1ed86e1fbadf80194180437ef9e
Signed-off-by: josephthaliath <[email protected]>
  • Loading branch information
josephthaliath committed Nov 13, 2023
1 parent 24fb017 commit 8885535
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
11 changes: 11 additions & 0 deletions helm/leofs/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:

securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: leofs-pv-storage
persistentVolumeClaim:
claimName: leofs-pvc
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.leofs.image.repository }}:{{ .Values.leofs.image.tag | default .Chart.AppVersion }}"
Expand All @@ -58,3 +62,10 @@ spec:
protocol: TCP
workingDir: /root/deb
command: ["/sbin/init"]
volumeMounts:
- mountPath: "/root/leofs"
name: leofs-pv-storage
lifecycle:
postStart:
exec:
command: ["bash", "-c", "source /root/deb/leofs_start.sh > /root/leofs/postStart.logs"]
12 changes: 12 additions & 0 deletions helm/leofs/templates/leofs_pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: leofs-pvc
namespace: {{ include "common.namespace.kubeflow" . }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: nfs-client
1 change: 0 additions & 1 deletion tools/leofs/bin/install_leofs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ NAMESPACE=kubeflow
COMPONENT=leofs
POD_NAME=$(kubectl get pod -l app.kubernetes.io/name=$COMPONENT -n $NAMESPACE -o jsonpath="{.items[0].metadata.name}")
while [[ $(kubectl get pods $POD_NAME -n kubeflow -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for leofs pod" && sleep 1; done
kubectl exec -it $POD_NAME -n kubeflow -- bash -c "source /root/deb/leofs_start.sh"
28 changes: 23 additions & 5 deletions tools/leofs/bin/leofs_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,29 @@
#
# ==================================================================================

dpkg-deb -xv leofs_1.4.3-1_ubuntu-18.04_amd64.deb .
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_manager_0/etc/leo_manager.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_manager_1/etc/leo_manager.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_storage/etc/leo_storage.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_gateway/etc/leo_gateway.environment
while ! test -d /proc/1 ; do
echo "PID 1 not started"
sleep 1
done

cd ../leofs


if test -f leofs_started; then
echo "Leofs already installed"
else
echo "Leofs not started"
cp ../deb/leofs_1.4.3-1_ubuntu-18.04_amd64.deb .
dpkg-deb -xv leofs_1.4.3-1_ubuntu-18.04_amd64.deb .
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_manager_0/etc/leo_manager.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_manager_1/etc/leo_manager.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_storage/etc/leo_storage.environment
sed -i 's/RUNNER_USER=/RUNNER_USER=root/g' ./usr/local/leofs/1.4.3/leo_gateway/etc/leo_gateway.environment

touch leofs_started
fi


./usr/local/leofs/1.4.3/leo_manager_0/bin/leo_manager start
echo "leo_manager_0 started"
sleep 20
Expand Down

0 comments on commit 8885535

Please sign in to comment.