Clean up install script
This commit is contained in:
18
scripts/add_to_environment.sh
Normal file
18
scripts/add_to_environment.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
add_to_environment() {
|
||||||
|
local path="$1"
|
||||||
|
# Check if the path is already in the environment file
|
||||||
|
if ! grep -q "$path" /etc/environment; then
|
||||||
|
# Get current PATH from environment file
|
||||||
|
current_path=$(grep "^PATH=" /etc/environment | cut -d'"' -f2)
|
||||||
|
|
||||||
|
if [ -z "$current_path" ]; then
|
||||||
|
# If PATH doesn't exist in the file, create it
|
||||||
|
echo "PATH=\"\$PATH:$path\"" >> /etc/environment
|
||||||
|
else
|
||||||
|
# Replace existing PATH line with updated one
|
||||||
|
sed -i "s|^PATH=.*|PATH=\"$path:$current_path\"|" /etc/environment
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -61,6 +61,7 @@ ln -s "/root/sia/web/dist" "/root/static"
|
|||||||
|
|
||||||
# Install SIA dependencies
|
# Install SIA dependencies
|
||||||
source "/root/sia/scripts/install.sh"
|
source "/root/sia/scripts/install.sh"
|
||||||
|
source "/etc/environment"
|
||||||
|
|
||||||
## Finetune model
|
## Finetune model
|
||||||
#echo "Finetuning model..."
|
#echo "Finetuning model..."
|
||||||
|
|||||||
@@ -1,36 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
add_to_environment() {
|
|
||||||
local path="$1"
|
|
||||||
# Check if the path is already in the environment file
|
|
||||||
if ! grep -q "$path" /etc/environment; then
|
|
||||||
# Get current PATH from environment file
|
|
||||||
current_path=$(grep "^PATH=" /etc/environment | cut -d'"' -f2)
|
|
||||||
|
|
||||||
if [ -z "$current_path" ]; then
|
|
||||||
# If PATH doesn't exist in the file, create it
|
|
||||||
echo "PATH=\"\$PATH:$path\"" >> /etc/environment
|
|
||||||
else
|
|
||||||
# Replace existing PATH line with updated one
|
|
||||||
sed -i "s|^PATH=.*|PATH=\"$path:$current_path\"|" /etc/environment
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Installing ITB tool..."
|
echo "Installing ITB tool..."
|
||||||
python3 -m venv "/root/venvs/itb"
|
python3 -m venv "/root/venvs/itb"
|
||||||
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
|
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
|
||||||
add_to_environment "/root/venvs/itb/bin"
|
/root/sia/scripts/add_to_environment "/root/venvs/itb/bin"
|
||||||
|
|
||||||
echo "Installing Train tool..."
|
echo "Installing Train tool..."
|
||||||
python3 -m venv "/root/venvs/train"
|
python3 -m venv "/root/venvs/train"
|
||||||
/root/venvs/train/bin/pip install -e /root/sia/tools/train/
|
/root/venvs/train/bin/pip install -e /root/sia/tools/train/
|
||||||
/root/venvs/train/bin/ipython kernel install --name=train
|
/root/venvs/train/bin/ipython kernel install --name=train
|
||||||
add_to_environment "/root/venvs/train/bin"
|
/root/sia/scripts/add_to_environment "/root/venvs/train/bin"
|
||||||
|
|
||||||
echo "Installing SIA core..."
|
echo "Installing SIA core..."
|
||||||
python3 -m venv "/root/venvs/sia"
|
python3 -m venv "/root/venvs/sia"
|
||||||
/root/venvs/sia/bin/pip install -e /root/sia/
|
/root/venvs/sia/bin/pip install -e /root/sia/
|
||||||
add_to_environment "/root/venvs/sia/bin"
|
/root/sia/scripts/add_to_environment "/root/venvs/sia/bin"
|
||||||
|
|
||||||
source "/etc/environment
|
|
||||||
Reference in New Issue
Block a user