Revision 29f57ea55d0293790befeace48698dbef7be24e6 authored by Amanpreet Singh on 30 March 2021, 07:54:53 UTC, committed by Facebook GitHub Bot on 30 March 2021, 07:55:36 UTC
Summary:
Pull Request resolved: https://github.com/facebookresearch/mmf/pull/838

Test reporter config as opposed to original design should be a top level config node as it is not specific to one dataset but encompasses all datasets in one go. This diff refactors that to be a top level config node so that it is not per dataset config which conflicts with overall definition of test reporter.

Reviewed By: madian9

Differential Revision: D27301920

fbshipit-source-id: 6a990cd23c837fb915398a5930b9e348ff4cd626
1 parent a094ad7
Raw File
config.yml
# Use 2.1 for orbs
version: 2.1

# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
gpu: &gpu
  environment:
    CUDA_VERSION: "10.2"
  machine:
    image: ubuntu-1604:201903-01
  resource_class: gpu.medium

# -------------------------------------------------------------------------------------
# Re-usable commands
# -------------------------------------------------------------------------------------
cache_key: &cache_key cache-key-{{ .Environment.CIRCLE_JOB }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "setup.py"}}-{{ checksum "requirements.txt"}}

install_dep: &install_dep
  - run:
      name: Install Dependencies
      command: |
        source activate mmf
        pip install --upgrade setuptools
        pip install --upgrade torch torchvision
        pip install --progress-bar off flake8==3.7.9
        pip install --progress-bar off black==19.3b0
        pip install --progress-bar off isort==4.3.21
        pip install --progress-bar off pytest
        pip install --progress-bar off fairscale==0.1.7
        python setup.py clean --all
        python setup.py install
        python -c 'import torch; print("Torch version:", torch.__version__)'
        python -m torch.utils.collect_env


install_repo: &install_repo
  - run:
      name: Install Repository
      command: |
        source activate mmf
        python setup.py build develop

run_unittests: &run_unittests
  - run:
      name: Run Unit Tests
      command: |
        source activate mmf
        cd tests
        pytest --junitxml=test-results/junit.xml -v .

install_nvidia_driver: &install_nvidia_driver
  - run:
      name: Install NVIDIA Driver
      working_directory: ~/
      command: |
        wget -q --no-clobber -P ~/nvidia-downloads 'https://pytorch-ci-utils.s3.us-east-2.amazonaws.com/nvidia-drivers/NVIDIA-Linux-x86_64-440.64.run'
        sudo /bin/bash ~/nvidia-downloads/NVIDIA-Linux-x86_64-440.64.run -s --no-drm
        pyenv versions
        nvidia-smi
        pyenv global 3.7.0

create_conda_env: &create_conda_env
  - run:
      name: Install and Create Conda Environment
      command: |
        curl -o ~/miniconda.sh -O  https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
        chmod +x ~/miniconda.sh
        ~/miniconda.sh -b -p $HOME/miniconda
        rm ~/miniconda.sh
        echo 'export PATH=$HOME/miniconda/bin:$PATH' >> $BASH_ENV
        source $BASH_ENV
        if [ ! -d ~/miniconda/envs/mmf ]
        then
          conda create -y -n mmf python=3.7
        fi
        source activate mmf
        python --version
        which python
        which pip
        pip install --upgrade pip


# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
  # GPU config initially taken from detectron2
  gpu_tests:
    <<: *gpu

    working_directory: ~/mmf

    steps:
      - checkout

      # Cache the nvidia driver downloads
      - restore_cache:
          key: nvidia-downloads-v4
      - <<: *install_nvidia_driver
      - save_cache:
          key: nvidia-downloads-v4
          paths:
            - "~/nvidia-downloads/"
      - <<: *create_conda_env
      - restore_cache:
          key: *cache_key
      - <<: *install_dep
      # Cache the miniconda directory that contains dependencies
      - save_cache:
          paths:
            - ~/miniconda/
          key: *cache_key
      - <<: *install_repo
      - <<: *run_unittests
      - store_test_results:
          path: tests/test-results

workflows:
  version: 2
  build:
    jobs:
      - gpu_tests
back to top