From 336ca09bda1ebf036f7df2f8979243417031dd71 Mon Sep 17 00:00:00 2001 From: Keqian Zhu Date: Thu, 16 Jun 2022 08:41:13 -0400 Subject: [PATCH] Makefile: Replace pex with zipapp to bundle skylark ... because zipapp is a built-in module and does not help manage dependencies so it's quickly. Signed-off-by: Keqian Zhu --- Makefile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2a34a39..0d85cf0 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,23 @@ +DIR := $(shell basename $(shell pwd)) + all: skylarkd libskylarkmsr.so skylarkd: *.py */*.py - python3 setup.py sdist - pip3 install pex - pex -o skylarkd --disable-cache -r requirements.txt skylark-sched -f dist -c skylark.py + python3 -m zipapp ../$(DIR) --output=../skylarkd --main="skylark:main" --python="/usr/bin/env python3" + mv ../skylarkd . libskylarkmsr.so: data_collector/get_msr.c - gcc --share -fPIC -o libskylarkmsr.so data_collector/get_msr.c + gcc --share -fPIC -g -o libskylarkmsr.so data_collector/get_msr.c install: skylarkd libskylarkmsr.so skylarkd.service skylarkd.sysconfig low_prio_machine.slice high_prio_machine.slice install -T -D skylarkd $(DESTDIR)/usr/sbin/skylarkd install -T -D libskylarkmsr.so $(DESTDIR)/usr/lib/libskylarkmsr.so install -T -D -m 644 skylarkd.sysconfig $(DESTDIR)/etc/sysconfig/skylarkd - install -T -D -m 644 skylarkd.service $(DESTDIR)/etc/systemd/system/skylarkd.service + install -T -D -m 644 skylarkd.service $(DESTDIR)/usr/lib/systemd/system/skylarkd.service install -T -D -m 644 low_prio_machine.slice $(DESTDIR)/etc/systemd/system/low_prio_machine.slice install -T -D -m 644 high_prio_machine.slice $(DESTDIR)/etc/systemd/system/high_prio_machine.slice .PHONY: clean clean: - rm -rf dist skylark_sched.egg-info - rm -rf __pycache__ */__pycache__ - rm skylarkd - rm *.so + rm -f skylarkd + rm -f *.so -- Gitee