Skip to content

Commit

Permalink
[Universal] - reduce size - removed nvidia, triton - Machine Learning…
Browse files Browse the repository at this point in the history
… Packages (#1014)

* [Universal] - reduce size - removed nvidia, triton - from M.L.P

* optional installation for torch ( with gpu acc. / without it )

* updated threshold for universal image to 10 GB

* [universal] - reduce size - changed acc. to comments

* [Universal] - shrunk size - amended based on reviews

* more changes acc. to comments

* few more relevant changes..

* final changes

* misc change

* changes for comments

* change for comment

* change for running tests

* [Universal] - not installing gpu accelerated torch pkg now

* correction to install_python_package fn

* image size check should fail

* [Universal]-shrink size issue-changes as suggested
  • Loading branch information
gauravsaini04 authored May 9, 2024
1 parent 7baa00f commit cf8f3ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/actions/smoke-test/check-image-size.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -e

# Function to handle errors
handle_error() {
local exit_code=$?
Expand All @@ -8,7 +11,6 @@ handle_error() {
exit $exit_code
}
trap 'handle_error $LINENO ${BASH_COMMAND%% *}' ERR
echo "This is line $LINENO"

convert_gb_to_bytes() {
local gb="$1"
Expand Down Expand Up @@ -52,6 +54,7 @@ check_image_size() {
if [ -n $image_size ] && [ $image_size -gt $threshold ]; then
echo -e "\nImage size exceeds the threshold of $THRESHOLD_IN_GB gb"
echo -e "\n❌ Image size check failed."
exit 1;
else
echo -e "\n✅ Passed!"
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-universal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
uses: ./.github/actions/smoke-test
with:
image: universal
threshold: 14
threshold: 10
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"installsAfter": [
"ghcr.io/devcontainers/features/python"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export DEBIAN_FRONTEND=noninteractive

install_python_package() {
PACKAGE=${1:-""}

OPTIONS=${2:-""}
sudo_if /usr/local/python/current/bin/python -m pip uninstall --yes $PACKAGE
echo "Installing $PACKAGE..."
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir $PACKAGE
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir $PACKAGE $OPTIONS
}

if [[ "$(python --version)" != "" ]] && [[ "$(pip --version)" != "" ]]; then
Expand All @@ -44,11 +44,11 @@ if [[ "$(python --version)" != "" ]] && [[ "$(pip --version)" != "" ]]; then
install_python_package "matplotlib"
install_python_package "seaborn"
install_python_package "scikit-learn"
install_python_package "torch"
install_python_package "torch" "-f https://download.pytorch.org/whl/cpu/torch_stable.html"
install_python_package "requests"
install_python_package "plotly"
else
"(*) Error: Need to install python and pip."
fi

echo "Done!"
echo "Done!"

0 comments on commit cf8f3ec

Please sign in to comment.