Skip to content

Commit 5cb6e8b

Browse files
authored
Update installation section in README (#469)
* update installation section in README
1 parent b3650be commit 5cb6e8b

File tree

1 file changed

+60
-44
lines changed

1 file changed

+60
-44
lines changed

README.md

Lines changed: 60 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -70,77 +70,93 @@ XPK also supports [Google Cloud Storage solutions](#storage):
7070
* Vertex AI Administrator
7171
* Filestore Editor (This role is neccessary if you want to run `storage create` command with `--type=gcpfilestore`)
7272

73-
# Prerequisites
73+
# Installation
74+
75+
There are 2 ways to install XPK:
7476

75-
Following tools must be installed:
77+
- via Python package installer (`pip`),
78+
- clone from git and build from source.
79+
80+
## Prerequisites
7681

77-
- python >= 3.10 (download from [here](https://www.python.org/downloads/))
78-
- pip ([installation instruction](https://pip.pypa.io/en/stable/installation/))
79-
- python venv ([installation instruction](https://virtualenv.pypa.io/en/latest/installation.html))
82+
The following tools must be installed:
83+
84+
- python >= 3.10: download from [here](https://www.python.org/downloads/)
85+
- pip: [installation instructions](https://pip.pypa.io/en/stable/installation/)
86+
- python venv: [installation instructions](https://virtualenv.pypa.io/en/latest/installation.html)
8087
(all three of above can be installed at once from [here](https://packaging.python.org/en/latest/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers))
81-
- gcloud (install from [here](https://cloud.google.com/sdk/gcloud#download_and_install_the))
88+
- gcloud: install from [here](https://cloud.google.com/sdk/gcloud#download_and_install_the) and then:
8289
- Run `gcloud init`
8390
- [Authenticate](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login) to Google Cloud
84-
- kubectl (install from [here](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_kubectl))
91+
- kubectl: install from [here](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_kubectl) and then:
8592
- Install `gke-gcloud-auth-plugin` from [here](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin)
86-
- docker ([installation instruction](https://docs.docker.com/engine/install/))
93+
- docker: [installation instructions](https://docs.docker.com/engine/install/) and then:
94+
- Configure sudoless docker: [guide](https://docs.docker.com/engine/install/linux-postinstall/)
8795
- Run `gcloud auth configure-docker` to ensure images can be uploaded to registry
88-
- make - please run below command.
89-
```shell
90-
# sudo may be required
91-
apt-get -y install make
92-
```
93-
In addition, below dependencies can be installed either using provided links or using `make install` command, if xpk is downloaded via `git clone` command:
94-
- kueuectl (install from [here](https://kueue.sigs.k8s.io/docs/reference/kubectl-kueue/installation/))
95-
- kjob (installation instructions [here](https://github.com/kubernetes-sigs/kjob/blob/main/docs/installation.md))
9696

97-
# Installation
98-
To install xpk, install required tools mentioned in [prerequisites](#prerequisites). [Makefile](https://github.com/AI-Hypercomputer/xpk/blob/main/Makefile) provides a way to install all neccessary tools. XPK can be installed via pip:
97+
### Additional prerequisites when installing from pip
98+
99+
- kueuectl: install from [here](https://kueue.sigs.k8s.io/docs/reference/kubectl-kueue/installation/)
100+
- kjob: installation instructions [here](https://github.com/kubernetes-sigs/kjob/blob/main/docs/installation.md)
101+
102+
### Additional prerequisites when installing from source
103+
104+
- git: [installation instructions](https://git-scm.com/downloads/linux)
105+
- make: install by running `apt-get -y install make` (`sudo` might be required)
106+
107+
## Installation via pip
108+
109+
To install XPK using pip, first install required tools mentioned in [prerequisites](#prerequisites) and [additional prerequisites](#additional-prerequisites-when-installing-from-pip). Then you can install XPK simply by running:
99110

100111
```shell
101112
pip install xpk
102113
```
103114

104-
If you see an error saying: `This environment is externally managed`, please use a virtual environment.
115+
If you see an error saying: `This environment is externally managed`, please use a virtual environment. For example:
105116

106117
```shell
107-
## One time step of creating the venv
108-
VENV_DIR=~/venvp3
109-
python3 -m venv $VENV_DIR
110-
## Enter your venv.
111-
source $VENV_DIR/bin/activate
112-
## Clone the repository and installing dependencies.
113-
pip install xpk
118+
# One time step of creating the virtual environment
119+
VENV_DIR=~/venvp3
120+
python3 -m venv $VENV_DIR
121+
122+
# Activate your virtual environment
123+
source $VENV_DIR/bin/activate
124+
125+
# Install XPK in virtual environment using pip
126+
pip install xpk
114127
```
115128

116-
If you are running XPK by cloning GitHub repository, first run the
117-
following commands to begin using XPK commands:
129+
## Installation from source
130+
131+
To install XPK from source, first install required tools mentioned in [prerequisites](#prerequisites) and [additional prerequisites](#additional-prerequisites-when-installing-from-source). Afterwards you can install XPK from source using `make`
118132

119133
```shell
134+
# Clone the XPK repository
120135
git clone https://github.com/google/xpk.git
121136
cd xpk
122-
# Install required dependencies with make
137+
138+
# Install required dependencies and build XPK with make
123139
make install && export PATH=$PATH:$PWD/bin
124140
```
125141

126-
If you want to have installed dependecies persist in your PATH please run:
127-
`echo $PWD/bin` and add its value to `PATH` in .bashrc or .zshrc
128-
129-
If you see an error saying: `This environment is externally managed`, please use a virtual environment.
142+
If you want the dependecies to be available in your PATH please run: `echo $PWD/bin` and add its value to `PATH` in .bashrc or .zshrc file.
130143

131-
Example:
144+
If you see an error saying: `This environment is externally managed`, please use a virtual environment. For example:
132145

133146
```shell
134-
## One time step of creating the venv
135-
VENV_DIR=~/venvp3
136-
python3 -m venv $VENV_DIR
137-
## Enter your venv.
138-
source $VENV_DIR/bin/activate
139-
## Clone the repository and installing dependencies.
140-
git clone https://github.com/google/xpk.git
141-
cd xpk
142-
# Install required dependencies with make
143-
make install && export PATH=$PATH:$PWD/bin
147+
# One time step of creating the virtual environment
148+
VENV_DIR=~/venvp3
149+
python3 -m venv $VENV_DIR
150+
151+
# Activate your virtual environment
152+
source $VENV_DIR/bin/activate
153+
154+
# Clone the XPK repository
155+
git clone https://github.com/google/xpk.git
156+
cd xpk
157+
158+
# Install required dependencies and build XPK with make
159+
make install && export PATH=$PATH:$PWD/bin
144160
```
145161

146162
# XPK for Large Scale (>1k VMs)

0 commit comments

Comments
 (0)