diff --git a/flux/README.md b/flux/README.md index 2b1f22eca1d5ecf30977d3bd6e892de39ed34a89..869a8473ac69a98372dace254e05df68efa000dc 100644 --- a/flux/README.md +++ b/flux/README.md @@ -30,17 +30,21 @@ A few notes * You might need to add the temp/local_flux repo to the git safe directory (There will be an error with a command) * Be patient. Some steps take reeeeaaaally long -After that you can execute `run_cluster.sh` to run the cluster. See [below](#run-cluster) +After that you can execute `run_cluster.sh` to run the cluster. The videoag deployment will only be added once you +update flux at least once with 'u'. See [below](#run-cluster). Sometimes the postgres operator doesn't create the +'videoag' database initially. In that case you must restart the operator (for example by stopping the cluster and +running 'run_cluster.sh' again). To delete the cluster use `delete_cluster.sh` ## Run cluster -Use `run_cluster.sh` to run your cluster. This will open a tmux session with 3 consoles +Use `run_cluster.sh` to run your cluster. This will open a tmux session with 4 consoles * Top left: The dashboard. This takes a bit to startup and then automatically opens the dashboard in your browser * Middle left: The minikube tunnel. This will ask for your sudo password and starts a tunnel to access the database externally. Not required unless you want to access the database externally and can be ignored. + * IP of database can be found under 'Services' in the dashboard * Bottom left: Minikube mount for video_data * Right: The console to update the config. * Pressing `u` will update the config (by copying the videoag config files, see [setup](#setup)) and synchronize flux @@ -89,7 +93,13 @@ images), you can put them in `dummy_secrets.json`. This is a key-value mapping w ### Data Storage -The persistent volume `video-data` is modified so that it uses a `hostPath` pointing to `./video_data/` instead of `nfs` +The persistent volume `video-data` is modified so that it uses a `hostPath` pointing to `./video_data/` instead of `nfs`. + +The storage class and volume size of the database is modified, so that minikube can automatically provide a persistent volume. + +### Ingress Class + +Replaces 'haproxy' ingress class with 'nginx' since only nginx is installed in the minikube ## Some notes: diff --git a/flux/do_file_replacements.py b/flux/do_file_replacements.py index 5b9fa06e8b11abfd8a24a02157bc15996dd4d6d6..a5154cf4af08cde0796c6a1f996f7f8a9c00c1ab 100644 --- a/flux/do_file_replacements.py +++ b/flux/do_file_replacements.py @@ -60,8 +60,8 @@ def do_secret_replacement(): def replace_image_paths(file: Path): file_content = file.read_text(encoding="UTF8") file_content = re.sub( - "image: registry\\.git\\.fsmpi\\.rwth-aachen\\.de\\/videoag_infra\\/production\\/([a-zA-Z0-9_]+):[a-zA-Z0-9_.]+", - "image: registry.git.fsmpi.rwth-aachen.de/videoag/development/\\1:latest", + "image: registry\\.git\\.fsmpi\\.rwth-aachen\\.de\\/videoag\\/([a-zA-Z0-9_]+)\\/production_([a-zA-Z0-9_]+):[a-zA-Z0-9_.]+", + "image: registry.git.fsmpi.rwth-aachen.de/videoag/\\1/development_\\2:latest", file_content ) file.write_text(file_content) @@ -72,6 +72,8 @@ def do_image_path_replacement(): replace_image_paths(file) +# Video Data Mount + def do_video_data_mount_replacement(): file = Path("videoag/storage.yaml") file_content = file.read_text(encoding="UTF8") @@ -88,7 +90,38 @@ def do_video_data_mount_replacement(): file.write_text(file_content) +# Database Storage Replacement + +def do_database_storage_replacement(): + file = Path("videoag/postgres/database.yaml") + file_content = file.read_text(encoding="UTF8") + file_content = file_content.replace( + """\ + volume: + size: 40Gi + storageClass: longhorn-no-repl\ +""", """\ + volume: + size: 5Gi +""" + ) + file.write_text(file_content) + + +# Ingress Class Replacement + +def do_ingress_class_replacement(): + file = Path("videoag/ingress.yaml") + file_content = file.read_text(encoding="UTF8") + file_content = file_content.replace( + "ingressClassName: haproxy", "ingressClassName: nginx" + ) + file.write_text(file_content) + + if __name__ == "__main__": do_secret_replacement() do_image_path_replacement() do_video_data_mount_replacement() + do_database_storage_replacement() + do_ingress_class_replacement()