Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AKIS Cloud Computing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Max Melchert
AKIS Cloud Computing
Commits
2a6c77e9
Commit
2a6c77e9
authored
2 months ago
by
Max Melchert
Browse files
Options
Downloads
Patches
Plain Diff
feat: add configuration and targets to makefile
parent
a691dd0f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/makefile
+0
-30
0 additions, 30 deletions
src/makefile
src/makefile/makefile
+62
-0
62 additions, 0 deletions
src/makefile/makefile
with
62 additions
and
30 deletions
src/makefile
deleted
100644 → 0
+
0
−
30
View file @
a691dd0f
# Server Setup
SERVER_USER
:=
user
SERVER_HOST
:=
host
CONDA_PATH
:=
/opt/conda
CONDA_ENV
:=
base
# Project Directories
REMOTE_PATH
:=
/path/to/server/code
LOCAL_PATH
:=
/path/to/client/code
# Output Directory
OUTPUT_DIR
:=
output
# Files
MAIN_SCRIPT
:=
main.py
LOG_FILE
:=
logfile.log
.PHONY
:
push exec status pull
push
:
rsync
-a
$(
LOCAL_PATH
)
$(
SERVER_USER
)
@
$(
SERVER_HOST
)
:
$(
REMOTE_PATH
)
exec
:
ssh
$(
SERVER_USER
)
@
$(
SERVER_HOST
)
'cd
$(
REMOTE_PATH
)
&& conda run -n
$(
CONDA_ENV
)
python
$(
MAIN_SCRIPT
)
'
status
:
ssh
$(
SERVER_USER
)
@
$(
SERVER_HOST
)
'cd
$(
REMOTE_PATH
)
&& tail -n 10
$(
LOG_FILE
)
'
pull
:
rsync
-a
$(
SERVER_USER
)
@
$(
SERVER_HOST
)
:
$(
REMOTE_PATH
)
/
$(
OUTPUT_DIR
)
$(
LOCAL_PATH
)
This diff is collapsed.
Click to expand it.
src/makefile/makefile
0 → 100644
+
62
−
0
View file @
2a6c77e9
# Configuration
## Server
SERVER_USER
:=
mmustermann
SERVER_HOST
:=
hyrican-1-extern
## Python Environment
CONDA_PATH
:=
/home/
$(
SERVER_USER
)
/.local/opt/conda
CONDA_ENV
:=
ml
PYTHON_VERSION
:=
3.10
PYTHON_PACKAGES
:=
tensorflow-cpu ipympl mypy jupyter pystan
\
matplotlib seaborn scikit-learn openpyxl odfpy pyarrow
\
geopandas descartes pyogrio optuna plotly tqdm spyder
\
jax-jumpy moviepy shimmy-atari gymnasium-box2d
\
ipywidgets notebook lxml fastparquet zstandard
\
contextily networkx pyvis netgraph pip
## Project Files
MAIN_SCRIPT
:=
main.py
LOG_FILE
:=
progress.log
## Local Project Paths
LOCAL_PROJECT_DIR
:=
.
LOCAL_OUTPUT_DIR
:=
output
## Remote Project Paths
REMOTE_PROJECT_DIR
:=
/home/
$(
SERVER_USER
)
/my_project
REMOTE_OUTPUT_FILES
:=
output/
*
# ---
LOGIN
:=
$(
SERVER_USER
)
@
$(
SERVER_HOST
)
SSH
:=
ssh
$(
LOGIN
)
RSYNC
:=
rsync
--archive
--compress
--progress
CONDA
:=
source
$(
CONDA_PATH
)
/etc/profile.d/conda.sh
&&
conda
.PHONY
:
install upload run kill log download delete
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
)
'
upload
:
#
upload project files from client to server
$(
SSH
)
'mkdir -p
$(
REMOTE_PROJECT_DIR
)
'
$(
RSYNC
)
$(
LOCAL_PROJECT_DIR
)
/
$(
LOGIN
)
:
$(
REMOTE_PROJECT_DIR
)
run
:
#
execute main script on server
$(
SSH
)
'cd
$(
REMOTE_PROJECT_DIR
)
&&
$(
CONDA
)
run -n
$(
CONDA_ENV
)
python
$(
MAIN_SCRIPT
)
'
kill
:
#
terminate the running script on the server
$(
SSH
)
'pkill -f
$(
MAIN_SCRIPT
)
'
log
:
#
show the last lines of the 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
)
'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment