diff --git a/Dockerfile b/Dockerfile index d782f33c..3234a560 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM ocaml/opam:debian-11-ocaml-4.13@sha256:facb9f1272610683f75580a8189116dcc4f4fff6958640e81bf568ec8ffc6302 AS build +FROM ocaml/opam:debian-11-ocaml-4.14@sha256:b83fcce3b715fe10ee2d3060763379e1ad9be76832d67203652f2c0abd6ae50d AS build RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev -y --no-install-recommends -RUN cd ~/opam-repository && git pull origin -q master && git reset --hard ae6aff50030492f9b7eed0cf952fdca40f4cf125 && opam update +RUN cd ~/opam-repository && git pull origin -q master && git reset --hard 11e634fd946c90fdb26c14ae5f7759e644c898f0 && opam update COPY --chown=opam ocluster-api.opam ocluster.opam /src/ COPY --chown=opam obuilder/obuilder.opam obuilder/obuilder-spec.opam /src/obuilder/ RUN opam pin -yn /src/obuilder/ diff --git a/Dockerfile.worker b/Dockerfile.worker index 8d529287..83085ec8 100644 --- a/Dockerfile.worker +++ b/Dockerfile.worker @@ -1,6 +1,6 @@ -FROM ocaml/opam:debian-11-ocaml-4.13@sha256:fe25836078456e1691b59e28b8fdf1a1feb34f122c9810642282d5d9530fb4ef AS build +FROM ocaml/opam:debian-11-ocaml-4.14@sha256:b83fcce3b715fe10ee2d3060763379e1ad9be76832d67203652f2c0abd6ae50d AS build RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev -y --no-install-recommends -RUN cd ~/opam-repository && git pull origin -q master && git reset --hard d811dfbb1b8dd5497c24d29bb56a7b7cb5d6a25f && opam update +RUN cd ~/opam-repository && git pull origin -q master && git reset --hard 11e634fd946c90fdb26c14ae5f7759e644c898f0 && opam update COPY --chown=opam ocluster-api.opam ocluster.opam /src/ COPY --chown=opam obuilder/obuilder.opam obuilder/obuilder-spec.opam /src/obuilder/ RUN opam pin -yn /src/obuilder/ diff --git a/bin/scheduler.ml b/bin/scheduler.ml index 8cf70e8f..e317e24f 100644 --- a/bin/scheduler.ml +++ b/bin/scheduler.ml @@ -55,7 +55,7 @@ module Web = struct let uri = Request.uri req in match Request.meth req, Astring.String.cuts ~empty:false ~sep:"/" (Uri.path uri) with | `GET, ["metrics"] -> - let data = Prometheus.CollectorRegistry.(collect default) in + Prometheus.CollectorRegistry.(collect default) >>= fun data -> let body = Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data in let headers = Header.init_with "Content-Type" "text/plain; version=0.0.4" in Server.respond_string ~status:`OK ~headers ~body () diff --git a/dune-project b/dune-project index 4ea02c9e..3c2d04a4 100644 --- a/dune-project +++ b/dune-project @@ -40,7 +40,7 @@ (digestif (>= 0.8)) fpath lwt-dllist - (prometheus-app (>= 1.1)) + (prometheus-app (>= 1.2)) cohttp-lwt-unix sqlite3 obuilder diff --git a/obuilder b/obuilder index a2f4cec1..c8319955 160000 --- a/obuilder +++ b/obuilder @@ -1 +1 @@ -Subproject commit a2f4cec1774967a54808e6d5c9dfb6a4d77bc9c8 +Subproject commit c8319955acc039bab6d3c3d4c27bdd856cf6ed79 diff --git a/ocluster.opam b/ocluster.opam index 9056c6f5..d5f8abde 100644 --- a/ocluster.opam +++ b/ocluster.opam @@ -35,7 +35,7 @@ depends: [ "digestif" {>= "0.8"} "fpath" "lwt-dllist" - "prometheus-app" {>= "1.1"} + "prometheus-app" {>= "1.2"} "cohttp-lwt-unix" "sqlite3" "obuilder" diff --git a/test/test_plugin.ml b/test/test_plugin.ml index 87e5e0fd..94ef4fc0 100644 --- a/test/test_plugin.ml +++ b/test/test_plugin.ml @@ -227,9 +227,9 @@ let cancel_rate_limit () = let test_case name fn = Alcotest_lwt.test_case name `Quick @@ fun _ () -> - fn () >|= fun () -> - Prometheus.CollectorRegistry.(collect default) - |> Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output + fn () >>= fun () -> + Prometheus.CollectorRegistry.(collect default) >|= fun data -> + Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data |> String.split_on_char '\n' |> List.iter (fun line -> if Astring.String.is_prefix ~affix:"scheduler_pool_" line || diff --git a/test/test_scheduling.ml b/test/test_scheduling.ml index 26d20e98..d40e39b5 100644 --- a/test/test_scheduling.ml +++ b/test/test_scheduling.ml @@ -59,9 +59,9 @@ let run fn = Lwt.pause () >>= fun () -> (* Ensure we're inside the Lwt mainloop. Lwt.pause behaves strangely otherwise. *) Fake_time.now := 1.0; fn () >>= fun () -> - Lwt.pause () >|= fun () -> - Prometheus.CollectorRegistry.(collect default) - |> Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output + Lwt.pause () >>= fun () -> + Prometheus.CollectorRegistry.(collect default) >|= fun data -> + Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data |> String.split_on_char '\n' |> List.iter (fun line -> if Astring.String.is_prefix ~affix:"scheduler_pool_" line then ( diff --git a/worker/cluster_worker.ml b/worker/cluster_worker.ml index 20a35997..c620c7ad 100644 --- a/worker/cluster_worker.ml +++ b/worker/cluster_worker.ml @@ -400,7 +400,7 @@ let default_build ?obuilder ~switch ~log ~src ~secrets = function let metrics = function | `Agent -> - let data = Prometheus.CollectorRegistry.(collect default) in + Prometheus.CollectorRegistry.(collect default) >>= fun data -> let content_type = "text/plain; version=0.0.4; charset=utf-8" in Lwt_result.return (content_type, Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data) | `Host ->