2025-07-31 07:26.14: New job: test robur-coop/dnsvizor https://github.com/robur-coop/dnsvizor.git#refs/heads/provide-http (c0e42a46d3dc68852fb8285dfbf23ce2448934e8) (linux-x86_64:(lint-fmt)) Base: ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a ocamlformat version: version 0.26.2 (from opam) To reproduce locally: git clone --recursive "https://github.com/robur-coop/dnsvizor.git" -b "provide-http" && cd "dnsvizor" && git reset --hard c0e42a46 cat > Dockerfile <<'END-OF-DOCKERFILE' FROM ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a USER 1000:1000 RUN cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u RUN opam depext -i dune WORKDIR /src RUN opam depext -i ocamlformat=0.26.2 COPY --chown=1000:1000 . /src/ RUN opam exec -- dune build @fmt --ignore-promoted-rules || (echo "dune build @fmt failed"; exit 2) END-OF-DOCKERFILE docker build . END-REPRO-BLOCK 2025-07-31 07:26.14: Using cache hint "robur-coop/dnsvizor-ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a-debian-12-4.08_opam-2.4-ocamlformat-b8021439f8c57ba6435bc2263f6596671f4f4466" 2025-07-31 07:26.14: Using OBuilder spec: ((from ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a) (user (uid 1000) (gid 1000)) (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u")) (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "opam depext -i dune")) (workdir /src) (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "opam depext -i ocamlformat=0.26.2")) (copy (src .) (dst /src/)) (run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)")) ) 2025-07-31 07:26.14: Waiting for resource in pool OCluster 2025-07-31 11:35.58: Waiting for worker… 2025-07-31 11:37.11: Got resource from pool OCluster Building on doris.caelum.ci.dev All commits already cached HEAD is now at c0e42a4 also provide a http service (from ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a) Unable to find image 'ocaml/opam:debian-12-ocaml-4.08@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a' locally docker.io/ocaml/opam@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a: Pulling from ocaml/opam 2b437dab448b: Already exists 348b54b4f842: Pulling fs layer d67c1d522a4e: Pulling fs layer dea856d1a4d8: Pulling fs layer 348b54b4f842: Waiting b580a9d7b5b1: Pulling fs layer d67c1d522a4e: Waiting dea856d1a4d8: Waiting d67c1d522a4e: Verifying Checksum d67c1d522a4e: Download complete dea856d1a4d8: Verifying Checksum dea856d1a4d8: Download complete b580a9d7b5b1: Verifying Checksum b580a9d7b5b1: Download complete 348b54b4f842: Verifying Checksum 348b54b4f842: Download complete 348b54b4f842: Pull complete d67c1d522a4e: Pull complete dea856d1a4d8: Pull complete b580a9d7b5b1: Pull complete Digest: sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a Status: Downloaded newer image for ocaml/opam@sha256:474656ea1593a299054f8966c700443fa0944c9534de3da94ca6dfab4a44c47a 2025-07-31 11:37.11 ---> using "1d0024db739bd078f91b2384c47919652a4b72a425e3e24ce24cfd1f6debdfbc" from cache /: (user (uid 1000) (gid 1000)) /: (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "cd ~/opam-repository && (git cat-file -e b8021439f8c57ba6435bc2263f6596671f4f4466 || git fetch origin master) && git reset -q --hard b8021439f8c57ba6435bc2263f6596671f4f4466 && git log --no-decorate -n1 --oneline && opam update -u")) b8021439f8 Merge pull request #28261 from kit-ty-kate/deploy-fix-25819 <><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><> [default] Initialised default (at git+file:///home/opam/opam-repository): [INFO] opam 2.1 and 2.2 include many performance and security improvements over 2.0; please consider upgrading (https://opam.ocaml.org/doc/Install.html) Everything as up-to-date as possible (run with --verbose to show unavailable upgrades). However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages. Nothing to do. # Run eval $(opam env) to update the current shell environment 2025-07-31 11:37.11 ---> using "76d9d96bb26da3c78200d383fd35f876d80571baf05962331a1fff5f47db0e2e" from cache /: (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "opam depext -i dune")) # Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian # No extra OS packages requirements found. # All required OS packages found. # Now letting opam install the packages The following actions will be performed: - install dune 3.19.1 <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><> [dune.3.19.1] found in cache <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> installed dune.3.19.1 Done. # Run eval $(opam env) to update the current shell environment 2025-07-31 11:37.11 ---> using "da0888a20a067de19f6183f0b497dcc2d1ea7f7036861cc50f633c662efdce4f" from cache /: (workdir /src) /src: (run (cache (opam-archives (target /home/opam/.opam/download-cache))) (network host) (shell "opam depext -i ocamlformat=0.26.2")) # Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian # No extra OS packages requirements found. # All required OS packages found. # Now letting opam install the packages The following actions will be performed: - install sexplib0 v0.14.0 [required by base] - install menhirLib 20240715 [required by ocamlformat-lib] - install menhirCST 20240715 [required by menhir] - install ocamlbuild 0.16.1 [required by fpath, astring, uuseg] - install cmdliner 1.3.0 [required by ocamlformat] - install menhirSdk 20240715 [required by ocamlformat-lib] - install either 1.0.0 [required by ocamlformat-lib] - install csexp 1.5.2 [required by ocamlformat-lib] - install result 1.5 [required by ocamlformat-lib] - install dune-build-info 3.19.1 [required by ocamlformat-lib] - install camlp-streams 5.0.1 [required by ocamlformat-lib] - install seq base [required by re] - install fix 20250428 [required by ocamlformat-lib] - install ocaml-version 4.0.1 [required by ocamlformat-lib] - install ocamlfind 1.9.8 [required by ocp-indent, astring, fpath, uuseg] - install menhir 20240715 [required by ocamlformat-lib] - install dune-configurator 3.19.1 [required by base] - install re 1.11.0 [required by ocamlformat] - install topkg 1.1.0 [required by fpath, astring, uuseg] - install base-bytes base [required by ocp-indent] - install base v0.14.3 [required by ocamlformat-lib] - install uutf 1.0.4 [required by ocamlformat-lib] - install astring 0.8.5 [required by ocamlformat-lib] - install ocp-indent 1.8.1 [required by ocamlformat-lib] - install stdio v0.14.0 [required by ocamlformat-lib] - install uucp 15.0.0 [required by uuseg] - install fpath 0.7.3 [required by ocamlformat-lib] - install uuseg 15.0.0 [required by ocamlformat-lib] - install ocamlformat-lib 0.26.2 [required by ocamlformat] - install ocamlformat 0.26.2 ===== 30 to install ===== <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><> [astring.0.8.5] found in cache [base.v0.14.3] found in cache [camlp-streams.5.0.1] found in cache [cmdliner.1.3.0] found in cache [csexp.1.5.2] found in cache [dune-build-info.3.19.1] found in cache [dune-configurator.3.19.1] found in cache [either.1.0.0] found in cache [fix.20250428] found in cache [fpath.0.7.3] found in cache [menhir.20240715] found in cache [menhirCST.20240715] found in cache [menhirLib.20240715] found in cache [menhirSdk.20240715] found in cache [ocaml-version.4.0.1] found in cache [ocamlbuild.0.16.1] found in cache [ocamlfind.1.9.8] found in cache [ocamlformat.0.26.2] found in cache [ocamlformat-lib.0.26.2] found in cache [ocp-indent.1.8.1] found in cache [re.1.11.0] found in cache [result.1.5] found in cache [sexplib0.v0.14.0] found in cache [stdio.v0.14.0] found in cache [topkg.1.1.0] found in cache [uucp.15.0.0] found in cache [uuseg.15.0.0] found in cache [uutf.1.0.4] found in cache <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> installed seq.base -> installed camlp-streams.5.0.1 -> installed cmdliner.1.3.0 -> installed csexp.1.5.2 -> installed either.1.0.0 -> installed fix.20250428 -> installed menhirCST.20240715 -> installed menhirLib.20240715 -> installed menhirSdk.20240715 -> installed ocaml-version.4.0.1 -> installed result.1.5 -> installed sexplib0.v0.14.0 -> installed re.1.11.0 -> installed dune-build-info.3.19.1 -> installed ocamlfind.1.9.8 -> installed base-bytes.base -> installed dune-configurator.3.19.1 -> installed ocamlbuild.0.16.1 -> installed ocp-indent.1.8.1 -> installed topkg.1.1.0 -> installed base.v0.14.3 -> installed astring.0.8.5 -> installed uutf.1.0.4 -> installed stdio.v0.14.0 -> installed fpath.0.7.3 -> installed menhir.20240715 -> installed uucp.15.0.0 -> installed uuseg.15.0.0 -> installed ocamlformat-lib.0.26.2 -> installed ocamlformat.0.26.2 Done. <><> ocp-indent.1.8.1 installed successfully ><><><><><><><><><><><><><><><><><> => This package requires additional configuration for use in editors. Install package 'user-setup', or manually: * for Emacs, add these lines to ~/.emacs: (add-to-list 'load-path "/home/opam/.opam/4.08/share/emacs/site-lisp") (require 'ocp-indent) * for Vim, add this line to ~/.vimrc: set rtp^="/home/opam/.opam/4.08/share/ocp-indent/vim" # Run eval $(opam env) to update the current shell environment 2025-07-31 11:37.11 ---> using "1a07a3dc307a984fdc74409e35653cd6cf14ee21ee42def6dacafbb899196a2b" from cache /src: (copy (src .) (dst /src/)) 2025-07-31 11:37.11 ---> saved as "e8ac05e677f8057cdfe7289c15ad7f109566348d9bcbbc03947262d242f3b28d" /src: (run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)")) File "mirage/unikernel.ml", line 1, characters 0-0: diff --git a/_build/default/mirage/unikernel.ml b/_build/default/mirage/.formatted/unikernel.ml index d1498af..42ed124 100644 --- a/_build/default/mirage/unikernel.ml +++ b/_build/default/mirage/.formatted/unikernel.ml @@ -341,7 +341,8 @@ module Main (N : Mirage_net.S) (ASSETS : Mirage_kv.RO) = struct let request : type reqd headers request response ro wo. - _ -> _ -> + _ -> + _ -> HTTP.TLS.flow -> Ipaddr.t * int -> reqd -> @@ -380,23 +381,28 @@ module Main (N : Mirage_net.S) (ASSETS : Mirage_kv.RO) = struct let cache_lookup_metrics = let map = metrics_cache () in let dns_cache_src = - List.find (fun src -> Metrics.Src.name src = "dns-cache") (Metrics.Src.list ()) + List.find + (fun src -> Metrics.Src.name src = "dns-cache") + (Metrics.Src.list ()) in let dns_cache_metrics = match Metrics.SM.find_opt dns_cache_src map with | None -> - print_endline "no dns-cache found"; - [] + print_endline "no dns-cache found"; + [] | Some (_tags, data) -> Metrics.Data.fields data in - List.iter (fun field -> - print_endline ("field " ^ Metrics.key field)) + List.iter + (fun field -> print_endline ("field " ^ Metrics.key field)) dns_cache_metrics; - match List.find_opt (fun field -> Metrics.key field = "lookups") dns_cache_metrics with + match + List.find_opt + (fun field -> Metrics.key field = "lookups") + dns_cache_metrics + with | None -> 0 - | Some data -> match Metrics.value data with - | V (Uint, u) -> u - | _ -> -1 + | Some data -> ( + match Metrics.value data with V (Uint, u) -> u | _ -> -1) in print_endline ("lookups: " ^ string_of_int cache_lookup_metrics); reply reqd @@ -467,65 +473,71 @@ module Main (N : Mirage_net.S) (ASSETS : Mirage_kv.RO) = struct let request_handler js_file resolver metrics_cache (_ipaddr, _port) reqd = Lwt.async (fun () -> - Logs.info (fun m -> m "Got a new HTTP request!"); - let request = H1.Reqd.request reqd in - Logs.info (fun m -> - m "%a %s" H1.Method.pp_hum request.H1.Request.meth - request.H1.Request.target); - let reply ?(content_type = "text/html") reqd ?(headers = []) data = - let headers = - H1.Headers.of_list - ([ - ("content-type", content_type); - ("content-length", string_of_int (String.length data)); - ] - @ headers) - in - let resp = H1.Response.create ~headers `OK in - H1.Reqd.respond_with_string reqd resp data; - Lwt.return_unit - in - match (request.H1.Request.meth, request.H1.Request.target) with + Logs.info (fun m -> m "Got a new HTTP request!"); + let request = H1.Reqd.request reqd in + Logs.info (fun m -> + m "%a %s" H1.Method.pp_hum request.H1.Request.meth + request.H1.Request.target); + let reply ?(content_type = "text/html") reqd ?(headers = []) data = + let headers = + H1.Headers.of_list + ([ + ("content-type", content_type); + ("content-length", string_of_int (String.length data)); + ] + @ headers) + in + let resp = H1.Response.create ~headers `OK in + H1.Reqd.respond_with_string reqd resp data; + Lwt.return_unit + in + match (request.H1.Request.meth, request.H1.Request.target) with | `GET, "/main.js" -> - reply ~content_type:"text/javascript" reqd js_file + reply ~content_type:"text/javascript" reqd js_file | `GET, "/" | `GET, "/dashboard" -> - let stats = Resolver.stats resolver in - let cache_hits_metrics = - let map = metrics_cache () in - let dns_cache_src = - List.find (fun src -> Metrics.Src.name src = "dns-cache") (Metrics.Src.list ()) - in - let dns_cache_metrics = - match Metrics.SM.find_opt dns_cache_src map with - | None -> - print_endline "no dns-cache found"; - [] - | Some (_tags, data) -> Metrics.Data.fields data + let stats = Resolver.stats resolver in + let cache_hits_metrics = + let map = metrics_cache () in + let dns_cache_src = + List.find + (fun src -> Metrics.Src.name src = "dns-cache") + (Metrics.Src.list ()) + in + let dns_cache_metrics = + match Metrics.SM.find_opt dns_cache_src map with + | None -> + print_endline "no dns-cache found"; + [] + | Some (_tags, data) -> Metrics.Data.fields data + in + List.iter + (fun field -> print_endline ("field " ^ Metrics.key field)) + dns_cache_metrics; + match + List.find_opt + (fun field -> Metrics.key field = "hits") + dns_cache_metrics + with + | None -> -2 + | Some data -> ( + match Metrics.value data with V (Uint, u) -> u | _ -> -1) in - List.iter (fun field -> - print_endline ("field " ^ Metrics.key field)) - dns_cache_metrics; - match List.find_opt (fun field -> Metrics.key field = "hits") dns_cache_metrics with - | None -> -2 - | Some data -> match Metrics.value data with - | V (Uint, u) -> u - | _ -> -1 - in - print_endline ("hits: " ^ string_of_int cache_hits_metrics); - reply reqd - (Dashboard.dashboard_layout ~content:(Statistics.statistics_page stats) - ()) + print_endline ("hits: " ^ string_of_int cache_hits_metrics); + reply reqd + (Dashboard.dashboard_layout + ~content:(Statistics.statistics_page stats) + ()) | `GET, "/querylog" -> - reply reqd - (Dashboard.dashboard_layout ~content:Query_logs.query_page ()) + reply reqd + (Dashboard.dashboard_layout ~content:Query_logs.query_page ()) | `GET, "/blocklist" -> - reply reqd - (Dashboard.dashboard_layout ~content:Blocklist.block_page ()) + reply reqd + (Dashboard.dashboard_layout ~content:Blocklist.block_page ()) | _ -> - let headers = H1.Headers.of_list [ ("connection", "close") ] in - let resp = H1.Response.create ~headers `Bad_request in - H1.Reqd.respond_with_string reqd resp ""; - Lwt.return_unit) + let headers = H1.Headers.of_list [ ("connection", "close") ] in + let resp = H1.Response.create ~headers `Bad_request in + H1.Reqd.respond_with_string reqd resp ""; + Lwt.return_unit) let handler resolver js_file metrics_cache = { @@ -569,14 +581,18 @@ module Main (N : Mirage_net.S) (ASSETS : Mirage_kv.RO) = struct Tls.Config.server ~alpn_protocols:[ "h2" ] ~certificates:own_cert () in let tls = Result.get_ok tls in - let h2 = HTTP.alpn_service ~tls (handler resolver js_file metrics_cache) in + let h2 = + HTTP.alpn_service ~tls (handler resolver js_file metrics_cache) + in HTTP.init ~port:(K.https_port ()) tcp >>= fun service -> let (`Initialized th) = HTTP.serve ~stop h2 service in HTTP.init ~port:80 tcp >>= fun service -> - let request_handler _flow = request_handler js_file resolver metrics_cache in + let request_handler _flow = + request_handler js_file resolver metrics_cache + in let http = HTTP.http_service ~error_handler request_handler in let (`Initialized th2) = HTTP.serve http service in - Lwt.join [ bell () ; th ; th2 ] >>= fun () -> + Lwt.join [ bell (); th; th2 ] >>= fun () -> let ca = CA.make (K.name ()) (K.ca_key ()) in go (Result.get_ok ca) in @@ -661,7 +677,8 @@ module Main (N : Mirage_net.S) (ASSETS : Mirage_kv.RO) = struct (Mirage_mtime.elapsed_ns ()) Mirage_crypto_rng.generate primary_t in - Lwt.async (fun () -> Daemon.start_resolver stack tcp resolver js_file get_cache); + Lwt.async (fun () -> + Daemon.start_resolver stack tcp resolver js_file get_cache); Lwt.return_unit | Some ns -> ( Logs.info (fun m -> m "using a stub resolver, forwarding to %s" ns); dune build @fmt failed "/usr/bin/env" "bash" "-c" "opam exec -- dune build @fmt --ignore-promoted-rules || (echo "dune build @fmt failed"; exit 2)" failed with exit status 2 2025-07-31 11:37.12: Job failed: Failed: Build failed