Unverified Commit f565d443 authored by Min Xu's avatar Min Xu Committed by GitHub
Browse files

[fix]: CI and check_version (#475)

* [hotfix]: fix a bug in CI command

* debug

* debug

* bump cache ver

* fix

* eq

* check

* bump

* addressed comment
parent 5e64d6a7
......@@ -65,7 +65,7 @@ install_dep_151: &install_dep_151
command: |
sudo apt-get install -y libopenmpi-dev
# check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
python -c 'import torch; assert torch.__version__.split(".")[:2] != ["1", "5"]' || exit 0
if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.5 && exit 0; fi
# start installing
pip install --progress-bar off torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off -r requirements-test.txt
......@@ -73,6 +73,7 @@ install_dep_151: &install_dep_151
python -c 'import torch; print("Torch version:", torch.__version__)'
python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "5"], "wrong torch version"'
python -m torch.utils.collect_env
wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
install_dep_160: &install_dep_160
- run:
......@@ -80,7 +81,7 @@ install_dep_160: &install_dep_160
command: |
sudo apt-get install -y libopenmpi-dev
# check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
python -c 'import torch; assert torch.__version__.split(".")[:2] != ["1", "6"]' || exit 0
if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.6 && exit 0; fi
# start installing
pip install --progress-bar off torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off -r requirements-test.txt
......@@ -89,6 +90,7 @@ install_dep_160: &install_dep_160
python -c 'import torch; print("Torch version:", torch.__version__)'
python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "6"], "wrong torch version"'
python -m torch.utils.collect_env
wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
install_dep_171: &install_dep_171
- run:
......@@ -96,7 +98,7 @@ install_dep_171: &install_dep_171
command: |
sudo apt-get install -y libopenmpi-dev
# check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
python -c 'import torch; assert torch.__version__.split(".")[:2] != ["1", "7"]' || exit 0
if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.7 && exit 0; fi
# start installing
pip install --progress-bar off torch==1.7.1+cu101 torchvision==0.8.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off -r requirements-test.txt
......@@ -105,6 +107,7 @@ install_dep_171: &install_dep_171
python -c 'import torch; print("Torch version:", torch.__version__)'
python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "7"], "wrong torch version"'
python -m torch.utils.collect_env
wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
install_dep_171_cu110: &install_dep_171_cu110
- run:
......@@ -114,7 +117,7 @@ install_dep_171_cu110: &install_dep_171_cu110
sudo apt-get update
sudo apt-get install -y libopenmpi-dev
# check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
python -c 'import torch; assert torch.__version__.split(".")[:2] != ["1", "7"]' || exit 0
if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.7 && exit 0; fi
# start installing
pip install --progress-bar off torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off -r requirements-test.txt
......@@ -123,6 +126,7 @@ install_dep_171_cu110: &install_dep_171_cu110
python -c 'import torch; print("Torch version:", torch.__version__)'
python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "7"], "wrong torch version"'
python -m torch.utils.collect_env
wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
install_dep_180: &install_dep_180
- run:
......@@ -130,7 +134,7 @@ install_dep_180: &install_dep_180
command: |
sudo apt-get install -y libopenmpi-dev
# check if we have restored cache correctly, if so, just skip
python -c 'import torch; assert torch.__version__.split(".")[:2] != ["1", "8"]' || exit 0
if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.8 && exit 0; fi
# start installing
pip install --progress-bar off -r requirements-test.txt
# Since we are using nightly builds, we bypass the benchmarks req file
......@@ -146,8 +150,8 @@ install_dep_180: &install_dep_180
pip install --progress-bar off git+https://github.com/min-xu-ai/torch_pg.git@c723ab4#egg=torch-pg
python -c 'import torch; print("Torch version:", torch.__version__)'
python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "8"], "wrong torch version"'
pip list|grep torch
python -m torch.utils.collect_env
wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
install_repo_cpu: &install_repo_cpu
- run:
......
......@@ -80,3 +80,7 @@ if __name__ == "__main__":
"Operating System :: OS Independent",
],
)
# Bump this number if you want to force a CI cache invalidation on the pip venv.
# CI cache version: 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment