@@ -11,7 +11,7 @@ ENV PYTORCH_ROCM_ARCH ${PYTORCH_ROCM_ARCH}
11
11
12
12
# Install common dependencies (so that this step can be cached separately)
13
13
ARG EC2
14
- ADD ./common/install_base.sh install_base.sh
14
+ COPY ./common/install_base.sh install_base.sh
15
15
RUN bash ./install_base.sh && rm install_base.sh
16
16
17
17
#Install langpack
@@ -31,49 +31,55 @@ RUN dnf --enablerepo=crb install -y ninja-build
31
31
32
32
# (optional) Install non-default glibc version
33
33
ARG GLIBC_VERSION
34
- ADD ./common/install_glibc.sh install_glibc.sh
34
+ COPY ./common/install_glibc.sh install_glibc.sh
35
35
RUN if [ -n "${GLIBC_VERSION}" ]; then bash ./install_glibc.sh; fi
36
36
RUN rm install_glibc.sh
37
37
38
38
# Install user
39
- ADD ./common/install_user.sh install_user.sh
39
+ COPY ./common/install_user.sh install_user.sh
40
40
RUN bash ./install_user.sh && rm install_user.sh
41
41
42
42
# Install conda and other packages (e.g., numpy, pytest)
43
- ENV PATH /opt/conda/bin:$PATH
44
43
ARG ANACONDA_PYTHON_VERSION
45
44
ARG CONDA_CMAKE
46
- ADD requirements-ci.txt /opt/conda/requirements-ci.txt
47
- ADD ./common/install_conda.sh install_conda.sh
48
- RUN bash ./install_conda.sh && rm install_conda.sh
49
- RUN rm /opt/conda/requirements-ci.txt
45
+ ENV ANACONDA_PYTHON_VERSION=$ANACONDA_PYTHON_VERSION
46
+ ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH
47
+ COPY requirements-ci.txt /opt/conda/requirements-ci.txt
48
+ COPY ./common/install_conda.sh install_conda.sh
49
+ COPY ./common/common_utils.sh common_utils.sh
50
+ RUN bash ./install_conda.sh && rm install_conda.sh common_utils.sh /opt/conda/requirements-ci.txt
50
51
51
52
# (optional) Install protobuf for ONNX
52
53
ARG PROTOBUF
53
- ADD ./common/install_protobuf.sh install_protobuf.sh
54
+ COPY ./common/install_protobuf.sh install_protobuf.sh
54
55
RUN if [ -n "${PROTOBUF}" ]; then bash ./install_protobuf.sh; fi
55
56
RUN rm install_protobuf.sh
56
57
ENV INSTALLED_PROTOBUF ${PROTOBUF}
57
58
58
59
# (optional) Install database packages like LMDB and LevelDB
59
60
ARG DB
60
- ADD ./common/install_db.sh install_db.sh
61
+ COPY ./common/install_db.sh install_db.sh
61
62
RUN if [ -n "${DB}" ]; then bash ./install_db.sh; fi
62
63
RUN rm install_db.sh
63
64
ENV INSTALLED_DB ${DB}
64
65
65
66
# (optional) Install vision packages like OpenCV and ffmpeg
66
67
ARG VISION
67
- ADD ./common/install_vision.sh install_vision.sh
68
+ COPY ./common/install_vision.sh ./common/cache_vision_models.sh ./common/common_utils.sh ./
68
69
RUN if [ -n "${VISION}" ]; then bash ./install_vision.sh; fi
69
- RUN rm install_vision.sh
70
+ RUN rm install_vision.sh cache_vision_models.sh common_utils.sh
70
71
ENV INSTALLED_VISION ${VISION}
71
72
72
73
# Install rocm
73
74
ARG ROCM_VERSION
74
- ADD ./common/install_rocm.sh install_rocm.sh
75
+ COPY ./common/install_rocm.sh install_rocm.sh
75
76
RUN bash ./install_rocm.sh
76
77
RUN rm install_rocm.sh
78
+ COPY ./common/install_rocm_magma.sh install_rocm_magma.sh
79
+ RUN bash ./install_rocm_magma.sh
80
+ RUN rm install_rocm_magma.sh
81
+
82
+ ENV ROCM_PATH /opt/rocm
77
83
ENV PATH /opt/rocm/bin:$PATH
78
84
ENV PATH /opt/rocm/hcc/bin:$PATH
79
85
ENV PATH /opt/rocm/hip/bin:$PATH
@@ -85,18 +91,30 @@ ENV LC_ALL en_US.utf8
85
91
86
92
# (optional) Install non-default CMake version
87
93
ARG CMAKE_VERSION
88
- ADD ./common/install_cmake.sh install_cmake.sh
94
+ COPY ./common/install_cmake.sh install_cmake.sh
89
95
RUN if [ -n "${CMAKE_VERSION}" ]; then bash ./install_cmake.sh; fi
90
96
RUN rm install_cmake.sh
91
97
92
98
# (optional) Install non-default Ninja version
93
99
ARG NINJA_VERSION
94
- ADD ./common/install_ninja.sh install_ninja.sh
100
+ COPY ./common/install_ninja.sh install_ninja.sh
95
101
RUN if [ -n "${NINJA_VERSION}" ]; then bash ./install_ninja.sh; fi
96
102
RUN rm install_ninja.sh
97
103
104
+ ARG TRITON
105
+ # Install triton, this needs to be done before sccache because the latter will
106
+ # try to reach out to S3, which docker build runners don't have access
107
+ ENV CMAKE_C_COMPILER cc
108
+ ENV CMAKE_CXX_COMPILER c++
109
+ COPY ./common/install_triton.sh install_triton.sh
110
+ COPY ./common/common_utils.sh common_utils.sh
111
+ COPY ci_commit_pins/triton-rocm.txt triton-rocm.txt
112
+ COPY triton_version.txt triton_version.txt
113
+ RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
114
+ RUN rm install_triton.sh common_utils.sh triton-rocm.txt triton_version.txt
115
+
98
116
# Install ccache/sccache (do this last, so we get priority in PATH)
99
- ADD ./common/install_cache.sh install_cache.sh
117
+ COPY ./common/install_cache.sh install_cache.sh
100
118
ENV PATH /opt/cache/bin:$PATH
101
119
RUN bash ./install_cache.sh && rm install_cache.sh
102
120
0 commit comments