Project Description
SLEPerf containerize
Containerize SLEPerf. AS alp is our next generation products and container TECH become fundamental , I'd like to adapt SLEPerf to container. This project will try find out a way that how performance tools running in a container .
Goal for this Hackweek
Try Resolve key task for SLEPerf to running in a container
discuss reasonable solution that sleperf could be running in container , init task will be 5 blow. (could change after discuss)
- create very base container has shell/python3 environment
- run-label task, replace local run/bin file to container inside run/bin file
- find a way to run another container process in a container. if there is no stander api way , we need use proxy way which is use systemd file as proxy
- reschedule sleperf process , main process monitor and scheduler benchmark process.
- share storage issue, we need share log between different containers
Result: we have create prototype that all process could run pass.
FROM opensuse/tumbleweed:latest
RUN ["mkdir","/usr/share/qa","/var/log/qa","/var/log/qaset" ]
RUN ["touch","/entrypoint" ]
ADD ["scheduler-service/automation/qaset","/usr/share/qa/qaset" ]
ADD ["scheduler-service/automation/perfcom","/usr/share/qa/perfcom" ]
ADD ["common-infra/libs","/usr/share/qa/qaset/libs" ]
ENTRYPOINT [ "/bin/bash" ]
LABEL "create_share"="bash -c \'podman volume create sleperf_var_log_qa;podman volume create sleperf_var_log_qaset;podman volume create sleperf_root_qaset;podman volume create sleperf_usr_share_qa_qaset;podman volume create sleperf_usr_share_qa_perfcom\'"
LABEL "rm_share"="bash -c \'podman volume rm sleperf_var_log_qa;podman volume rm sleperf_var_log_qaset; podman volume rm sleperf_root_qaset;podman volume rm sleperf_usr_share_qa_qaset;podman volume rm sleperf_usr_share_qa_perfcom\'"
LABEL "run"="podman run -itd --mount type=volume,src=sleperf_var_log_qa,target=/var/log/qa \
--mount type=volume,src=sleperf_var_log_qaset,target=/var/log/qaset \
--mount type=volume,src=sleperf_root_qaset,target=/root/qaset \
--mount type=volume,src=sleperf_usr_share_qa_qaset,target=/usr/share/qa/qaset \
--mount type=volume,src=sleperf_usr_share_qa_perfcom,target=/usr/share/qa/perfcom \
--name sleperf localhost/sleperf:latest"
LABEL "rm_sleperf"="bash -c \'podman stop sleperf;podman rm sleperf;\'"
LABEL "setup_systemd"="bash -c \'podman cp sleperf:/usr/share/qa/qaset/misc/sleperf_entry.service /usr/lib/systemd/system/;podman cp sleperf:/usr/share/qa/qaset/bin/sleperf_proxy /bin/;systemctl enable sleperf_entry \'"
runlabel will create 2 file in ALP host
1 is systemd service sleperf_entry.service which will launch our sleperf proxy script at boot .
2 is bin/sleperfproxy systemd service run this file and this file will execute main-process in container do most work. read [sleperfhook_output] , and run coo-response [action] like:
input: "containersleperfhookmsg: pullandruncontainer xxxx " , action : pull test image and run again ;
input: "containersleperfhookmsg: allfinished" , action: exit;
input: "containersleperfhookmsg: testcasefinish" , action : reboot .
sleperfhookoutput we just need insert into main-process when need action in ALP host.
Resources
ALP
Looking for hackers with the skills:
Nothing? Add some keywords!
This project is part of:
Hack Week 23
Comments
Similar Projects
This project is one of its kind!