Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +15 -38
Dockerfile
CHANGED
@@ -1,47 +1,24 @@
|
|
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 |
-
|
22 |
|
23 |
-
#
|
24 |
-
|
25 |
-
COPY ./requirements.txt /requirements.txt
|
26 |
|
27 |
-
#
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
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 |
-
|
47 |
-
|
|
|
|
|
|
1 |
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2 |
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
|
|
4 |
FROM nvcr.io/nvidia/pytorch:24.10-py3
|
5 |
|
6 |
# Install basic tools
|
7 |
+
RUN apt-get update && apt-get install -y git tree ffmpeg wget build-essential ninja-build && \
|
8 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
+
# Fix shell and CUDA link (optional for some systems)
|
11 |
+
RUN rm /bin/sh && ln -s /bin/bash /bin/sh && ln -s /lib64/libcuda.so.1 /lib64/libcuda.so || true
|
|
|
12 |
|
13 |
+
# Copy files into image
|
14 |
+
COPY cosmos-predict1.yaml /cosmos-predict1.yaml
|
15 |
+
COPY requirements.txt /requirements.txt
|
16 |
+
COPY app.py /app/app.py
|
17 |
+
COPY setup_runtime.sh /setup_runtime.sh
|
18 |
+
RUN chmod +x /setup_runtime.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
# Lightweight install to keep Hugging Face build stable
|
21 |
+
RUN pip install --no-cache-dir gradio==4.27.0
|
22 |
+
|
23 |
+
# Default command runs the heavy setup at runtime
|
24 |
+
CMD ["/bin/bash", "/setup_runtime.sh"]
|