Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check os compatibility and dependencies_version in prepare_env.sh #99

Merged
merged 10 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Read more in the [whitepaper](https://github.com/alibaba/GraphScope/blob/main/do

## Getting Started

GraphScope can run on clusters managed by [Kubernetes](https://kubernetes.io/) within containers. For quickly getting started, we can leverage [minikube](https://minikube.sigs.k8s.io/) (on Linux) to set up a *local* Kubernetes cluster and take advantage of pre-built Docker images as follows.
GraphScope can run on clusters managed by [Kubernetes](https://kubernetes.io/) within containers. For quickly getting started, we can set up a *local* Kubernetes cluster and take advantage of pre-built Docker images as follows.

### Prerequisites

To run GraphScope on your local computer with minikube, the following dependencies or tools are required.
To run GraphScope on your local computer, the following dependencies or tools are required.

- Docker
- minikube
- Python >= 3.6 (with pip)
- Local Kubernetes cluster set-up tool (e.g. [Minikube](https://minikube.sigs.k8s.io) or [Kind](https://kind.sigs.k8s.io))

For Linux distributions, we provide a script to install the above dependencies and prepare the environment.
For Ubuntu/CentOs/WSL2, we provide a script to install the above dependencies and prepare the environment.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CentOS


```bash
# run the environment preparing script.
Expand Down
35 changes: 32 additions & 3 deletions scripts/prepare_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ is_in_wsl=false && [[ ! -z "${IS_WSL}" || ! -z "${WSL_DISTRO_NAME}" ]] && is_in_
# Arguments:
# None
##########################

function check_os_compatibility() {
if [[ "${is_in_wsl}" == true && -z "${WSL_INTEROP}" ]]; then
echo "GraphScope not support to run on WSL1, please use WSL2."
exit 1
fi

if [[ "${platform}" != *"Ubuntu"* && "${platform}" != *"CentOS"* ]]; then
echo "This script is only available on Unbuntu/CentOS/WSL2."
exit 1
fi

echo "$(date '+%Y-%m-%d %H:%M:%S') preparing environment on '${platform}'"
}

function check_dependencies_version() {
# python
if ! hash python3; then
echo "Python3 is not installed"
exit 1
fi
ver=$(python3 -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]\).*/\1\2/')
if [ "$ver" -lt "36" ]; then
echo "GraphScope requires python 3.6 or greater"
exit 1
fi
}

function install_dependencies() {
echo "$(date '+%Y-%m-%d %H:%M:%S') install dependencies."
if [[ "${platform}" == *"Ubuntu"* ]]; then
Expand All @@ -35,9 +63,6 @@ function install_dependencies() {
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo yum clean all
else
echo "Only support Ubuntu and CentOS"
exit 1
fi

pip3 install -U pip --user
Expand Down Expand Up @@ -125,8 +150,12 @@ then
exit 0
fi

check_os_compatibility

install_dependencies

check_dependencies_version

start_docker

launch_k8s_cluster
Expand Down