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

remove unnecessary dependencies #800

Merged
merged 9 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ RUN bash -c 'if [ `arch` = "ppc64le" ]; then \
# openssl 1.1.1d has a bug on ppc64le https://github.com/openssl/openssl/issues/10015
RUN wget https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
/opt/h2oai/h2o4gpu/python/bin/conda install -y python=3.6 PyYAML=3.13 conda-build six=1.11.0 openssl=1.1.1c && \
/opt/h2oai/h2o4gpu/python/bin/conda install -y python=3.6 conda-build openssl=1.1.1c && \
wget https://s3.amazonaws.com/artifacts.h2o.ai/releases/ai/h2o/dai-thirdparty-deps/1.0-master-2/`arch`-centos7/llvm.tar.bz2 && \
tar xvf llvm.tar.bz2 && \
cp -r llvm/* /opt/h2oai/h2o4gpu/ && \
Expand Down
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ help:
$(call inform, " -------- Build and Install ---------")
$(call inform, "make clean Clean all build files.")
$(call inform, "make fullinstall")
$(call inform, "make fullinstall Clean everything then compile and install everything (for cuda9 with nccl in xgboost).")
$(call inform, "make fullinstall Clean everything then compile and install including all(build and runtime) dependencies.")
$(call inform, "make buildinstall Compile and install including build dependencies only.")
$(call inform, "make build Just Build the whole project.")
$(call inform, " -------- Test ---------")
$(call inform, "make test Run tests.")
Expand Down Expand Up @@ -53,21 +54,27 @@ sync_open_data:
# DEPENDENCY MANAGEMENT TARGETS
#########################################

alldeps-install: deps_install fullinstall-xgboost fullinstall-lightgbm libsklearn
deps-install-with-all-pkgs: all_deps_install fullinstall-xgboost fullinstall-lightgbm libsklearn

alldeps: deps_fetch alldeps-install
deps-install-with-build-pkgs: build_deps_install fullinstall-xgboost fullinstall-lightgbm libsklearn

deps_fetch:
@echo "---- Fetch dependencies ---- "
submodule_update:
@echo "---- Fetch submudule dependencies ---- "
git submodule update --init --recursive

.PHONY: deps_py
deps_py:
cat src/interface_py/requirements_buildonly.txt > requirements.txt

deps_install:
@echo "---- Install dependencies ----"
cat src/interface_py/requirements_buildonly.txt > requirements.txt
build_deps_install:
@echo "---- Install build dependencies ----"
$(PYTHON) -m pip install -r src/interface_py/requirements_buildonly.txt
rm -rf requirements.txt
bash scripts/install_r_deps.sh

all_deps_install:
@echo "---- Install build and runtime dependencies ----"
awk 1 src/interface_py/requirements_buildonly.txt src/interface_py/requirements_runtime.txt > requirements.txt
$(PYTHON) -m pip install -r requirements.txt
rm -rf requirements.txt
bash scripts/install_r_deps.sh
Expand Down Expand Up @@ -123,8 +130,7 @@ lightgbm_gpu:
cd python-package && rm -rf dist && ($(PYTHON) setup.py sdist bdist_wheel || true) && cd .. && \
cd python-package && cd compile && (true || ln -fs ../../compute .) && cd ../../ && \
cd python-package && rm -rf dist && $(PYTHON) setup.py sdist bdist_wheel && cd .. && \
cd python-package && rm -rf dist_gpu && mv dist dist_gpu && \
$(PYTHON) -m pip install arff tqdm keras runipy h5py ; \
cd python-package && rm -rf dist_gpu && mv dist dist_gpu; \
fi

.PHONY: lightgbm_cpu
Expand Down Expand Up @@ -155,8 +161,7 @@ lightgbm_cpu:
cd python-package && rm -rf dist && ($(PYTHON) setup.py sdist bdist_wheel || true) && cd .. && \
cd python-package && cd compile && (true || ln -fs ../../compute .) && cd ../../ && \
cd python-package && rm -rf dist && $(PYTHON) setup.py sdist bdist_wheel && cd .. && \
cd python-package && rm -rf dist_cpu && mv dist dist_cpu && \
$(PYTHON) -m pip install arff tqdm keras runipy h5py
cd python-package && rm -rf dist_cpu && mv dist dist_cpu ;

fullinstall-lightgbm: lightgbm_gpu lightgbm_cpu install_lightgbm_gpu install_lightgbm_cpu

Expand Down Expand Up @@ -237,7 +242,7 @@ clean_deps:
@echo "----- Cleaning dependencies -----"
rm -rf "$(DEPS_DIR)"
# sometimes --upgrade leaves extra packages around
cat src/interface_py/requirements_buildonly.txt src/interface_py/requirements_runtime.txt src/interface_py/requirements_runtime_demos.txt > requirements.txt
awk 1 src/interface_py/requirements_*.txt > requirements.txt
sed 's/==.*//g' requirements.txt|grep -v "#" > requirements_plain.txt
-xargs -a requirements_plain.txt -n 1 -P $(NUMPROCS) $(PYTHON) -m pip uninstall -y
rm -rf requirements_plain.txt requirements.txt
Expand All @@ -249,10 +254,10 @@ clean_nccl:
# FULL BUILD AND INSTALL TARGETS
#########################################

fullinstall: clean alldeps build install
fullinstall: clean update_submodule deps-install-with-all-pkgs build install
mkdir -p src/interface_py/$(DIST_DIR)/$(PLATFORM)/ && mv src/interface_py/dist/*.whl src/interface_py/$(DIST_DIR)/$(PLATFORM)/

buildinstall: alldeps build install
buildinstall: deps-install-with-build-pkgs build install
mkdir -p src/interface_py/$(DIST_DIR)/$(PLATFORM)/ && mv src/interface_py/dist/*.whl src/interface_py/$(DIST_DIR)/$(PLATFORM)/

#########################################
Expand Down
4 changes: 2 additions & 2 deletions scripts/make-docker-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $DOCKER_CLI exec ${CONTAINER_NAME} bash -c 'mkdir -p repo ; cp -a /dot/. ./repo'

# workaround to not compile nccl every time
echo "init submodules ${H2O4GPU_BUILD} and ${H2O4GPU_SUFFIX}"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "cd repo && make ${makeopts} deps_fetch H2O4GPU_BUILD=${H2O4GPU_BUILD} H2O4GPU_SUFFIX=${H2O4GPU_SUFFIX}"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "cd repo && make ${makeopts} submodule_update H2O4GPU_BUILD=${H2O4GPU_BUILD} H2O4GPU_SUFFIX=${H2O4GPU_SUFFIX}"

echo "Docker devel - Copying nccl build artifacts"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c 'if [ $(git -C /nccl rev-parse HEAD) != $(git -C /root/repo rev-parse :nccl) ]; then echo "NCCL version mismatch in nccl submodule and docker file" && exit 1; fi;'
Expand Down Expand Up @@ -49,7 +49,7 @@ mkdir -p build ; $DOCKER_CLI cp ${CONTAINER_NAME}:/root/repo/build/VERSION.txt b
if [ `arch` != "ppc64le" ]; then
echo "Docker devel - Creating conda package"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "mkdir -p repo/condapkgs"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "cd repo/src/interface_py && awk 1 requirements_*.txt | grep -v '#' | sort | uniq > requirements_conda.txt"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "cd repo/src/interface_py && cat requirements_runtime.txt > requirements_conda.txt"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "pushd repo/conda-recipe && sed -i 's/condapkgname/${CONDA_PKG_NAME}/g' meta.yaml && popd"
$DOCKER_CLI exec ${CONTAINER_NAME} bash -c "pushd repo/conda-recipe && conda build --output-folder ../condapkgs -c h2oai -c conda-forge .&& popd"

Expand Down
29 changes: 3 additions & 26 deletions src/interface_py/requirements_buildonly.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
# testing code
apipkg==1.4
attrs==17.4.0
execnet==1.5.0
pluggy==0.8.1
py==1.5.2
six==1.11.0
yapf==0.17.0
coverage==4.4.1
# docs
numpydoc==0.8.0
sphinx==1.8.5
sphinx_rtd_theme==0.4.3
pillow==4.2.1
# compile wheel
wheel==0.33.4
cython==0.29.10
# for make testperf
h2o==3.18.0.11
pandas==0.24.2
numpy==1.16.4
scipy==1.3.1
# for some utilities
nbconvert==5.3.1
nbformat==4.4.0
notebook==5.7.8
# below for some tests
numba==0.38.0
feather-format==0.4.0
psutil==5.6.3
PyYAML==3.13
colorama==0.3.9
# below for sync with aws s3
awscli==1.16.192
# for pycharm
matplotlib==2.0.2
llvmlite==0.23.0
pyzmq==17.0.0
future==0.16.0
tabulate==0.8.2
joblib==0.14.0
# the same version as scikit-learn fork
scikit-learn==0.21.2
1 change: 1 addition & 0 deletions src/interface_py/requirements_runtime.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ scipy==1.3.1
tabulate==0.8.2
future==0.16.0
psutil==5.6.3
joblib==0.14.0
# the same version as scikit-learn fork
scikit-learn==0.21.2
4 changes: 2 additions & 2 deletions tests/python/open_data/ts/test_arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def test_arima(order, double):

print(model2.phi_, model2.theta_)

assert np.allclose(model1.phi_, model2.phi_, rtol=1e-4, atol=1e-7)
assert np.allclose(model1.theta_, model2.theta_, rtol=1e-4, atol=1e-7)
assert np.allclose(model1.phi_, model2.phi_, rtol=2e-4, atol=2e-7)
assert np.allclose(model1.theta_, model2.theta_, rtol=2e-4, atol=2e-7)


@pytest.mark.parametrize("order", [1, 2, 3, 4])
Expand Down