use docker runner & cache for cpu tests
Summary: Pull Request resolved:
Test Plan:
@@ -8,8 +8,8 @@ version: 2
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
cpu: &cpu
- machine:
- image: ubuntu-1604:201903-01
+ docker:
+ - image: circleci/python:3.6.2
resource_class: medium
gpu: &gpu
@@ -29,6 +29,12 @@ install_python: &install_python
command: |
pyenv install 3.6.1
pyenv global 3.6.1
+
+setup_venv: &setup_venv
+ - run:
+ name: Setup Virtual Env
+ working_directory: ~/
+ command: |
python -m venv ~/venv
echo ". ~/venv/bin/activate" >> $BASH_ENV
. ~/venv/bin/activate
@@ -41,9 +47,9 @@ install_dep: &install_dep
- run:
name: Install Dependencies
command: |
- pip install -U 'git+https://github.com/facebookresearch/fvcore'
- pip install cython opencv-python
- pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
+ pip install --progress-bar off -U 'git+https://github.com/facebookresearch/fvcore'
+ pip install --progress-bar off cython opencv-python
+ pip install --progress-bar off 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
pip install --progress-bar off torch torchvision
install_detectron2: &install_detectron2
@@ -71,8 +77,20 @@ jobs:
steps:
- checkout
- - <<: *install_python
+ - <<: *setup_venv
+
+ # Cache the venv directory that contains dependencies
+ - restore_cache:
+ keys:
+ - cache-key-{{ .Branch }}-ID-0
+
- <<: *install_dep
+
+ - save_cache:
+ paths:
+ - ~/venv
+ key: cache-key-{{ .Branch }}-ID-0
+
- <<: *install_detectron2
- run:
@@ -98,6 +116,7 @@ jobs:
steps:
- checkout
- <<: *install_python
+ - <<: *setup_venv
- run:
name: Setup CUDA
