Skip to content

Commit cf8f3ec

Browse files
[Universal] - reduce size - removed nvidia, triton - Machine Learning 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
1 parent 7baa00f commit cf8f3ec

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.github/actions/smoke-test/check-image-size.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
3+
set -e
4+
25
# Function to handle errors
36
handle_error() {
47
local exit_code=$?
@@ -8,7 +11,6 @@ handle_error() {
811
exit $exit_code
912
}
1013
trap 'handle_error $LINENO ${BASH_COMMAND%% *}' ERR
11-
echo "This is line $LINENO"
1214

1315
convert_gb_to_bytes() {
1416
local gb="$1"
@@ -52,6 +54,7 @@ check_image_size() {
5254
if [ -n $image_size ] && [ $image_size -gt $threshold ]; then
5355
echo -e "\nImage size exceeds the threshold of $THRESHOLD_IN_GB gb"
5456
echo -e "\n❌ Image size check failed."
57+
exit 1;
5558
else
5659
echo -e "\n✅ Passed!"
5760
fi

.github/workflows/smoke-universal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
uses: ./.github/actions/smoke-test
2727
with:
2828
image: universal
29-
threshold: 14
29+
threshold: 10

src/universal/.devcontainer/local-features/machine-learning-packages/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"installsAfter": [
55
"ghcr.io/devcontainers/features/python"
66
]
7-
}
7+
}

src/universal/.devcontainer/local-features/machine-learning-packages/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export DEBIAN_FRONTEND=noninteractive
3131

3232
install_python_package() {
3333
PACKAGE=${1:-""}
34-
34+
OPTIONS=${2:-""}
3535
sudo_if /usr/local/python/current/bin/python -m pip uninstall --yes $PACKAGE
3636
echo "Installing $PACKAGE..."
37-
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir $PACKAGE
37+
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir $PACKAGE $OPTIONS
3838
}
3939

4040
if [[ "$(python --version)" != "" ]] && [[ "$(pip --version)" != "" ]]; then
@@ -44,11 +44,11 @@ if [[ "$(python --version)" != "" ]] && [[ "$(pip --version)" != "" ]]; then
4444
install_python_package "matplotlib"
4545
install_python_package "seaborn"
4646
install_python_package "scikit-learn"
47-
install_python_package "torch"
47+
install_python_package "torch" "-f https://download.pytorch.org/whl/cpu/torch_stable.html"
4848
install_python_package "requests"
4949
install_python_package "plotly"
5050
else
5151
"(*) Error: Need to install python and pip."
5252
fi
5353

54-
echo "Done!"
54+
echo "Done!"

0 commit comments

Comments
 (0)