Skip to content

Commit 26e44cb

Browse files
aclegg30mdc
andauthored
[BE] github actions migration (#2422)
* add github actions and workflows --------- Co-authored-by: Mikael Dallaire Cote <110583667+0mdc@users.noreply.github.com>
1 parent 0a0887e commit 26e44cb

5 files changed

Lines changed: 541 additions & 2 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: download_test_data
2+
runs:
3+
using: composite
4+
steps:
5+
- name: download_test_data
6+
run: |
7+
# Disable clone protection for git lfs
8+
export GIT_CLONE_PROTECTION_ACTIVE=false
9+
10+
git --version
11+
git-lfs --version
12+
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
13+
conda init
14+
source ~/.bashrc
15+
conda activate habitat
16+
conda install -y gitpython git-lfs
17+
cd habitat-sim
18+
git lfs install
19+
python src_python/habitat_sim/utils/datasets_download.py --uids ci_test_assets ycb rearrange_dataset_v2 --replace --data-path data/ --no-prune
20+
ls -la data/scene_datasets/habitat-test-scenes/
21+
shell: bash -el {0}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: install_ubuntu_deps
2+
runs:
3+
using: composite
4+
steps:
5+
- name: install cmake
6+
# OpenEXR requires CMake 3.12. We also download CMake 3.20, which
7+
# we'll use later for the JS build only.
8+
run: |
9+
echo $(date +%F) > ./date
10+
echo $(git ls-remote https://github.com/facebookresearch/habitat-lab.git HEAD | awk '{ print $1}') > ./hablab_sha
11+
cat ./hablab_sha
12+
wget https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh
13+
sudo mkdir /opt/cmake312
14+
sudo sh ./cmake-3.12.4-Linux-x86_64.sh --prefix=/opt/cmake312 --skip-license
15+
sudo ln -s /opt/cmake312/bin/cmake /usr/local/bin/cmake
16+
sudo ln -s /opt/cmake312/bin/ctest /usr/local/bin/ctest
17+
shell: bash
18+
- name: Install dependencies
19+
run: |-
20+
echo "Install dependencies"
21+
sudo apt-get update || true
22+
sudo apt-get install -y --no-install-recommends \
23+
build-essential \
24+
git \
25+
git-lfs \
26+
curl \
27+
vim \
28+
ca-certificates \
29+
libjpeg-dev \
30+
libglm-dev \
31+
libegl1-mesa-dev \
32+
ninja-build \
33+
xorg-dev \
34+
freeglut3-dev \
35+
pkg-config \
36+
wget \
37+
zip \
38+
lcov\
39+
libhdf5-dev \
40+
libomp-dev \
41+
unzip || true
42+
shell: bash
43+
- name: Setup miniconda
44+
uses: conda-incubator/setup-miniconda@v3.0.1
45+
with:
46+
miniconda-version: "latest"
47+
python-version: "3.9"
48+
activate-environment: "habitat"
49+
- name: Install conda and dependencies
50+
run: |-
51+
echo "Install conda and dependencies"
52+
conda install -y pytorch==1.12.1 torchvision==0.13.1 -c pytorch -c nvidia
53+
conda install -y -c conda-forge ninja numpy pytest pytest-cov ccache hypothesis pytest-mock
54+
pip install pytest-sugar pytest-xdist pytest-benchmark opencv-python cython mock
55+
shell: bash -el {0}
56+
- name: Validate Pytorch Installation
57+
run: |-
58+
echo "Validate Pytorch Installation"
59+
# Check that pytorch is installed with CUDA.
60+
python -c 'import torch; torch.cuda.set_device(0)'
61+
shell: bash -el {0}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This action installs required Ubuntu NVIDIA dependencies.
2+
# It assumes that `nvidia-smi` is available on the system.
3+
name: "Install GPU Dependencies"
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Install GPU Dependencies
8+
shell: bash
9+
run: |
10+
NVIDIA_SMI_OUTPUT=$(nvidia-smi)
11+
# Extract CUDA version (e.g., 11.7)
12+
CUDA_VERSION=$(echo "$NVIDIA_SMI_OUTPUT" | grep -oP 'CUDA Version:\s+\K[\d.]+')
13+
14+
FULL_DRIVER_VERSION=$(echo "$NVIDIA_SMI_OUTPUT" | grep -oP 'Driver Version:\s+\K[\d.]+')
15+
MAJOR_DRIVER_VERSION=$(echo "$NVIDIA_SMI_OUTPUT" | grep -oP 'Driver Version:\s+\K\d+')
16+
UBUNTU_PACKAGE_SUFFIX="${MAJOR_DRIVER_VERSION}=${FULL_DRIVER_VERSION}-0ubuntu1"
17+
sudo apt-get update
18+
sudo apt-get install -y cuda-toolkit-${CUDA_VERSION}
19+
sudo apt-get install -y nvidia-gds-${CUDA_VERSION}
20+
sudo apt-get install -y libnvidia-common-${UBUNTU_PACKAGE_SUFFIX}
21+
sudo apt-get install -y libnvidia-gl-${UBUNTU_PACKAGE_SUFFIX}
22+
sudo apt-get install -y libnvidia-compute-${UBUNTU_PACKAGE_SUFFIX} --allow-downgrades
23+
sudo apt-get install -y libnvidia-decode-${UBUNTU_PACKAGE_SUFFIX}
24+
sudo apt-get install -y libnvidia-encode-${UBUNTU_PACKAGE_SUFFIX}

0 commit comments

Comments
 (0)