Skip to content

Commit d55a50d

Browse files
authored
Add missing deps and CI (#400)
1 parent 3aac785 commit d55a50d

File tree

4 files changed

+61
-10
lines changed

4 files changed

+61
-10
lines changed

Diff for: .dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.*
3+
!.git
4+
!.gitignore
5+
!.gitmodules

Diff for: .github/workflows/ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build-and-smoketest:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
19+
- name: Build Docker image
20+
run: docker build --tag gpudrive:latest .
21+
22+
- name: Run smoke test inside Docker container
23+
run: |
24+
docker run --rm gpudrive:latest /bin/bash -c "
25+
echo 'Dummy cuda' \
26+
&& ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
27+
&& export LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH \
28+
&& echo 'Modifications to run without extra data' \
29+
&& sed -i 's|train_path: \"data/processed/training\"|train_path: \"data/processed/examples\"|g' examples/experimental/config/visualization_config.yaml \
30+
&& sed -i '/# Load policy/{N;N;N;N;N;N;s|# Load policy\n policy = load_policy(\n path_to_cpt=config.cpt_path,\n model_name=config.cpt_name,\n device=config.device,\n env=env,\n )|from gpudrive.networks.late_fusion import NeuralNet\n policy = NeuralNet.from_pretrained(\"daphne-cornelisse/policy_S10_000_02_27\")|}' examples/experimental/viz_rollouts.py \
31+
&& echo 'Modifications to run without GPU' \
32+
&& sed -i 's/device=\"cuda\"/device=\"cpu\"/g' gpudrive/datatypes/observation.py \
33+
&& python examples/experimental/viz_rollouts.py
34+
"

Diff for: Dockerfile

+19-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
44
ARG DEBIAN_FRONTEND=noninteractive
55

66
# Install essential packages
7-
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
RUN apt-get update && apt-get install -y -q --no-install-recommends \
88
software-properties-common \
99
build-essential \
1010
cmake \
@@ -22,35 +22,44 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222
libxi-dev \
2323
mesa-common-dev \
2424
libc++1 \
25-
openssh-client && \
26-
rm -rf /var/lib/apt/lists/*
25+
openssh-client \
26+
ffmpeg \
27+
&& apt-get clean \
28+
&& rm -rf /var/lib/apt/lists/*
2729

2830
# Install Python 3.11
2931
RUN apt-add-repository -y ppa:deadsnakes/ppa \
30-
&& apt-get install -y python3.11 python3.11-dev python3.11-distutils
32+
&& apt-get install -y -q --no-install-recommends python3.11 python3.11-dev python3.11-distutils \
33+
&& apt-get clean \
34+
&& rm -rf /var/lib/apt/lists/*
3135

3236
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
3337

3438
# Set Python 3.11 as default
3539
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 11 && \
3640
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 11
3741

38-
RUN apt-get remove -y cmake && pip3 install --upgrade cmake
42+
RUN apt-get remove -y cmake && pip3 install --no-cache-dir --upgrade cmake
43+
44+
# Copy the gpudrive repository
45+
COPY . /gpudrive
46+
WORKDIR /gpudrive
47+
RUN git submodule update --init --recursive --depth 1
3948

40-
# Clone the gpudrive repository
41-
RUN git clone --recursive https://github.com/Emerge-Lab/gpudrive.git --branch dev-packaged
4249
ENV MADRONA_MWGPU_KERNEL_CACHE=./gpudrive_cache
4350

44-
WORKDIR /gpudrive
4551
RUN mkdir build
4652
WORKDIR /gpudrive/build
47-
RUN cmake .. -DCMAKE_BUILD_TYPE=Release
53+
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && find external -type f -name "*.tar" -delete
4854
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
4955
RUN LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH make -j
5056
RUN rm /usr/local/cuda/lib64/stubs/libcuda.so.1
5157
WORKDIR /gpudrive
5258

53-
RUN pip3 install -e .[pufferlib]
59+
RUN pip3 install --no-cache-dir torch==2.6.0 && rm -rf ~/.cache/pip/*
60+
RUN pip3 install --no-cache-dir tensorflow==2.19.0 && rm -rf ~/.cache/pip/*
61+
RUN pip3 install --no-cache-dir nvidia-cuda-runtime-cu12==12.4.127 && rm -rf ~/.cache/pip/*
62+
RUN pip3 install --no-cache-dir -e .[vbd,pufferlib]
5463

5564
CMD ["/bin/bash"]
5665
LABEL org.opencontainers.image.source=https://github.com/Emerge-Lab/gpudrive

Diff for: pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ dependencies = [
3636
"seaborn",
3737
"safetensors",
3838
"python-box",
39+
"tqdm",
40+
"jax",
41+
"huggingface_hub",
3942
]
4043

4144
[project.optional-dependencies]

0 commit comments

Comments
 (0)