From 85fa88fc00f58d3ffebd12482c2575e555ab6705 Mon Sep 17 00:00:00 2001 From: "Zheng, Qi" Date: Thu, 20 Oct 2022 18:51:03 +0800 Subject: [PATCH] Fix python3.7 PIE issue --- demos/python/python_glibc/install_python_with_conda.sh | 4 ++-- demos/python/python_glibc/run_python_on_occlum.sh | 3 +-- demos/pytorch/install_python_with_conda.sh | 4 ++-- .../tensorflow_training/install_python_with_conda.sh | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/demos/python/python_glibc/install_python_with_conda.sh b/demos/python/python_glibc/install_python_with_conda.sh index 9a5e8c75..431d15bc 100755 --- a/demos/python/python_glibc/install_python_with_conda.sh +++ b/demos/python/python_glibc/install_python_with_conda.sh @@ -6,7 +6,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" [ -d occlum_instance ] || occlum new occlum_instance # 2. Install python and dependencies to specified position -[ -d Miniconda3-latest-Linux-x86_64.sh ] || wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh +[ -f Miniconda3-latest-Linux-x86_64.sh ] || wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh [ -d miniconda ] || bash ./Miniconda3-latest-Linux-x86_64.sh -b -p $script_dir/miniconda -$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.7 numpy=1.18.1 pandas=0.24.2 scipy=1.3.1 Cython scikit-learn=0.21.1 +$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.8 numpy=1.21.5 scipy=1.7.3 scikit-learn=1.0 pandas=1.3 Cython diff --git a/demos/python/python_glibc/run_python_on_occlum.sh b/demos/python/python_glibc/run_python_on_occlum.sh index 5f0b99c3..6426ffc4 100755 --- a/demos/python/python_glibc/run_python_on_occlum.sh +++ b/demos/python/python_glibc/run_python_on_occlum.sh @@ -18,8 +18,7 @@ if [ ! -d $python_dir ];then fi new_json="$(jq '.resource_limits.user_space_size = "640MB" | - .resource_limits.kernel_space_heap_size = "256MB" | - .process.default_mmap_size = "512MB" | + .resource_limits.kernel_space_heap_size = "300MB" | .env.default += ["PYTHONHOME=/opt/python-occlum"]' Occlum.json)" && \ echo "${new_json}" > Occlum.json occlum build diff --git a/demos/pytorch/install_python_with_conda.sh b/demos/pytorch/install_python_with_conda.sh index 011b1864..74ffde51 100755 --- a/demos/pytorch/install_python_with_conda.sh +++ b/demos/pytorch/install_python_with_conda.sh @@ -6,6 +6,6 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" [ -d occlum_instance ] || occlum new occlum_instance # 2. Install python and dependencies to specified position -[ -d Miniconda3-latest-Linux-x86_64.sh ] || wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh +[ -f Miniconda3-latest-Linux-x86_64.sh ] || wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh [ -d miniconda ] || bash ./Miniconda3-latest-Linux-x86_64.sh -b -p $script_dir/miniconda -$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.7 pytorch numpy torchvision -c pytorch +$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.8 pytorch numpy torchvision -c pytorch diff --git a/demos/tensorflow/tensorflow_training/install_python_with_conda.sh b/demos/tensorflow/tensorflow_training/install_python_with_conda.sh index 9d73d585..90cf639d 100755 --- a/demos/tensorflow/tensorflow_training/install_python_with_conda.sh +++ b/demos/tensorflow/tensorflow_training/install_python_with_conda.sh @@ -5,7 +5,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Install python and dependencies [ -f Miniconda3-latest-Linux-x86_64.sh ] || wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh [ -d miniconda ] || bash ./Miniconda3-latest-Linux-x86_64.sh -b -p $script_dir/miniconda -$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.7 tensorflow==1.15.0 +$script_dir/miniconda/bin/conda create --prefix $script_dir/python-occlum -y python=3.8 tensorflow==2.2 # Download mnist dataset [ -f mnist.npz ] || wget https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz