This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
65 lines (48 loc) · 1.77 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
DLQMC_VERSION = 0.1.0
KFAC_VERSION = 0.1.0
DEEPQMC_VERSION = 0.1.0
LOCAL_VENV = .venv
-include local.mk
PYTHON ?= python3
SHELL = /bin/bash # need brace expansion
TODAY := $(shell date +"%Y-%W/%Y-%m-%d")
RSYNC_CMD = rsync \
-cirl --relative --delete --rsync-path="cd $(REMOTE_PATH) && rsync" $(RSYNC_OPTS) \
--exclude={venv/,OUTPUT,__pycache__/}
.PHONY: bundle
all:
go:
ssh -t $(REMOTE) 'cd $(REMOTE_PATH) && exec $$SHELL'
update: bundle
$(RSYNC_CMD) --ignore-missing-args Makefile bundle data/extern states notebooks/preamble*.py \
$(UPDATE_EXTRA) $(REMOTE):./
@ssh $(REMOTE) 'make -C $(REMOTE_PATH) deploy'
bundle:
rm -rf bundle && mkdir bundle
poetry export -f requirements.txt --without-hashes | grep -v deepqmc >bundle/requirements.txt
cd extern/deepqmc && poetry build -f wheel
cp extern/deepqmc/dist/deepqmc-$(DEEPQMC_VERSION)-py3-none-any.whl bundle/
cd extern/torch-kfac && poetry build -f wheel
cp extern/torch-kfac/dist/torch_kfac-$(KFAC_VERSION)-py3-none-any.whl bundle/
poetry build -f wheel
cp dist/dlqmc-$(DLQMC_VERSION)-py3-none-any.whl bundle/
rsync -aR --exclude=__pycache__ extern/./deepqmc/tests bundle/tests/
$(PYTHON) -m pytest bundle/tests
deploy:
$(PYTHON) -m pip install -q -r bundle/requirements.txt
$(PYTHON) -m pip install --force-reinstall --no-deps bundle/*.whl
local_venv:
mkdir -p $(RUN)
rsync -a bundle $(RUN)/
$(PYTHON) -m venv $(RUN)/$(LOCAL_VENV) --system-site-packages
$(MAKE) -C $(RUN) -f $(CURDIR)/Makefile deploy_local PYTHON=$(LOCAL_VENV)/bin/python
deploy_local:
$(PYTHON) -m pip install --ignore-installed --no-deps bundle/*.whl
fetch:
$(RSYNC_CMD) -K $(REMOTE):$(RUNS) ./
push:
$(RSYNC_CMD) -K $(RUNS) $(REMOTE):./
today:
mkdir -p runs/$(TODAY) runs/Current
ln -fns $(TODAY) runs/Today
ln -s ../$(TODAY) runs/Current/