Skip to content

Commit 432912d

Browse files
Update deploy.sh, openssl, use pip (skorch-dev#914)
* Update deploy.sh, openssl, use pip I ran into this issue when trying to deploy: https://askubuntu.com/questions/1428181/module-lib-has-no-attribute-x509-v-flag-cb-issuer-check Therefore, I adjusted the script to update pyopenssl. On top of that, I was frustrated with the very slow testing cycle, since the script always creates a new environment from scratch. To accelerate this, I removed the reliance on the (outdated) environment.yml and used pip for the requirements.txt, more in line with our CI. I tested this locally except for the last step (the upload) and it worked. * Reviewer comment: better echo message Co-authored-by: ottonemo <marian.tietz@ottogroup.com> * Reviewer comment: better comment Co-authored-by: ottonemo <marian.tietz@ottogroup.com> Co-authored-by: ottonemo <marian.tietz@ottogroup.com>
1 parent 2c43d07 commit 432912d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/deploy.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ PYTORCH_VERSION=${PYTORCH_VERSION:-""}
55
PYTHON_VERSION="3.9"
66
TWINE_VERSION=">3,<4.0.0dev"
77
CONDA_ENV="skorch-deploy"
8-
CONDA_ENV_YML="environment.yml"
98

109
if [[ $# -gt 1 ]] || [[ $1 != "live" && $1 != "stage" ]]; then
1110
echo "Usage $0 [live|stage]" >&2
@@ -27,7 +26,8 @@ set +e
2726
conda env remove -y -n $CONDA_ENV
2827
set -e
2928

30-
conda env create -q -n $CONDA_ENV -f $CONDA_ENV_YML "python=${PYTHON_VERSION}"
29+
echo "creating empty conda env"
30+
conda env create -q -n $CONDA_ENV
3131

3232
remove_env() {
3333
source deactivate
@@ -43,10 +43,16 @@ remove_env() {
4343
trap remove_env EXIT
4444

4545
source activate $CONDA_ENV
46-
conda install -q -y "twine==${TWINE_VERSION}"
46+
echo "installing dependencies"
4747
conda install -c pytorch -y "pytorch==${PYTORCH_VERSION}"
48+
python -m pip install "twine${TWINE_VERSION}"
49+
# Workaround for error `AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'`
50+
# due to outdated system pyOpenSSL - see also: https://askubuntu.com/q/1428181
51+
python -m pip install pyOpenSSL --upgrade
52+
python -m pip install -r requirements.txt
4853
python -m pip install -r requirements-dev.txt
4954
python -m pip install .
55+
python -m pip list
5056

5157
pytest -x
5258

0 commit comments

Comments
 (0)