Skip to content

Commit 5c9116f

Browse files
authored
Update installation readme (#278)
* Split up setup / install * Update contributing guide * Skip java and hadoop
1 parent 00da4e1 commit 5c9116f

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,31 @@ To contribute to `modelstore`'s code base, we recommend taking the following jou
2323

2424
## 👨🏽‍💻 Get familiar with the code base
2525

26+
### Pre-requisitings
27+
28+
This library has been developed on Mac OS. To get started:
29+
30+
```bash
31+
❯ make setup
32+
```
33+
34+
Will update `brew`, install `pyenv` and other things an required by ML libraries (e.g `libomp`, required by `xgboost`).
35+
2636
### Setup a virtual environment
2737

28-
This library has been developed using [pyenv](https://github.com/pyenv/pyenv)
29-
and [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv), using the
30-
requirements that are in `requirements.txt` and `requirements-dev.txt`.
38+
This library has been developed using [pyenv](https://github.com/pyenv/pyenv) and [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv), using the requirements that are in `requirements.txt` and `requirements-dev.txt`.
3139

32-
This project has two requirements files:
40+
This project has two types of requirements files:
3341
* `requirements.txt` contains any dependencies that `modelstore` users must have in order to use `modelstore`. This should be as lightweight as possible. We do not require users to install every single machine learning library - just the ones that they want to use.
34-
* `requirements-dev.txt` contains all of the dependencies that `modelstore` developers must have. This file does contain all of the machine learning frameworks that are supported by `modelstore` - they must be installed to enable running all of the unit tests.
42+
* `requirements-dev[X].txt` contains all of the dependencies that `modelstore` developers must have. These files contain all of the machine learning frameworks that are supported by `modelstore` - they must be installed to enable running all of the unit tests.
3543

36-
You can create a virtual environment using your favourite approach and
37-
install all of those dependencies, or once you have set up `pyenv`, use this
38-
`Makefile` command that does the rest for you:
44+
Once you have set up `pyenv` and `pyenv-virtualenv` installed, use this `Makefile` command that does the rest for you:
3945

4046
```bash
4147
❯ make install
4248
```
4349

44-
Will update `brew` and install `libomp` (required by `xgboost`).
45-
46-
It will then create a Python virtual environment, using `pyenv-virtualenv`,
47-
and install all of the dependencies in the requirements files. If you want
48-
to use a different version of Python, update the [bin/_config](bin/config) file.
50+
This will create a Python virtual environment, using `pyenv-virtualenv`, and install all of the dependencies in the requirements files. If you want to use a different version of Python, update the [bin/_config](bin/config) file.
4951

5052
Notes:
5153
* I've seen trouble with installing `prophet` and have sometimes had to install it manually
@@ -74,7 +76,6 @@ For details, head over to the [README.md](examples/README.md) in the `examples`
7476

7577
All of `modelstore`'s bugs are publicly tracked via [Github issues](https://github.com/operatorai/modelstore/issues).
7678

77-
7879
## 💡 Contribute new feature ideas
7980

8081
There are a variety of ideas that have been listed in the repo's [discussions](https://github.com/operatorai/modelstore/discussions) section. For example:

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
VIRTUALENV_NAME=$(shell pwd | rev | cut -d '/' -f 1 | rev)-dev
22

3-
.PHONY: library test install uninstall release-test release-prod clean update
3+
.PHONY: library test setup install uninstall release-test release-prod clean update
44

55
uninstall:
66
@./bin/_pyenv_uninstall $(VIRTUALENV_NAME)
77

8+
setup:
9+
@./bin/_brew_install
10+
811
install: uninstall
9-
#@./bin/_brew_install
1012
@./bin/_pyenv_install $(VIRTUALENV_NAME)
1113

1214
update:

bin/_brew_install

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#!/bin/bash
22
set -e
33

4-
echo "\n ⏱ Running brew update and installing libomp"
4+
function install {
5+
if brew ls --versions "$1" >/dev/null; then
6+
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade "$1"
7+
else
8+
HOMEBREW_NO_AUTO_UPDATE=1 brew install "$1"
9+
fi
10+
}
11+
12+
echo -e "\n 💬 Running brew update..."
513
brew update
614

15+
echo -e "\n 💬 Installing pyenv & pyenv-virtualenv..."
16+
install pyenv
17+
install pyenv-virtualenv
18+
719
# To get pystan to install correctly (required by prophet)
820
# https://stackoverflow.com/questions/52814868/pystan-compileerror-command-gcc-failed-with-exit-status-1-macos
9-
brew install gcc
21+
echo -e "\n 💬 Installing gcc..."
22+
install gcc
1023
export CC=gcc-11
1124
export CXX=g++-11
1225

1326
# To use xgboost models on mac
1427
# https://xgboost.readthedocs.io/en/latest/build.html#building-on-osx
15-
# Note: it looks like there's trouble with libomp 12
16-
# https://github.com/dmlc/xgboost/issues/7039
17-
brew install rajivshah3/libomp-tap/libomp@11.1.0
28+
echo -e "\n 💬 Installing libomp..."
29+
install libomp
1830

1931
# To use pyspark models on mac
20-
brew install java
21-
2232
# To use hdfs storage on mac
23-
brew install hadoop
33+
# echo -e "\n 💬 Installing java and hadoop..."
34+
# install java
35+
# install hadoop
2436

2537
echo "\n ✅ Done."

0 commit comments

Comments
 (0)