roll-ai commited on
Commit
f985c3e
·
verified ·
1 Parent(s): 5801db0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +47 -0
Dockerfile ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Use NVIDIA PyTorch container as base image
17
+ FROM nvcr.io/nvidia/pytorch:24.10-py3
18
+
19
+ # Install basic tools
20
+ RUN apt-get update && apt-get install -y git tree ffmpeg wget
21
+ RUN rm /bin/sh && ln -s /bin/bash /bin/sh && ln -s /lib64/libcuda.so.1 /lib64/libcuda.so
22
+
23
+ # Copy the cosmos-predict1.yaml and requirements.txt files to the container
24
+ COPY ./cosmos-predict1.yaml /cosmos-predict1.yaml
25
+ COPY ./requirements.txt /requirements.txt
26
+
27
+ # Install cosmos-predict1 dependencies. This will take a while.
28
+ RUN echo "Installing dependencies. This will take a while..." && \
29
+ mkdir -p ~/miniconda3 && \
30
+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
31
+ bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && \
32
+ rm ~/miniconda3/miniconda.sh && \
33
+ source ~/miniconda3/bin/activate && \
34
+ conda env create --file /cosmos-predict1.yaml && \
35
+ conda activate cosmos-predict1 && \
36
+ pip install --no-cache-dir -r /requirements.txt && \
37
+ ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/ && \
38
+ ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/python3.10 && \
39
+ ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/triton/backends/nvidia/include/* $CONDA_PREFIX/include/ && \
40
+ git clone https://github.com/NVIDIA/apex && cd apex && \
41
+ CUDA_HOME=$CONDA_PREFIX pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" . && \
42
+ pip install git+https://github.com/microsoft/MoGe.git && \
43
+ echo "Environment setup complete"
44
+
45
+
46
+ # Default command
47
+ CMD ["python", "app.py"]