Skip to content
Snippets Groups Projects
Commit 1472ffda authored by Max Melchert's avatar Max Melchert
Browse files

refactor: change abs path to rel path; reformat ssh commands

parent 11334603
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ SERVER_USER := mmustermann
SERVER_HOST := hyrican-1-extern
## Python Environment
CONDA_PATH := /home/$(SERVER_USER)/.local/opt/conda
CONDA_PATH := ~/.local/opt/conda
CONDA_ENV := ml
PYTHON_VERSION := 3.10
PYTHON_PACKAGES := tensorflow-cpu ipympl mypy jupyter pystan \
......@@ -24,7 +24,7 @@ LOCAL_PROJECT_DIR := .
LOCAL_OUTPUT_DIR := output
## Remote Project Paths
REMOTE_PROJECT_DIR := /home/$(SERVER_USER)/my_project
REMOTE_PROJECT_DIR := ~/my_project
REMOTE_OUTPUT_FILES := output/*
# ---
......@@ -40,7 +40,9 @@ help: # list targets and usage
@awk '/^[a-zA-Z0-9_-]+:/{print $1}' makefile
install: # install conda environment
$(SSH) '$(CONDA) create -n $(CONDA_ENV) python=$(PYTHON_VERSION) $(PYTHON_PACKAGES)'
$(SSH) '\
$(CONDA) create -n $(CONDA_ENV) python=$(PYTHON_VERSION) $(PYTHON_PACKAGES)\
'
upload: # upload project files from client to server
$(RSYNC) $(LOCAL_PROJECT_DIR)/ $(LOGIN):$(REMOTE_PROJECT_DIR)
......@@ -54,13 +56,19 @@ run: # execute main script on server
'
kill: # terminate the running script on the server
$(SSH) 'pkill -f $(MAIN_SCRIPT)'
$(SSH) '\
pkill -f $(MAIN_SCRIPT)\
'
log: # show the last lines of the log file
$(SSH) 'cd $(REMOTE_PROJECT_DIR) && less $(LOG_FILE)'
$(SSH) '\
cd $(REMOTE_PROJECT_DIR) && less $(LOG_FILE)\
'
download: # download output files from server to client
$(RSYNC) $(LOGIN):$(REMOTE_PROJECT_DIR)/$(REMOTE_OUTPUT_FILES) $(LOCAL_PROJECT_DIR)/$(LOCAL_OUTPUT_DIR)
delete: # remove/delete all project files on server
$(SSH) 'rm -rf $(REMOTE_PROJECT_DIR)'
$(SSH) '\
rm -rf $(REMOTE_PROJECT_DIR)\
'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment