feat(krz01): add a NGINX in front of ollama protected by password
All checks were successful
Check meta / check_dns (pull_request) Successful in 18s
Check meta / check_meta (pull_request) Successful in 19s
build configuration / build_and_cache_geo01 (pull_request) Successful in 1m7s
build configuration / build_and_cache_compute01 (pull_request) Successful in 1m33s
build configuration / build_and_cache_storage01 (pull_request) Successful in 1m24s
build configuration / build_and_cache_rescue01 (pull_request) Successful in 1m24s
build configuration / build_and_cache_krz01 (pull_request) Successful in 2m24s
build configuration / build_and_cache_geo02 (pull_request) Successful in 1m5s
lint / check (pull_request) Successful in 25s
build configuration / build_and_cache_vault01 (pull_request) Successful in 1m23s
build configuration / build_and_cache_web02 (pull_request) Successful in 1m13s
build configuration / build_and_cache_bridge01 (pull_request) Successful in 1m4s
build configuration / build_and_cache_web01 (pull_request) Successful in 1m45s
Check meta / check_meta (push) Successful in 17s
Check meta / check_dns (push) Successful in 17s
build configuration / build_and_cache_rescue01 (push) Successful in 1m15s
build configuration / build_and_cache_storage01 (push) Successful in 1m18s
build configuration / build_and_cache_compute01 (push) Successful in 1m35s
build configuration / build_and_cache_geo01 (push) Successful in 1m13s
build configuration / build_and_cache_krz01 (push) Successful in 1m57s
build configuration / build_and_cache_geo02 (push) Successful in 1m3s
lint / check (push) Successful in 23s
build configuration / build_and_cache_bridge01 (push) Successful in 1m7s
build configuration / build_and_cache_web02 (push) Successful in 1m22s
build configuration / build_and_cache_vault01 (push) Successful in 1m28s
build configuration / build_and_cache_web01 (push) Successful in 1m50s

This way, you can do direct requests to ollama from other places.

Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
This commit is contained in:
Ryan Lahfa 2024-10-10 16:38:17 +02:00
parent 7d70beb1f0
commit d76e655174
2 changed files with 33 additions and 8 deletions

View file

@ -12,11 +12,11 @@ lib.extra.mkConfig {
enabledServices = [
# INFO: This list needs to stay sorted alphabetically
# Machine learning API machine
"microvm-ml01"
"microvm-router01"
"nvidia-tesla-k80"
"proxmox"
# Machine learning API machine
"microvm-ml01"
];
extraConfig = {
@ -57,7 +57,23 @@ lib.extra.mkConfig {
];
}))
];
services.ollama = {
services = {
nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts."ollama01.beta.dgnum.eu" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${config.services.ollama.host}:${toString config.services.ollama.port}";
basicAuthFile = pkgs.writeText "ollama-htpasswd" ''
raito:$y$j9T$UDEHpLtM52hRGK0I4qT6M0$N75AhENLqgtJnTGaPzq51imhjZvuPr.ow81Co1ZTcX2
'';
};
};
};
ollama = {
enable = true;
package = pkgs.callPackage ./ollama.nix {
cudaPackages = pkgs.cudaPackages_11;
@ -66,6 +82,7 @@ lib.extra.mkConfig {
};
};
};
};
root = ./.;
}

View file

@ -127,6 +127,14 @@ let
"cas-eleves"
"vote"
];
krz01.dual = [
# Beta-grade machine learning API servers
"ollama01.beta"
"openui.beta"
"whisper.beta"
"stable-diffusion.beta"
];
}
)
);