@@ -98,12 +98,12 @@ def start_dockerfile(ddir, images, argmap, dockerfile_name, backends):
9898 # Copy over files
9999 df += """
100100WORKDIR /opt/tritonserver
101- COPY --chown=1000:1000 -- from=full /opt/tritonserver/LICENSE .
102- COPY --chown=1000:1000 -- from=full /opt/tritonserver/TRITON_VERSION .
103- COPY --chown=1000:1000 -- from=full /opt/tritonserver/NVIDIA_Deep_Learning_Container_License.pdf .
104- COPY --chown=1000:1000 -- from=full /opt/tritonserver/bin bin/
105- COPY --chown=1000:1000 -- from=full /opt/tritonserver/lib lib/
106- COPY --chown=1000:1000 -- from=full /opt/tritonserver/include include/
101+ COPY --from=full /opt/tritonserver/LICENSE .
102+ COPY --from=full /opt/tritonserver/TRITON_VERSION .
103+ COPY --from=full /opt/tritonserver/NVIDIA_Deep_Learning_Container_License.pdf .
104+ COPY --from=full /opt/tritonserver/bin bin/
105+ COPY --from=full /opt/tritonserver/lib lib/
106+ COPY --from=full /opt/tritonserver/include include/
107107"""
108108 with open (os .path .join (ddir , dockerfile_name ), "w" ) as dfile :
109109 dfile .write (df )
@@ -112,47 +112,32 @@ def start_dockerfile(ddir, images, argmap, dockerfile_name, backends):
112112def add_requested_backends (ddir , dockerfile_name , backends ):
113113 df = "# Copying over backends \n "
114114 for backend in backends :
115- df += """COPY --chown=1000:1000 -- from=full /opt/tritonserver/backends/{} /opt/tritonserver/backends/{}
115+ df += """COPY --from=full /opt/tritonserver/backends/{} /opt/tritonserver/backends/{}
116116""" .format (
117117 backend , backend
118118 )
119- if len (backends ) > 0 :
120- df += """
121- # Top-level /opt/tritonserver/backends not copied so need to explicitly set permissions here
122- RUN chown triton-server:triton-server /opt/tritonserver/backends
123- """
124119 with open (os .path .join (ddir , dockerfile_name ), "a" ) as dfile :
125120 dfile .write (df )
126121
127122
128123def add_requested_repoagents (ddir , dockerfile_name , repoagents ):
129124 df = "# Copying over repoagents \n "
130125 for ra in repoagents :
131- df += """COPY --chown=1000:1000 -- from=full /opt/tritonserver/repoagents/{} /opt/tritonserver/repoagents/{}
126+ df += """COPY --from=full /opt/tritonserver/repoagents/{} /opt/tritonserver/repoagents/{}
132127""" .format (
133128 ra , ra
134129 )
135- if len (repoagents ) > 0 :
136- df += """
137- # Top-level /opt/tritonserver/repoagents not copied so need to explicitly set permissions here
138- RUN chown triton-server:triton-server /opt/tritonserver/repoagents
139- """
140130 with open (os .path .join (ddir , dockerfile_name ), "a" ) as dfile :
141131 dfile .write (df )
142132
143133
144134def add_requested_caches (ddir , dockerfile_name , caches ):
145135 df = "# Copying over caches \n "
146136 for cache in caches :
147- df += """COPY --chown=1000:1000 -- from=full /opt/tritonserver/caches/{} /opt/tritonserver/caches/{}
137+ df += """COPY --from=full /opt/tritonserver/caches/{} /opt/tritonserver/caches/{}
148138""" .format (
149139 cache , cache
150140 )
151- if len (caches ) > 0 :
152- df += """
153- # Top-level /opt/tritonserver/caches not copied so need to explicitly set permissions here
154- RUN chown triton-server:triton-server /opt/tritonserver/caches
155- """
156141 with open (os .path .join (ddir , dockerfile_name ), "a" ) as dfile :
157142 dfile .write (df )
158143
@@ -163,7 +148,7 @@ def end_dockerfile(ddir, dockerfile_name, argmap):
163148 if argmap ["SAGEMAKER_ENDPOINT" ]:
164149 df += """
165150LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
166- COPY --chown=1000:1000 -- from=full /usr/bin/serve /usr/bin/.
151+ COPY --from=full /usr/bin/serve /usr/bin/.
167152"""
168153 with open (os .path .join (ddir , dockerfile_name ), "a" ) as dfile :
169154 dfile .write (df )
0 commit comments