File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ if [ "${OS}" = '"Ubuntu"' ] && [ -n "${UBUNTU_MIRROR}" ]; then
2828 sed -i " s/ports.ubuntu.com/${UBUNTU_MIRROR} /g" /etc/apt/sources.list
2929fi
3030
31- # Pypi mirror. TODO[sidecus]: Check Python installation
31+ # Pypi mirror.
3232PYPI_MIRROR=${PYPI_MIRROR:- " " }
3333echo " PYPI_MIRROR: $PYPI_MIRROR "
3434if [ -n " ${PYPI_MIRROR} " ]; then
@@ -53,6 +53,7 @@ echo "HUGGINGFACE_MIRROR: $HUGGINGFACE_MIRROR"
5353if [ -n " ${HUGGINGFACE_MIRROR} " ]; then
5454 echo " Enabling Huggingface mirror: ${HUGGINGFACE_MIRROR} "
5555 touch /etc/environment && cp /etc/environment /etc/environment.mm.bak
56- echo " HF_ENDPOINT=${HF_ENDPOINT} " >> /etc/environment
56+ echo " HF_ENDPOINT=${HUGGINGFACE_MIRROR} " >> /etc/environment
57+ # export the new env
5758 set -a; . /etc/environment; set +a;
5859fi
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ source dev-container-features-test-lib
1010
1111# Feature-specific tests
1212# The 'check' command comes from the dev-container-features-test-lib.
13- check " test HF mirror" bash -c ' [ "${HF_ENDPOINT}"= "https://dummy-hf-mirror.com" ]; '
13+ check " test HF mirror" bash -c " test \ "${HF_ENDPOINT} \" = \ " https://dummy-hf-mirror.com\" "
1414
1515# Report results
1616# If any of the checks above exited with a non-zero exit code, the test will fail.
Original file line number Diff line number Diff line change 2020# UBUNTU_MIRROR=""
2121# PYPI_MIRROR=""
2222# APK_MIRROR=""
23+ # HUGGINGFACE_MIRROR=""
2324
2425#
2526# These scripts are run as 'root' by default. Although that can be changed
@@ -44,9 +45,10 @@ source dev-container-features-test-lib
4445# Feature-specific tests
4546# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
4647# check <LABEL> <cmd> [args...]
47- check " test no ubuntu mirror" bash -c " ! (test -e /etc/apt/sources.list.bak) && ! (cat /etc/apt/sources.list | grep 'mirrors.bfsu.edu.cn')"
48- check " test no pypi mirror" bash -c " ! (test -e /etc/pip.conf) || ! (cat /etc/pip.conf | grep 'mirrors.bfsu.edu.cn')"
49- check " test no apk mirror" bash -c " ! (test -e /etc/apk/repositories) || ! (cat /etc/apk/repositories | grep 'mirrors.tuna.tsinghua.edu.cn')"
48+ check " test no ubuntu mirror" bash -c " ! (test -f /etc/apt/sources.list.mm.bak)"
49+ check " test no pypi mirror" bash -c " ! (test -f /etc/pip.conf.mm.bak)"
50+ check " test no apk mirror" bash -c " ! (test -f /etc/apk/repositories.mm.bak)"
51+ check " test no huggingface mirror" bash -c " ! (test -f /etc/environment.mm.bak) && (test -z \" ${HF_ENDPOINT} \" ))"
5052
5153# Report results
5254# If any of the checks above exited with a non-zero exit code, the test will fail.
You can’t perform that action at this time.
0 commit comments