diff --git a/src/makefile/README.md b/src/makefile/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b699776554c5ebc2713db962b4a21036c21aaa8f --- /dev/null +++ b/src/makefile/README.md @@ -0,0 +1,82 @@ +# Makefile + +## Voraussetzungen + +> Server-Admin kontaktieren + +- SSH-Public-Key auf Server +- SSH-Private-Key auf Client +- SSH-Config auf Client konfiguriert + +## Installation + +1. Makefile [herunterladen](./makefile) +2. Makefile in Projektordner speichern + - Projektstruktur ([Beispiel](#projektstruktur)) +3. Makefile [konfigurieren](#konfiguration) +4. `make install` + +## Bedienung + +> siehe [Befehle](#befehle) + +1. `make upload` Projektdateien hochladen +2. `make run` Python-Script ausführen +3. `make log` Fortschritt überprüfen +4. `make download` Output-Dateien herunterladen + +--- + +## Projektstruktur + +> Beispiel + +```txt +/home/max/akis/my_project/ +├── data +│ ├── one.pkl +│ ├── three.pkl +│ └── two.pkl +├── main.py +├── makefile +├── output +│ └── empty +└── scripts + ├── script-1.py + ├── script-2.py + └── script-3.py +``` + +## Konfiguration + +| Variable | Verwendung | Beispiel | +| :-------------------- | :-------------------------------- | :----------------------------------- | +| `SERVER_USER` | Server: User Name | `mmustermann` | +| `SERVER_HOST` | Server: Host Name | `hyrican-1-extern` | +| `CONDA_PATH` | Server: Conda-Installations-Pfad | `/home/mmustermann/.local/opt/conda` | +| `CONDA_ENV` | Server: Conda-Environment-Name | `ml` | +| `PYTHON_VERSION` | Python: Gewünschte Version | `3.10` | +| `PYTHON_PACKAGES` | Python: Benötigte Pakete | `tensorflow-cpu matplotlib optuna` | +| `MAIN_SCRIPT` | Auszuführendes Python-Script [^1] | `main.py` | +| `LOG_FILE` | Log-Datei (optional) [^1] | `progress.log` | +| `LOCAL_PROJECT_DIR` | Client: Projektordner [^1] | `.` | +| `LOCAL_OUTPUT_DIR` | Client: Output-Ordner [^1] | `output` | +| `REMOTE_PROJECT_DIR` | Server: Projektordner [^2] | `/home/mmustermann/akis/my_project` | +| `REMOTE_OUTPUT_FILES` | Server: Output-Dateien [^1] | `output/*.svg output/*pkl` | + +[^1]: Relativer Pfad zum Projektordner +[^2]: Absoluter Pfad + +## Befehle + +> `make <target>` + +| Target | Aktion | Ort | +| :--------- | :---------------------------------------- | :-------------: | +| `install` | Installiert Python Environment und Pakete | Server | +| `upload` | Läd veränderte Projektdateien hoch | Client → Server | +| `run` | Führt Python Script aus | Server | +| `kill` | Bricht Python Script ab | Server | +| `log` | Zeigt Log-Datei (optional) an | Client | +| `download` | Läd Outputdateien herunter | Server → Client | +| `delete` | Löscht Projektdateien | Server |