Skip to content

Commit 0b959ea

Browse files
[YOLO] clean logic for image repos/tags used to run functional tests (#1429)
1 parent cd5e853 commit 0b959ea

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

harness_scripts/functional_by_framework/check_by_framework_run1_step_entrypoint.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ set +e
2525
id
2626
set -e
2727

28+
title "Upgrade pip"
29+
pip install -U pip
30+
2831
title "Installing pytest"
2932
pip install pytest pytest-xdist
3033

@@ -33,6 +36,7 @@ pip install pytest pytest-xdist
3336
# with the datarobot-drum version specified in the environment's requirements.txt file.
3437
if [ "${FRAMEWORK}" != "java_codegen" ]; then
3538
title "Uninstalling datarobot-drum"
39+
# I think we don't need to uninstall datarobot-mlops, but removing it broke drum re-installation.
3640
pip uninstall datarobot-drum datarobot-mlops -y
3741

3842
title "Installing dependencies, with datarobot-drum installed from source-code"
@@ -64,8 +68,13 @@ if [ "${FRAMEWORK}" != "java_codegen" ]; then
6468
DRUM_SOURCE_DIR_TMP="/tmp/custom_model_runner"
6569
cp -r ${DRUM_SOURCE_DIR} ${DRUM_SOURCE_DIR_TMP}
6670
fi
67-
# Install datarobot-drum from source code, but keep dependencies that were installed by the environment
68-
pip install --force-reinstall ${DRUM_SOURCE_DIR_TMP}${EXTRA} ${INST_ENV_REQ_CMD}
71+
# Install datarobot-drum from source code.
72+
# Testing image either was just built (if env changed), or the latest release image is used for testing.
73+
# I think we should not reinstall all the deps.
74+
# We only install DRUM from source, if some deps were changed they are upgraded.
75+
# This saves time by avoiding heavy AI/nvidia packages reinstallation.
76+
# pip install --force-reinstall ${DRUM_SOURCE_DIR_TMP}${EXTRA} ${INST_ENV_REQ_CMD}
77+
pip install --upgrade ${DRUM_SOURCE_DIR_TMP}${EXTRA}
6978
fi
7079

7180
cd "${ROOT_DIR}"

harness_scripts/functional_by_framework/check_env_changed_check_diff.sh

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,25 @@ echo "--- changed paths ---"
2020
echo "${changed_paths}"
2121
echo "--- --- --- --- ---"
2222

23-
# by default define namespace, repo, and tag for the existing flow without changes
24-
# e.g. datarobotdev/datarobot-user-models:public_dropin_envs_python3_sklearn_latest
23+
# by default set namespace, repo, and tag as
24+
# datarobot/<image_repository>:<env_version_id>
25+
# e.g. datarobot/env-python-sklearn:12355123abc918234
2526
env_info="${ENV_FOLDER}/${FRAMEWORK}/env_info.json"
2627
ENV_VERSION_ID=$(jq -r '.environmentVersionId' ${env_info})
2728

29+
# once we implement image promotion, change it to datarobot.
2830
test_image_namespace=datarobotdev
29-
test_image_repository=datarobot-user-models
30-
31-
test_image_tag_base=${ENV_FOLDER}_${FRAMEWORK}_${ENV_VERSION_ID}
32-
test_image_tag=${test_image_tag_base}
31+
test_image_tag=${ENV_VERSION_ID}
3332

3433
changed_deps=false;
3534

36-
3735
IMAGE_REPOSITORY=$(jq -r '.imageRepository' ${env_info})
3836
if [ "${IMAGE_REPOSITORY}" = "null" ]; then
39-
echo "Image repository is not defined in env_info.json"
37+
echo "Image repository must be defined in 'imageRepository' in env_info.json"
4038
else
41-
# if env_info has imageRepository
42-
# point test_image_namespace to datarobot
43-
# point test_image_repository to defined repo
44-
# point tag to ENV_VERSION_ID
4539
# e.g. datarobot/env-python-sklearn:12355123abc918234
46-
echo "read ${IMAGE_REPOSITORY}"
47-
# after promotion work, change to datarobot
48-
test_image_namespace=datarobotdev
40+
echo "Image repo read from env_info.json: ${IMAGE_REPOSITORY}"
4941
test_image_repository=${IMAGE_REPOSITORY}
50-
test_image_tag_base=${ENV_VERSION_ID}
51-
test_image_tag=${ENV_VERSION_ID}
5242
fi
5343

5444

@@ -58,11 +48,11 @@ if echo "${changed_paths}" | grep "${ENV_FOLDER}/${FRAMEWORK}" > /dev/null; then
5848
test_image_namespace=datarobotdev
5949
if [ -n $TRIGGER_PR_NUMBER ] && [ "$TRIGGER_PR_NUMBER" != "null" ]; then
6050
# datarobotdev/env-python-sklearn:12355123abc918234_PR_NUM
61-
# or
62-
# datarobotdev/datarobot-user-models:public_dropin_envs_python3_sklearn_PR_NUM
63-
test_image_tag=${test_image_tag_base}
51+
# placeholder in case we want to add PR number back,
52+
# but then it will be difficult to promote
53+
test_image_tag=${test_image_tag}
6454
else
65-
test_image_tag=${test_image_tag_base}_${CODEBASE_BRANCH}
55+
test_image_tag=${test_image_tag}_${CODEBASE_BRANCH}
6656
# If the test_image_tag may contain a slash, replace it with an underscore (POSIX compliant)
6757
while case $test_image_tag in */*) true;; *) false;; esac; do
6858
test_image_tag=${test_image_tag%%/*}_${test_image_tag#*/}

tests/functional/test_fit_per_framework.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,5 +1043,5 @@ def test_fit_with_fit_metadata(
10431043
assert os.path.exists(output / FIT_METADATA_FILENAME)
10441044
data = json.load(open(output / FIT_METADATA_FILENAME))
10451045
assert "fit_memory_usage" in data.keys()
1046-
assert 250 > data["fit_memory_usage"] > 100
1047-
assert 250 > data["prediction_memory_usage"] > 100
1046+
assert 300 > data["fit_memory_usage"] > 100
1047+
assert 300 > data["prediction_memory_usage"] > 100

0 commit comments

Comments
 (0)