@@ -36,13 +36,9 @@ RUN mkdir /weights && curl --location https://pjreddie.com/media/files/yolov3.we
3636# Build Component
3737FROM ${BUILD_REGISTRY}openmpf_cpp_component_build:${BUILD_TAG} as build_component
3838
39- RUN yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64 \
40- && VERSION=9-0-9.0.176-1 \
41- && yum install -y --nogpgcheck cuda-minimal-build-$VERSION cuda-cublas-dev-$VERSION cuda-curand-dev-$VERSION \
39+ RUN yum install --nogpgcheck -y cuda-curand-dev-10-2 \
4240 && yum clean all \
43- && rm -rf /var/cache/yum/* \
44- && ln -s cuda-9.0 /usr/local/cuda \
45- && echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/cuda.conf
41+ && rm -rf /var/cache/yum/*;
4642
4743COPY . .
4844
@@ -53,18 +49,7 @@ RUN if [ "${RUN_TESTS,,}" == true ]; then cd $BUILD_DIR/test && ./DarknetDetecti
5349
5450
5551# ###################################################
56- FROM ${BUILD_REGISTRY}openmpf_cpp_executor:${BUILD_TAG}
57-
58- RUN yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64 \
59- && yum install -y --nogpgcheck cuda-cudart-9-0-9.0.176-1 \
60- && yum clean all \
61- && rm -rf /var/cache/yum/* \
62- && ln -s cuda-9.0 /usr/local/cuda \
63- && echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/cuda.conf
64-
65- # Environment variables required by nvidia runtime.
66- ENV NVIDIA_VISIBLE_DEVICES all
67- ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
52+ FROM ${BUILD_REGISTRY}openmpf_cpp_executor:${BUILD_TAG} as darknet_component
6853
6954COPY --from=download_weights /weights $PLUGINS_DIR/DarknetDetection/models
7055
@@ -83,3 +68,21 @@ LABEL org.label-schema.license="Apache 2.0" \
8368 org.label-schema.vcs-url="https://github.com/openmpf/openmpf-components" \
8469 org.label-schema.vendor="MITRE"
8570
71+
72+ # ###################################################
73+ FROM darknet_component as sample_executable
74+
75+ COPY --from=build_component $BUILD_DIR/sample_darknet_detector /opt/mpf/
76+
77+ COPY --from=build_component $BUILD_DIR/test/data /opt/mpf/test-data
78+
79+ RUN ln -s /opt/mpf/plugins /opt/mpf/plugin
80+
81+ ENV LD_LIBRARY_PATH $PLUGINS_DIR/DarknetDetection/lib
82+
83+ ENTRYPOINT ["/opt/mpf/sample_darknet_detector" ]
84+
85+
86+ # ###################################################
87+ # Set final image when no --target specified.
88+ FROM darknet_component
0 commit comments