Skip to content

Commit

Permalink
Merge pull request #103 from justinmerrell/auto-install-sys-deps
Browse files Browse the repository at this point in the history
feat: add installer of deps
  • Loading branch information
DireLines authored Feb 14, 2024
2 parents 7ef4306 + 97699f9 commit 40e6e5d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cmd/project/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,26 @@ func startProject(networkVolumeId string) error {
archivedVenvPath := path.Join(projectPathUuid, "dev-venv.tar.zst")
fmt.Printf("Activating Python virtual environment %s on Pod %s\n", venvPath, projectPodId)
sshConn.RunCommands([]string{
fmt.Sprint(`
DEPENDENCIES=("wget" "sudo" "lsof" "git" "rsync" "zstd" "jq" "inotify-tools")
function check_and_install_dependencies() {
for dep in "${DEPENDENCIES[@]}"; do
if ! command -v $dep &> /dev/null; then
echo "$dep could not be found, attempting to install..."
apt-get update && apt-get install -y $dep
if [ $? -eq 0 ]; then
echo "$dep installed successfully."
else
echo "Failed to install $dep."
exit 1
fi
fi
done
wget -qO- cli.runpod.net | sudo bash &> /dev/null
}
check_and_install_dependencies`),
fmt.Sprintf(`
if ! [ -f %s/bin/activate ]
then
Expand Down

0 comments on commit 40e6e5d

Please sign in to comment.