fix: Added Velocity Backend to Ingress Computer with Elastic IP (#21)
Co-authored-by: Sagnik <sagnik7896@gmail.com> Reviewed-on: #21
This commit was merged in pull request #21.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_ROOT=/opt/desineuron-velocity-route-sync
|
||||
VENV_PATH="$APP_ROOT/.venv"
|
||||
ENV_FILE=/etc/desineuron-velocity-route-sync.env
|
||||
SCRIPT_PATH=/usr/local/bin/sync_velocity_route.py
|
||||
SERVICE_FILE=/etc/systemd/system/desineuron-velocity-route-sync.service
|
||||
TIMER_FILE=/etc/systemd/system/desineuron-velocity-route-sync.timer
|
||||
|
||||
sudo mkdir -p "$APP_ROOT" /var/lib/desineuron-velocity-route-sync
|
||||
python3 -m venv "$VENV_PATH"
|
||||
"$VENV_PATH/bin/pip" install --upgrade pip boto3
|
||||
|
||||
sudo install -m 0755 /tmp/desineuron_ingress/sync_velocity_route.py "$SCRIPT_PATH"
|
||||
sudo install -m 0644 /tmp/desineuron_ingress/desineuron-velocity-route-sync.service "$SERVICE_FILE"
|
||||
sudo install -m 0644 /tmp/desineuron_ingress/desineuron-velocity-route-sync.timer "$TIMER_FILE"
|
||||
|
||||
sudo tee "$ENV_FILE" >/dev/null <<EOF
|
||||
OPS_ENV_FILE=/opt/desineuron-ops-control-plane/.env
|
||||
VELOCITY_ROUTE_HOSTNAME=api.desineuron.in
|
||||
VELOCITY_ROUTE_PORT=8001
|
||||
VELOCITY_INSTANCE_TAG_KEY=DesineuronRole
|
||||
VELOCITY_INSTANCE_TAG_VALUE=velocity-backend
|
||||
VELOCITY_ROUTE_STATE_FILE=/var/lib/desineuron-velocity-route-sync/current_target.txt
|
||||
INGRESS_SSH_KEY_PATH=/opt/desineuron-ops-control-plane/state/desineuron-l4-node.pem
|
||||
EOF
|
||||
|
||||
sudo chmod 600 "$ENV_FILE"
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now desineuron-velocity-route-sync.timer
|
||||
sudo systemctl start desineuron-velocity-route-sync.service
|
||||
sudo systemctl --no-pager --full status desineuron-velocity-route-sync.service desineuron-velocity-route-sync.timer
|
||||
Reference in New Issue
Block a user