Skip to content

Commit

Permalink
Pytorch package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
dania-tii committed Nov 15, 2023
1 parent 839e2fd commit 223ef51
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/utils/docker/entrypoint_nats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ else
echo "starting comms services"
/opt/S90comms_controller start

# Install python package "torch"
echo "installing packages"
chmod +x /opt/mesh_com/modules/utils/package/install_dependencies.sh
/opt/mesh_com/modules/utils/package/install_dependencies.sh

# alive
nohup /bin/bash -c "while true; do sleep infinity; done"
fi
18 changes: 18 additions & 0 deletions modules/utils/package/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Install machine learning packages
chmod +x /opt/mesh_com/modules/utils/package/ml_packages.tar.gz
tar -C /opt/mesh_com/modules/utils/package/ -zxvf /opt/mesh_com/modules/utils/package/ml_packages.tar.gz

cd /opt/mesh_com/modules/utils/package/ml_packages || exit

for f in {*.whl,*.gz};
do
name="$(echo "$f" | cut -d'-' -f1)"
if python -c 'import pkgutil; exit(not pkgutil.find_loader("$name"))'; then
echo "$name" "installed"
else
echo "$name" "not found"
echo "installing" "$name"
pip install --no-index "$f" --find-links .;
fi
done;

Binary file added modules/utils/package/ml_packages.tar.gz
Binary file not shown.

0 comments on commit 223ef51

Please sign in to comment.