From c7d21ccdae4420f1cebcf8fc59f05c4d5caac1e6 Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 14:01:52 +0000 Subject: [PATCH 1/6] Add capnp output and collector --- .gitignore | 3 +- README.md | 14 +++++ clarke.opam | 11 ++-- src/bin/dune | 1 + src/bin/main.ml | 116 ++++++++++++++++++++++++++------------- src/bin/server.ml | 34 ++++++++++++ src/lib/capnp_client.ml | 40 ++++++++++++++ src/lib/carbon_api.capnp | 5 ++ src/lib/clarke.ml | 1 + src/lib/dune | 19 ++++++- src/lib/info.ml | 17 ++++++ src/lib/info.mli | 1 + src/lib/models.ml | 12 ++-- src/lib/outputs.ml | 13 ++++- src/lib/outputs.mli | 2 + src/lib/s.ml | 3 +- src/lib/summary.ml | 9 ++- 17 files changed, 241 insertions(+), 60 deletions(-) create mode 100644 src/bin/server.ml create mode 100644 src/lib/capnp_client.ml create mode 100644 src/lib/carbon_api.capnp create mode 100644 src/lib/outputs.mli diff --git a/.gitignore b/.gitignore index e3e4cf7..b3b27bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ _build api.txt -test.json \ No newline at end of file +test.json +.capnp \ No newline at end of file diff --git a/README.md b/README.md index 77af921..18b7412 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,17 @@ clarke monitor --meter=variorum The Intelligent Platform Management Interface (IPMI) is another way we can query information about the power usage of a computer, or usually in this case a server. Using `--meter=ipmi` will try to use `ipmi-tool` to query sensors for power consumption statistics. +## Collecting Information + +Clarke allows you to output the period power usage information to "flows" (like `stdout`, a file and a socket) and also to a capnp address. The command line tool can be used to generate an address. + +``` +clarke serve ++Server address: capnp://address +``` + +You can then point the monitor to this and it will send the information to a centralised server. + +``` +clarke monitor --machine=my-machine --period=60 -c gb --output=capnp:.capnp --reporter=log --report-period=10000 +``` \ No newline at end of file diff --git a/clarke.opam b/clarke.opam index 5521494..525e06c 100644 --- a/clarke.opam +++ b/clarke.opam @@ -10,8 +10,8 @@ dev-repo: "git+https://github.com/patricoferris/clarke.git" doc: "https://patricoferris.github.io/clarke/" build: ["dune" "build" "-p" name "-j" jobs] depends: [ - "dune" {>= "2.0"} - "eio_luv" + "dune" {>= "2.0"} + "eio_luv" {>= "0.7"} "variorum" "ptime" "cmdliner" @@ -21,14 +21,15 @@ depends: [ "lwt_eio" "prometheus" "prometheus-app" + "ISO3166" "carbon" ] pin-depends: [ [ "hwloc.dev" "git+https://github.com/patricoferris/ocaml-hwloc#3447dc5c40f0d868529aafcc84b5d2d971062b30" ] [ "jansson.dev" "git+https://github.com/patricoferris/ocaml-jansson#42cb429e722ec64807d75ae401758eb666c9d189" ] - [ "eio.dev" "git+https://github.com/patricoferris/eio#6e681fec1f5894c29c28a042ab107675dd0fd518" ] - [ "eio_luv.dev" "git+https://github.com/patricoferris/eio#6e681fec1f5894c29c28a042ab107675dd0fd518" ] [ "variorum.dev" "git+https://github.com/patricoferris/ocaml-variorum#9128770e9df08ca7a90f317acc08b9cd49da6766" ] - [ "ISO3166.dev" "git+https://github.com/geocaml/ISO3166#425ce3790f8e0a94ad31dd3ff6033463d645b3db" ] [ "carbon.dev" "git+https://github.com/geocaml/carbon-intensity#2d9e7b0376584fcf931f7847d32acfcde8a0b83c" ] + [ "capnp-rpc" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc-lwt" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc-unix" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] ] diff --git a/src/bin/dune b/src/bin/dune index d0e4fc1..57a9d14 100644 --- a/src/bin/dune +++ b/src/bin/dune @@ -4,6 +4,7 @@ (libraries eio_luv eio.unix + capnp-rpc-unix clarke cmdliner clarke.prometheus-eio diff --git a/src/bin/main.ml b/src/bin/main.ml index f7f6512..93a029b 100644 --- a/src/bin/main.ml +++ b/src/bin/main.ml @@ -11,47 +11,74 @@ module Metrics = struct Prometheus.Gauge.v ~help ~namespace ~subsystem "intensity" end +type output = O : (module S.Output with type t = 'a) * 'a -> output + let with_socket ~sw net v fn = let listener = Net.listen ~sw ~backlog:5 net v in while true do Net.accept_fork ~sw listener ~on_error:(fun e -> traceln "Err: %s" (Printexc.to_string e)) - @@ fun socket _addr -> fn (socket :> Flow.sink) + @@ fun socket _addr -> + fn + (O + ( (module Outputs.Flow : S.Output with type t = Flow.sink), + (socket :> Flow.sink) )) done module Specs = struct - type output_spec = [ `Stdout | Net.Sockaddr.stream | `File of string ] + type output_spec = + | Flow of [ `Stdout | Net.Sockaddr.stream | `File of string ] + | Capnp of string - let with_sink ~sw ~fs ~stdout ~net spec fn = + let with_output ~sw ~fs ~stdout ~net spec fn = match spec with - | `Stdout -> fn (stdout :> Flow.sink) - | `File f -> + | Flow `Stdout -> + fn + (O + ( (module Outputs.Flow : S.Output with type t = Flow.sink), + (stdout :> Flow.sink) )) + | Flow (`File f) -> Path.with_open_out ~append:true ~create:(`If_missing 0o644) Path.(fs / f) - @@ fun flow -> fn (flow :> Flow.sink) - | #Net.Sockaddr.stream as v -> with_socket ~sw net v fn + @@ fun flow -> + fn + (O + ( (module Outputs.Flow : S.Output with type t = Flow.sink), + (flow :> Flow.sink) )) + | Flow (#Net.Sockaddr.stream as v) -> with_socket ~sw net v fn + | Capnp f -> + let uri = Path.(load (fs / f)) |> String.trim |> Uri.of_string in + let client_vat = Capnp_rpc_unix.client_only_vat ~sw net in + let sr = Capnp_rpc_unix.Vat.import_exn client_vat uri in + Capnp_rpc_lwt.Sturdy_ref.with_cap_exn sr @@ fun client -> + fn + (O + ( (module Outputs.Capnp : S.Output with type t = Capnp_client.t), + client )) let output_spec_of_string s = match String.lowercase_ascii s with - | "stdout" -> Ok `Stdout + | "stdout" -> Ok (Flow `Stdout) | v -> ( match String.split_on_char ':' v with - | [ "file"; path ] -> Ok (`File path) + | [ "file"; path ] -> Ok (Flow (`File path)) | [ "tcp"; addr; port ] -> ( try let addr = if addr = "loopback" then Net.Ipaddr.V4.loopback else Net.Ipaddr.of_raw addr in - Ok (`Tcp (addr, int_of_string port)) + Ok (Flow (`Tcp (addr, int_of_string port))) with _ -> Error (`Msg "Port parsing failed")) - | [ "unix"; addr ] -> Ok (`Unix addr) + | [ "unix"; addr ] -> Ok (Flow (`Unix addr)) + | [ "capnp"; path ] -> Ok (Capnp path) | _ -> Error (`Msg ("Unknown " ^ v))) let pp_output_spec ppf = function - | `File f -> Fmt.pf ppf "file:%s" f - | `Stdout -> Format.pp_print_string ppf "stdout" - | #Net.Sockaddr.stream as v -> Net.Sockaddr.pp ppf v + | Flow (`File f) -> Fmt.pf ppf "file:%s" f + | Flow `Stdout -> Format.pp_print_string ppf "stdout" + | Flow (#Net.Sockaddr.stream as v) -> Net.Sockaddr.pp ppf v + | Capnp file -> Fmt.pf ppf "capnp:%s" file let output_spec = Cmdliner.Arg.conv (output_spec_of_string, pp_output_spec) @@ -91,8 +118,11 @@ let meter_spec_term = let output_spec_term = Arg.value - @@ Arg.opt Specs.output_spec `Stdout - @@ Arg.info ~doc:"The output location of the monitoring data" + @@ Arg.opt Specs.output_spec (Flow `Stdout) + @@ Arg.info + ~doc: + "The output location of the monitoring data, which can be a capnp \ + capability written to a file" [ "o"; "output" ] let period_term = @@ -156,7 +186,7 @@ let get_intensity ?country ?api_code net = | None, None -> None | Some code, None -> if `GB = code then - Carbon.Gb.get_intensity net + Carbon.Gb.(get_intensity (v net)) |> Carbon.Gb.Intensity.actual |> Option.map float_of_int else ( Logs.warn (fun f -> @@ -167,8 +197,8 @@ let get_intensity ?country ?api_code net = Logs.info (fun f -> f "Calculating carbon intensity for %s" (ISO3166.alpha2_to_string country_code)); - let v = Carbon.Co2_signal.v api in - let i = Co2_signal.get_intensity ~net v ~country_code in + let v = Carbon.Co2_signal.v ~api_key:api net in + let i = Co2_signal.get_intensity v ~country_code in Co2_signal.Intensity.intensity i |> float_of_int |> Option.some | _ -> None @@ -197,14 +227,14 @@ let report ~env ~machine spec file = let s = Path.(with_open_in (env#fs / file)) @@ fun flow -> let reader = Buf_read.of_flow ~max_size:max_int flow in - Clarke.Summary.summary reader |> Result.get_ok + Clarke.Summary.summary ~format:`Csv reader |> Result.get_ok in Path.(unlink (env#fs / file)); T.report ~machine conf s |> log_err let monitor ~env ~stdout ~net ~clock = - let run () machine output meter period prom country api_code reporter_spec - reporter_period = + let run () machine output_spec meter period prom country api_code + reporter_spec reporter_period = let api_code = Option.map (fun f -> Path.(load (env#fs / f) |> String.trim)) api_code in @@ -215,6 +245,11 @@ let monitor ~env ~stdout ~net ~clock = i in Logs.info (fun f -> f "Monitoring..."); + (* The log file is used for summaries, it should be optional + if the reporter is defined or not. *) + let log_file = + Filename.(temp_file ~temp_dir:(get_temp_dir_name ()) "clarke" ".log") + in Switch.run @@ fun sw -> let intensity = ref (get_intensity ()) in let (S.Meter ((module M), t) : S.meter) = @@ -231,27 +266,29 @@ let monitor ~env ~stdout ~net ~clock = intensity := get_intensity () done); (fun () -> - match output with - | `File file -> - while true do - Eio_unix.sleep reporter_period; - report ~env ~machine reporter_spec file - done - | _ -> - Logs.warn (fun f -> - f - "Reporter will only work if data is being output to a \ - file")); - (fun () -> + Logs.info (fun f -> f "Reporter log: %s" log_file); while true do - Specs.with_sink ~sw ~fs ~stdout ~net output (fun sink -> + Eio_unix.sleep reporter_period; + report ~env ~machine reporter_spec log_file + done); + (fun () -> + (* The reporter deletes the file after reporting for similicty + so it needs to be recreated. *) + Specs.with_output ~sw ~fs ~stdout ~net output_spec + (fun (O ((module O), o) : output) -> + while true do + Path.( + with_open_out ~append:true ~create:(`If_missing 0o644) + (fs / log_file)) + @@ fun log -> let info = M.collect t in let info = update_info_with_intensity !intensity info in - Outputs.Flow.send sink info; + O.send ~machine o info; + Flow.copy_string (Info.to_csv info) log; + Flow.copy_string "\n" log; Prometheus.Gauge.set Clarke.Metrics.watts (Info.watts info); - Eio.Flow.copy_string "\n" sink; - Eio_unix.sleep (float_of_int period)) - done); + Eio_unix.sleep (float_of_int period) + done)); ]; Ok ()) in @@ -265,6 +302,7 @@ let monitor ~env ~stdout ~net ~clock = let cmds env = [ monitor ~env ~stdout:env#stdout ~net:env#net ~clock:env#clock; + Server.cmd setup_log ~net:env#net; Calc.cmd setup_log env#fs; ] diff --git a/src/bin/server.ml b/src/bin/server.ml new file mode 100644 index 0000000..20f0d1e --- /dev/null +++ b/src/bin/server.ml @@ -0,0 +1,34 @@ +(* A Capnp Server that accepts machines reporting their + monitoring information *) +open Clarke + +module Store = struct + let add_raw_string ~machine ~msg = + let v = Info.of_json msg in + Eio.traceln "Machine: %s, Info: %a" machine Info.pp v +end + +let secret_key = `Ephemeral +let listen_address = `TCP ("127.0.0.1", 7000) + +let start_server ~sw net = + let config = Capnp_rpc_unix.Vat_config.create ~secret_key listen_address in + let service_id = Capnp_rpc_unix.Vat_config.derived_id config "main" in + let restore = + Capnp_rpc_net.Restorer.single service_id + (Capnp_client.Reporter.local Store.add_raw_string) + in + let vat = Capnp_rpc_unix.serve ~sw ~net ~restore config in + Capnp_rpc_unix.Vat.sturdy_uri vat service_id + +let run_server ~sw net = + let uri = start_server ~sw net in + Eio.traceln "Server address: %a" Uri.pp uri; + Ok () + +open Cmdliner + +let cmd setup_log ~net = + let main () = Eio.Switch.run @@ fun sw -> run_server ~sw net in + let info = Cmd.info "serve" in + Cmd.v info Term.(const main $ setup_log) diff --git a/src/lib/capnp_client.ml b/src/lib/capnp_client.ml new file mode 100644 index 0000000..146f97a --- /dev/null +++ b/src/lib/capnp_client.ml @@ -0,0 +1,40 @@ +module Api = Carbon_api.MakeRPC (Capnp_rpc_lwt) +open Capnp_rpc_lwt + +type t = Api.Client.Reporter.t Capability.t + +module Reporter = struct + let local fn = + let module Reporter = Api.Service.Reporter in + Reporter.local + @@ object + inherit Reporter.service + + method report_impl params release_param_caps = + let open Reporter.Report in + let machine = Params.machine_get params in + let msg = Params.msg_get params in + release_param_caps (); + fn ~machine ~msg; + let response, results = + Service.Response.create Results.init_pointer + in + Results.reply_set results "success"; + Service.return response + end + + let report t machine msg = + let open Api.Client.Reporter in + let request, params = + Capability.Request.create Report.Params.init_pointer + in + Report.Params.machine_set params machine; + Report.Params.msg_set params msg; + Capability.call_for_unit t Report.method_id request +end + +let report ~machine t info = + let msg = Info.to_json info in + match Reporter.report t machine msg with + | Ok () -> Ok () + | Error (`Capnp cap) -> Error (`Msg (Fmt.to_to_string Capnp_rpc.Error.pp cap)) diff --git a/src/lib/carbon_api.capnp b/src/lib/carbon_api.capnp new file mode 100644 index 0000000..5b9b5d1 --- /dev/null +++ b/src/lib/carbon_api.capnp @@ -0,0 +1,5 @@ +@0xb8d9dcb6ce8d71bf; + +interface Reporter { + report @0 (machine :Text, msg :Text) -> (reply :Text); +} \ No newline at end of file diff --git a/src/lib/clarke.ml b/src/lib/clarke.ml index f620e23..77e4640 100644 --- a/src/lib/clarke.ml +++ b/src/lib/clarke.ml @@ -6,3 +6,4 @@ module Models = Models module Outputs = Outputs module Metrics = Metrics module Summary = Summary +module Capnp_client = Capnp_client diff --git a/src/lib/dune b/src/lib/dune index 70a7495..183050b 100644 --- a/src/lib/dune +++ b/src/lib/dune @@ -1,4 +1,21 @@ +(rule + (targets carbon_api.ml carbon_api.mli) + (deps carbon_api.capnp) + (action + (run capnp compile -o %{bin:capnpc-ocaml} %{deps}))) + (library (name clarke) (public_name clarke) - (libraries eio_luv eio.unix ptime variorum ezjsonm prometheus carbon)) + (flags + (:standard -w -53-55)) + (libraries + eio_luv + eio.unix + ptime + variorum + ezjsonm + prometheus + carbon + capnp + capnp-rpc-lwt)) diff --git a/src/lib/info.ml b/src/lib/info.ml index 85c10e4..2095d43 100644 --- a/src/lib/info.ml +++ b/src/lib/info.ml @@ -23,6 +23,23 @@ let to_json t = ] |> Ezjsonm.to_string +let of_json v = + let j = Ezjsonm.value_from_string v in + match + ( Ezjsonm.find_opt j [ "watts" ], + Ezjsonm.find_opt j [ "timestamp" ], + Ezjsonm.find_opt j [ "intensity" ] ) + with + | Some w, Some ts, Some i -> + let watts = Ezjsonm.get_float w in + let timestamp = + Ezjsonm.get_string ts |> Ptime.of_rfc3339 |> Result.get_ok + |> fun (v, _, _) -> v + in + let intensity = if i = `Null then None else Some (Ezjsonm.get_float i) in + { watts; timestamp; intensity } + | _ -> failwith "Malformed carbon information" + let to_csv t = Fmt.str "%s,%s,%a" (Ptime.to_rfc3339 t.timestamp) diff --git a/src/lib/info.mli b/src/lib/info.mli index 811d2db..5a81d75 100644 --- a/src/lib/info.mli +++ b/src/lib/info.mli @@ -6,4 +6,5 @@ val timestamp : t -> Ptime.t val intensity : t -> float option val pp : Format.formatter -> t -> unit val to_json : t -> string +val of_json : string -> t val to_csv : t -> string diff --git a/src/lib/models.ml b/src/lib/models.ml index 6eb1837..67e9cba 100644 --- a/src/lib/models.ml +++ b/src/lib/models.ml @@ -65,18 +65,16 @@ module Ipmi = struct let read_all handle buf = let rec read acc = - try - let i = Eio_luv.Low_level.Stream.read_into handle buf in - read (acc + i) - with End_of_file -> acc + match Eio_luv.Low_level.Stream.read_into handle buf with + | i -> read (acc + i) + | exception End_of_file -> acc in read 0 let get_power_consumption () = let cmd, args = Cmd.power_consumption in - let parent_pipe = Eio_luv.Low_level.Pipe.init () in Switch.run @@ fun sw -> - let handle = Eio_luv.Low_level.Pipe.to_handle ~sw parent_pipe in + let parent_pipe = Eio_luv.Low_level.Pipe.init ~sw () in let buf = Luv.Buffer.create 64 in let redirect = Eio_luv.Low_level.Process. @@ -84,7 +82,7 @@ module Ipmi = struct in let t = Process.spawn ~sw ~redirect cmd args in let _ = Process.await_exit t in - let read = read_all handle buf in + let read = read_all parent_pipe buf in Luv.Buffer.to_string (Luv.Buffer.sub buf ~offset:0 ~length:read) let collect t = diff --git a/src/lib/outputs.ml b/src/lib/outputs.ml index e39348c..a2f551a 100644 --- a/src/lib/outputs.ml +++ b/src/lib/outputs.ml @@ -1,5 +1,16 @@ module Flow = struct type t = Eio.Flow.sink - let send sink info = Eio.Flow.copy_string (Info.to_json info) sink + let send ~machine:_ sink info = + Eio.Flow.copy_string (Info.to_json info) sink; + Eio.Flow.copy_string "\n" sink +end + +module Capnp = struct + type t = Capnp_client.t + + let send ~machine cap info = + match Capnp_client.report cap ~machine info with + | Ok () -> () + | Error (`Msg m) -> failwith m end diff --git a/src/lib/outputs.mli b/src/lib/outputs.mli new file mode 100644 index 0000000..ab59452 --- /dev/null +++ b/src/lib/outputs.mli @@ -0,0 +1,2 @@ +module Flow : S.Output with type t = Eio.Flow.sink +module Capnp : S.Output with type t = Capnp_client.t diff --git a/src/lib/s.ml b/src/lib/s.ml index 067d13e..4c439d3 100644 --- a/src/lib/s.ml +++ b/src/lib/s.ml @@ -13,7 +13,8 @@ type meter = Meter : (module Meter with type t = 'a) * 'a -> meter module type Output = sig type t - val send : t -> Info.t -> unit + val send : machine:string -> t -> Info.t -> unit + (** [send ~machine t info] sends information [info] to [t] about the [machine]. *) end module type S = sig diff --git a/src/lib/summary.ml b/src/lib/summary.ml index 0ae4f0b..6acd3c9 100644 --- a/src/lib/summary.ml +++ b/src/lib/summary.ml @@ -103,8 +103,6 @@ let summary ?(format = `Json) reader = } module Reporter = struct - open Cohttp_eio - module type S = sig type conf @@ -130,6 +128,8 @@ module Reporter = struct end module Slack = struct + open Cohttp_eio + type conf = Net.t * string (* The slack endpoint *) type status = @@ -154,9 +154,8 @@ module Reporter = struct let authenticator = null_auth in let socket = try `Socket (Eio.Net.connect ~sw net addr) - with Net.Connection_failure exn -> - Logs.info (fun f -> - f "Connection failure: %s" (Printexc.to_string exn)); + with Io (Net.E (Net.Connection_failure _exn), _ctx) -> + Logs.info (fun f -> f "Connection failur"); `Connection_failure in match socket with From ff374e9ad92db7e3aa00b6286838f774d7dc171f Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 14:06:25 +0000 Subject: [PATCH 2/6] Add cohttp-eio pins --- clarke.opam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clarke.opam b/clarke.opam index 525e06c..61dfa08 100644 --- a/clarke.opam +++ b/clarke.opam @@ -29,6 +29,8 @@ pin-depends: [ [ "jansson.dev" "git+https://github.com/patricoferris/ocaml-jansson#42cb429e722ec64807d75ae401758eb666c9d189" ] [ "variorum.dev" "git+https://github.com/patricoferris/ocaml-variorum#9128770e9df08ca7a90f317acc08b9cd49da6766" ] [ "carbon.dev" "git+https://github.com/geocaml/carbon-intensity#2d9e7b0376584fcf931f7847d32acfcde8a0b83c" ] + [ "http.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] + [ "cohttp-eio.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "capnp-rpc" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] [ "capnp-rpc-lwt" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] [ "capnp-rpc-unix" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] From c9740ce8a3bc1e95784ce945d731d9bbb9ea0978 Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 14:10:31 +0000 Subject: [PATCH 3/6] Fix opam file --- clarke.opam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clarke.opam b/clarke.opam index 61dfa08..54c0fa4 100644 --- a/clarke.opam +++ b/clarke.opam @@ -31,7 +31,7 @@ pin-depends: [ [ "carbon.dev" "git+https://github.com/geocaml/carbon-intensity#2d9e7b0376584fcf931f7847d32acfcde8a0b83c" ] [ "http.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "cohttp-eio.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] - [ "capnp-rpc" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] - [ "capnp-rpc-lwt" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] - [ "capnp-rpc-unix" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc-lwt.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc-unix.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] ] From 35c1c946b734e11257a3881aae4d02e0251dd4ff Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 14:14:15 +0000 Subject: [PATCH 4/6] Add capnp-rpc-* to opam file --- clarke.opam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clarke.opam b/clarke.opam index 54c0fa4..4d09b78 100644 --- a/clarke.opam +++ b/clarke.opam @@ -23,6 +23,8 @@ depends: [ "prometheus-app" "ISO3166" "carbon" + "capnp-rpc-lwt" + "capnp-rpc-unix" ] pin-depends: [ [ "hwloc.dev" "git+https://github.com/patricoferris/ocaml-hwloc#3447dc5c40f0d868529aafcc84b5d2d971062b30" ] From 2dc8fc2bb2bd7bb122b8ff30498f4c8e8e51b61a Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 14:20:22 +0000 Subject: [PATCH 5/6] More pins... --- clarke.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/clarke.opam b/clarke.opam index 4d09b78..98949ef 100644 --- a/clarke.opam +++ b/clarke.opam @@ -34,6 +34,7 @@ pin-depends: [ [ "http.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "cohttp-eio.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "capnp-rpc.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] + [ "capnp-rpc-net.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] [ "capnp-rpc-lwt.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] [ "capnp-rpc-unix.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ] ] From 331ab9736672c5699eaa0e32b92f21273e2fad10 Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 18 Dec 2022 15:09:07 +0000 Subject: [PATCH 6/6] Update carbon --- clarke.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clarke.opam b/clarke.opam index 98949ef..513cd43 100644 --- a/clarke.opam +++ b/clarke.opam @@ -30,7 +30,7 @@ pin-depends: [ [ "hwloc.dev" "git+https://github.com/patricoferris/ocaml-hwloc#3447dc5c40f0d868529aafcc84b5d2d971062b30" ] [ "jansson.dev" "git+https://github.com/patricoferris/ocaml-jansson#42cb429e722ec64807d75ae401758eb666c9d189" ] [ "variorum.dev" "git+https://github.com/patricoferris/ocaml-variorum#9128770e9df08ca7a90f317acc08b9cd49da6766" ] - [ "carbon.dev" "git+https://github.com/geocaml/carbon-intensity#2d9e7b0376584fcf931f7847d32acfcde8a0b83c" ] + [ "carbon.dev" "git+https://github.com/geocaml/carbon-intensity#872bc97cf1e98c55a6ea6f72f485bcaa605d19b1" ] [ "http.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "cohttp-eio.dev" "git+https://github.com/mirage/ocaml-cohttp#df6e8fc58edac41b285c9b6d2bbc0b23533fa713"] [ "capnp-rpc.dev" "git+https://github.com/talex5/capnp-rpc#c06e767b8a4ec5a87a07e62958cdb55d0d59c59d" ]