Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:kubic:ei-demo
cloud-native-demos
cloud-native-demos.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cloud-native-demos.spec of Package cloud-native-demos
# # spec file for package cloud-native-demos # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define registry registry.opensuse.org/devel/kubic/ei-demo/container Name: cloud-native-demos Version: 20200227 %define cdn_version 0.0+git20200227.1505f36 Release: 0 Summary: Cloud Native Demos based on Clear Linux License: Apache-2.0 URL: https://github.com/clearlinux/cloud-native-demos Source: cloud-native-demos-%{cdn_version}.tar.xz Source1: node_modules.tar.xz Source2: ei-wss-user.conf Source3: ei-fss-user.conf Source4: ei-ois-user.conf Source5: ei-gws-user.conf Source6: sample-videos-ogv.tar.gz Source7: Edge-optimized-models-1.0+git20181031.0ec78ac.tar.xz Source8: openSUSE-Kubic-Logo.png Source11: camera-stream.service Source12: sysconfig.camera-stream-service Source99: cloud-native-demos-rpmlintrc Patch1: gws-kubic-layout.patch Patch2: revert_infer_model.patch Patch3: run-css.patch Patch4: make-infer-device-configureable.patch Patch5: no-libcpu_extension.patch BuildRequires: npm >= 10 BuildRequires: sysuser-shadow BuildRequires: sysuser-tools BuildRequires: pandoc BuildRequires: k8s-yaml-splitter BuildRequires: fdupes %description This project includes several cloud native demos based Clear Linux Containers. %package -n elastic-inference-demo-doc Summary: Documentation for elastic inference demo internal BuildArch: noarch %description -n elastic-inference-demo-doc This package contains documentation about the interna of the elastic inference demo. %package -n elastic-inference-demo-k8s-yaml Summary: Kubernetes yaml file to run elastic inference demo BuildArch: noarch %description -n elastic-inference-demo-k8s-yaml This package contains the yaml files requried to download and run the elastic inference demo on a kubernetes cluster. %package -n elastic-inference-camera-stream Summary: Stream webcam into elastic inference cluster Requires: podman Requires(post): %fillup_prereq BuildArch: noarch %description -n elastic-inference-camera-stream This package contains the script to run the ei-camera-stream-service, to stream a webcam live into a elatic infernece cluster for face, people and car recognition. %package ei-wss Summary: EI Websocket Server Requires: python3-aioredis Requires: python3-websockets %sysusers_requires %description ei-wss Code for ei websocket server container image %package ei-gws Summary: EI Gateway Server Requires: python3-Flask Requires: python3-redis Conflicts: %{name}-ei-css Conflicts: %{name}-ei-fss Conflicts: %{name}-ei-ois %sysusers_requires %description ei-gws Code for ei gateway server image %package ei-fss Summary: EI File Stream Service Requires: gstreamer-plugins-good Requires: gstreamer-plugins-libav Requires: python3-msgpack Requires: python3-numpy Requires: python3-opencv Requires: python3-redis Conflicts: %{name}-ei-css Conflicts: %{name}-ei-gws Conflicts: %{name}-ei-ois %sysusers_requires %description ei-fss Code for ei file stream service image %package ei-ois Summary: EI Openvino Inference Service Requires: python3-dldt Requires: python3-msgpack Requires: python3-numpy Requires: python3-opencv Requires: python3-prometheus_client Requires: python3-redis Conflicts: %{name}-ei-css Conflicts: %{name}-ei-fss Conflicts: %{name}-ei-gws %sysusers_requires %description ei-ois Code for ei inference service container image %package ei-css Summary: EI Camera Stream Service Requires: gstreamer-plugins-good Requires: python3-msgpack Requires: python3-numpy Requires: python3-opencv Requires: python3-redis Conflicts: %{name}-ei-fss Conflicts: %{name}-ei-gws Conflicts: %{name}-ei-ois %description ei-css Code for ei camera stream service container image %prep %setup -q -a6 -a7 -n cloud-native-demos-%{cdn_version} %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %build %sysusers_generate_pre %{SOURCE2} wssuser %sysusers_generate_pre %{SOURCE3} fssuser %sysusers_generate_pre %{SOURCE4} oisuser %sysusers_generate_pre %{SOURCE5} gwsuser pushd elastic_inference/spa tar xf %{SOURCE1} npm run init npm run build %ifarch x86_64 %define ARCHITECTURE x86-64 %else %ifarch aarch64 %define ARCHITECTURE ARM64 %else %define ARCHITECTURE %{_target_cpu} %endif %endif sed -i -e 's|__CPU__|%{ARCHITECTURE}|g' dist/0.*chunk.js* sed -i -e 's|__CPU__|%{ARCHITECTURE}|g' dist/main.*js* cp %{SOURCE8} dist/ # Fix permissions chmod 644 dist/main.*.css popd pushd elastic_inference/doc for i in *.md ; do pandoc -s -f markdown -t html ${i} -o ${i}.html done cd .. pandoc -s -f markdown -t html README.md -o index.html popd %install mkdir -p %{buildroot}/apps mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_unitdir} install -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/ mkdir -p %{buildroot}%{_fillupdir} install -m 644 %{SOURCE12} %{buildroot}%{_fillupdir}/ mkdir -p %{buildroot}%{_sysusersdir} install -m 755 elastic_inference/tools/run-css.sh %{buildroot}%{_bindir}/run-ei-camera-stream-service install -m 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/ install -m 644 %{SOURCE3} %{buildroot}%{_sysusersdir}/ install -m 644 %{SOURCE4} %{buildroot}%{_sysusersdir}/ install -m 644 %{SOURCE5} %{buildroot}%{_sysusersdir}/ install -m 755 elastic_inference/apps/websocket_server.py %{buildroot}/apps/ install -m 755 elastic_inference/apps/file_stream_service.py %{buildroot}/apps/ install -m 755 elastic_inference/apps/gateway_server.py %{buildroot}/apps/ install -m 755 elastic_inference/apps/infer_service.py %{buildroot}/apps/ install -m 755 elastic_inference/apps/camera_stream_service.py %{buildroot}/apps/ cp -av elastic_inference/apps/clcn %{buildroot}/apps/ cp -av elastic_inference/spa/dist %{buildroot} cp -av sample-videos %{buildroot}/ mkdir -p %{buildroot}/models/SqueezeNet\ 5-Class\ detection/ cp -av Edge-optimized-models-1.0*/SqueezeNet\ 5-Class\ detection/* %{buildroot}/models/SqueezeNet\ 5-Class\ detection/ echo -e "Bicycle\nBus\nCar\nMotorbike\nPerson" > %{buildroot}/models/SqueezeNet\ 5-Class\ detection/FP32/SqueezeNetSSD-5Class.labels mkdir -p %{buildroot}/models/MobileNet\ 5-Class\ detection/ cp -av Edge-optimized-models-1.0*/MobileNet\ 5-Class\ detection/* %{buildroot}/models/MobileNet\ 5-Class\ detection/ echo -e "Bicycle\nBus\nCar\nMotorbike\nPerson" > %{buildroot}/models/MobileNet\ 5-Class\ detection/FP32/MobileNetSSD-5Class.labels # XXX Fix permissions chmod 644 %{buildroot}"/models/MobileNet 5-Class detection/README.md" cp Edge-optimized-models-1.0*/LICENSE.txt %{buildroot}/models cp Edge-optimized-models-1.0*/LICENSE.txt LICENSE.Edge-optimized-models # Install yaml files mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-int8 mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-fp32 mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/{car,face,all}-int8 mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/{car,face,all}-fp32 mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/people # elastic-inference.yaml sed -e 's|your-own-registry|%{registry}|g' -e 's|clearlinux/redis|registry.opensuse.org/opensuse/redis:latest|g' -e 's|clearlinux-redis|opensuse-redis|g' -e 's|busybox:.*|registry.opensuse.org/opensuse/busybox:latest|g' elastic_inference/kubernetes/elastic-inference.yaml.template | k8s-yaml-splitter mv -v .k8s-yaml-splitter/*int8* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-int8 mv -v .k8s-yaml-splitter/*fp32* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-fp32 cp -v .k8s-yaml-splitter/*.yaml %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-int8/ cp -v .k8s-yaml-splitter/*.yaml %{buildroot}%{_datadir}/k8s-yaml/ei-demo/base-fp32/ rm -rf .k8s-yaml-splitter # sample-car.yaml sed -e 's|your-own-registry|%{registry}|g' -e 's|busybox:1.31|registry.opensuse.org/opensuse/busybox:latest|g' -e 's|.mp4|.ogv|g' elastic_inference/kubernetes/sample-infer/sample-car.yaml.template | k8s-yaml-splitter mv -v .k8s-yaml-splitter/*int8* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/car-int8 mv -v .k8s-yaml-splitter/*fp32* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/car-fp32 rm -rf .k8s-yaml-splitter # sample-face.yaml sed -e 's|your-own-registry|%{registry}|g' -e 's|busybox:1.31|registry.opensuse.org/opensuse/busybox:latest|g' -e 's|.mp4|.ogv|g' elastic_inference/kubernetes/sample-infer/sample-face.yaml.template | k8s-yaml-splitter mv -v .k8s-yaml-splitter/*int8* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/face-int8 mv -v .k8s-yaml-splitter/*fp32* %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/face-fp32 rm -rf .k8s-yaml-splitter # sample-people.yaml sed -e 's|your-own-registry|%{registry}|g' -e 's|busybox:1.31|registry.opensuse.org/opensuse/busybox:latest|g' -e 's|.mp4|.ogv|g' elastic_inference/kubernetes/sample-infer/sample-people.yaml.template | k8s-yaml-splitter mv -v .k8s-yaml-splitter/*.yaml %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/people rm -rf .k8s-yaml-splitter # Kustomization files for i in base-int8 base-fp32 samples/car-int8 samples/car-fp32 samples/face-int8 samples/face-fp32 samples/people ; do echo -e "resources:" > %{buildroot}%{_datadir}/k8s-yaml/ei-demo/$i/kustomization.yaml for y in `/bin/ls %{buildroot}%{_datadir}/k8s-yaml/ei-demo/$i/| grep -v kustomization.yaml | sort -u`; do echo "- $y" >> %{buildroot}%{_datadir}/k8s-yaml/ei-demo/$i/kustomization.yaml done done echo -e "resources:\n- ../car-int8\n- ../face-int8" > %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/all-int8/kustomization.yaml echo -e "resources:\n- ../car-fp32\n- ../face-fp32\n- ../people" > %{buildroot}%{_datadir}/k8s-yaml/ei-demo/samples/all-fp32/kustomization.yaml mkdir -p mkdir -p %{buildroot}%{_datadir}/k8s-yaml/ei-demo/monitoring cat elastic_inference/kubernetes/monitoring/*.yaml | k8s-yaml-splitter mv -v .k8s-yaml-splitter/*.yaml %{buildroot}%{_datadir}/k8s-yaml/ei-demo/monitoring rm -rf .k8s-yaml-splitter echo -e "resources:" for y in `/bin/ls %{buildroot}%{_datadir}/k8s-yaml/ei-demo/monitoring/| grep -v kustomization.yaml | sort -u`; do echo "- $y" >> %{buildroot}%{_datadir}/k8s-yaml/ei-demo/monitoring/kustomization.yaml done %fdupes %{buildroot}%{_datadir}/k8s-yaml/ei-demo %pre ei-wss -f wssuser.pre %pre ei-fss -f fssuser.pre %pre ei-ois -f oisuser.pre %pre ei-gws -f gwsuser.pre %pre -n elastic-inference-camera-stream %service_add_pre camera-stream.service %post -n elastic-inference-camera-stream %{fillup_only -n camera-stream-service} %service_add_post camera-stream.service %preun -n elastic-inference-camera-stream %service_del_preun camera-stream.service %postun -n elastic-inference-camera-stream # Avoid restart of container if possible %if 0%{?suse_version} > 1500 %service_del_postun_without_restart elastic-inference-camera-stream %else %service_del_postun elastic-inference-camera-stream %endif %files -n elastic-inference-demo-k8s-yaml %dir %{_datarootdir}/k8s-yaml %dir %{_datarootdir}/k8s-yaml/ei-demo %{_datarootdir}/k8s-yaml/ei-demo/base-int8 %{_datarootdir}/k8s-yaml/ei-demo/base-fp32 %dir %{_datarootdir}/k8s-yaml/ei-demo/samples %{_datarootdir}/k8s-yaml/ei-demo/samples/car-int8 %{_datarootdir}/k8s-yaml/ei-demo/samples/car-fp32 %{_datarootdir}/k8s-yaml/ei-demo/samples/face-int8 %{_datarootdir}/k8s-yaml/ei-demo/samples/face-fp32 %{_datarootdir}/k8s-yaml/ei-demo/samples/people %{_datarootdir}/k8s-yaml/ei-demo/samples/all-int8 %{_datarootdir}/k8s-yaml/ei-demo/samples/all-fp32 %{_datarootdir}/k8s-yaml/ei-demo/monitoring %files -n elastic-inference-demo-doc %doc elastic_inference/doc %doc elastic_inference/index.html %doc README.md %files -n elastic-inference-camera-stream %{_bindir}/run-ei-camera-stream-service %{_unitdir}/camera-stream.service %{_fillupdir}/sysconfig.camera-stream-service %files ei-wss %license LICENSE %dir /apps /apps/websocket_server.py %{_sysusersdir}/ei-wss-user.conf %files ei-gws %license LICENSE %dir /apps /apps/gateway_server.py /apps/clcn /dist %{_sysusersdir}/ei-gws-user.conf %files ei-fss %license LICENSE %license sample-videos/LICENSE.sample-videos %dir /apps /apps/file_stream_service.py /apps/clcn /sample-videos %{_sysusersdir}/ei-fss-user.conf %files ei-ois %license LICENSE %license LICENSE.Edge-optimized-models %dir /apps /apps/infer_service.py /apps/clcn /models %{_sysusersdir}/ei-ois-user.conf %files ei-css %license LICENSE %dir /apps /apps/camera_stream_service.py /apps/clcn %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor