Clean up trailing spaces

This commit is contained in:
Reynir Björnsson 2022-02-01 11:43:07 +00:00
parent d6c04e861e
commit 3fe07c7b34
7 changed files with 26 additions and 26 deletions

View file

@ -10,9 +10,9 @@ Builder-web is a single binary web server using a sqlite3 database with versione
Finished builds from [builder](https://github.com/roburio/builder/) are uploaded to builder-web, stored and indexed in the database and presented in the web interface to the user. Finished builds from [builder](https://github.com/roburio/builder/) are uploaded to builder-web, stored and indexed in the database and presented in the web interface to the user.
Users can: Users can:
* Get an overview of *jobs* - a job is typically script or opam package that is run and builds an artifact, * Get an overview of *jobs* - a job is typically script or opam package that is run and builds an artifact,
* Browse all *builds* of a job - each job may have multiple builds, that are executed periodically by builder * Browse all *builds* of a job - each job may have multiple builds, that are executed periodically by builder
* Browse individual *build* and download artifacts and build information for reproducing the same binary. * Browse individual *build* and download artifacts and build information for reproducing the same binary.
* Compare two builds, observing the differences in used opam packages, environment variables, and system packages. * Compare two builds, observing the differences in used opam packages, environment variables, and system packages.
* Search for the SHA-256 hash of a binary to view a build that resulted in that binary. * Search for the SHA-256 hash of a binary to view a build that resulted in that binary.
@ -53,7 +53,7 @@ On the source server:
builder-db extract-build <build-hash> --dest <build-hash>.full builder-db extract-build <build-hash> --dest <build-hash>.full
``` ```
After copying the file over the destination server (you need a user first, After copying the file over the destination server (you need a user first,
see `builder-db user-add --help`): see `builder-db user-add --help`):
```ocaml ```ocaml
curl --data-binary @<build-hash>.full http://<user>:<passwd>@localhost:<builder-web-port>/upload curl --data-binary @<build-hash>.full http://<user>:<passwd>@localhost:<builder-web-port>/upload

View file

@ -30,7 +30,7 @@ let new_build =
) )
|} |}
let old_build = let old_build =
Caqti_request.exec Caqti_request.exec
Caqti_type.unit Caqti_type.unit
{| CREATE TABLE new_build ( {| CREATE TABLE new_build (
@ -102,7 +102,7 @@ let collect_new_build =
{| SELECT id, uuid, start_d, start_ps, finish_d, finish_ps, result_kind, result_code, result_msg, {| SELECT id, uuid, start_d, start_ps, finish_d, finish_ps, result_kind, result_code, result_msg,
console, script, main_binary, job console, script, main_binary, job
FROM build |} FROM build |}
let insert_old_build = let insert_old_build =
Caqti_request.exec ~oneshot:true Caqti_request.exec ~oneshot:true
Caqti_type.(tup3 Builder_db.Rep.untyped_id Caqti_type.(tup3 Builder_db.Rep.untyped_id
@ -124,14 +124,14 @@ let migrate _ (module Db : Caqti_blocking.CONNECTION) =
| Some path -> Db.find find_main_artifact_id (id, path) >>| fun id -> Some id) | Some path -> Db.find find_main_artifact_id (id, path) >>| fun id -> Some id)
>>= fun main_binary_id -> >>= fun main_binary_id ->
Db.exec insert_new_build Db.exec insert_new_build
(id, ((uuid, start_d, start_ps, finish_d), (finish_ps, result_kind, result_code, result_msg), (console, script, main_binary_id)), job)) (id, ((uuid, start_d, start_ps, finish_d), (finish_ps, result_kind, result_code, result_msg), (console, script, main_binary_id)), job))
builds >>= fun () -> builds >>= fun () ->
Db.exec drop_build () >>= fun () -> Db.exec drop_build () >>= fun () ->
Db.exec rename_build () >>= fun () -> Db.exec rename_build () >>= fun () ->
Db.exec idx_build_job_start () >>= fun () -> Db.exec idx_build_job_start () >>= fun () ->
Db.exec (Grej.set_version new_version) () Db.exec (Grej.set_version new_version) ()
let rollback _ (module Db : Caqti_blocking.CONNECTION) = let rollback _ (module Db : Caqti_blocking.CONNECTION) =
let open Grej.Infix in let open Grej.Infix in
Grej.check_version ~user_version:new_version (module Db) >>= fun () -> Grej.check_version ~user_version:new_version (module Db) >>= fun () ->
@ -144,7 +144,7 @@ let rollback _ (module Db : Caqti_blocking.CONNECTION) =
| Some main_binary_id -> Db.find find_main_artifact_filepath main_binary_id >>| fun filepath -> Some filepath) | Some main_binary_id -> Db.find find_main_artifact_filepath main_binary_id >>| fun filepath -> Some filepath)
>>= fun filepath -> >>= fun filepath ->
Db.exec insert_old_build Db.exec insert_old_build
(id, ((uuid, start_d, start_ps, finish_d), (finish_ps, result_kind, result_code, result_msg), (console, script, filepath)), job)) (id, ((uuid, start_d, start_ps, finish_d), (finish_ps, result_kind, result_code, result_msg), (console, script, filepath)), job))
builds >>= fun () -> builds >>= fun () ->
Db.exec drop_build () >>= fun () -> Db.exec drop_build () >>= fun () ->
Db.exec rename_build () >>= fun () -> Db.exec rename_build () >>= fun () ->

View file

@ -97,7 +97,7 @@ let infer_section_and_synopsis artifacts =
| None -> infer_section_from_packages opam_switch | None -> infer_section_from_packages opam_switch
in in
Some section, infer_synopsis_and_descr opam_switch Some section, infer_synopsis_and_descr opam_switch
let remove_tag = let remove_tag =
Caqti_request.exec Caqti_request.exec
Caqti_type.unit Caqti_type.unit

View file

@ -17,7 +17,7 @@ let read_file file =
let print_treemap_html elf_path elf_size = let print_treemap_html elf_path elf_size =
let open Modulectomy in let open Modulectomy in
let infos = let infos =
elf_path elf_path
|> Elf.get |> Elf.get
|> Result.map_error (fun _ -> R.msg "Invalid ELF file") |> Result.map_error (fun _ -> R.msg "Invalid ELF file")
@ -48,7 +48,7 @@ let print_treemap_html elf_path elf_size =
|> List.map Info.compute_area |> List.map Info.compute_area
|> List.fold_left Int64.add 0L |> List.fold_left Int64.add 0L
in in
[ [
"Smaller excluded entries", excluded_minors_size "Smaller excluded entries", excluded_minors_size
] ]
in in
@ -86,10 +86,10 @@ let print_dependencies_html file =
let html = Render.Html.of_assoc ~override_css graph in let html = Render.Html.of_assoc ~override_css graph in
Format.printf "%a" Render.Html.pp html Format.printf "%a" Render.Html.pp html
module Cmd = struct module Cmd = struct
module Arg = struct module Arg = struct
let elf_path = let elf_path =
let doc = "The file-path of the debug-ELF to be analyzed" in let doc = "The file-path of the debug-ELF to be analyzed" in
Cmdliner.Arg.( Cmdliner.Arg.(
@ -126,7 +126,7 @@ module Cmd = struct
else `Error (true, "Unknown command: " ^ cmd) else `Error (true, "Unknown command: " ^ cmd)
end end
let treemap = let treemap =
let doc = "Dump treemap SVG and CSS wrapped in HTML" in let doc = "Dump treemap SVG and CSS wrapped in HTML" in
Cmdliner.Term.(pure print_treemap_html $ Arg.elf_path $ Arg.elf_size), Cmdliner.Term.(pure print_treemap_html $ Arg.elf_path $ Arg.elf_size),

View file

@ -1,5 +1,5 @@
(executable (executable
(name builder_viz) (name builder_viz)
(public_name builder-viz) (public_name builder-viz)
(libraries (libraries
tyxml bos caqti-lwt cmdliner rresult tyxml bos caqti-lwt cmdliner rresult

View file

@ -204,7 +204,7 @@ let add_routes datadir =
[ "dependencies"; opam_switch_path ] [ "dependencies"; opam_switch_path ]
|> visualization_cmd |> visualization_cmd
in in
let job_build_viztreemap req = let job_build_viztreemap req =
let _job_name = Dream.param "job" req let _job_name = Dream.param "job" req
and build = Dream.param "build" req in and build = Dream.param "build" req in

View file

@ -108,7 +108,7 @@ let layout ?include_static_css ?nav:(nav_=`Default) ~title:title_ body_ =
] ]
in in
(*> Note: Last declared CSS wins - so one can override here*) (*> Note: Last declared CSS wins - so one can override here*)
let static_css = static_css :: Option.to_list include_static_css let static_css = static_css :: Option.to_list include_static_css
in in
html html
(head (title (txt title_)) (head (title (txt title_))
@ -303,7 +303,7 @@ let markdown_to_html data =
Omd.to_html omd Omd.to_html omd
module Job = struct module Job = struct
let make ~failed name platform readme builds = let make ~failed name platform readme builds =
layout ~nav:(`Job (name, platform)) ~title:(Fmt.str "Job %s %a" name pp_platform platform) layout ~nav:(`Job (name, platform)) ~title:(Fmt.str "Job %s %a" name pp_platform platform)
((h1 [txtf "Job %s %a" name pp_platform platform] :: ((h1 [txtf "Job %s %a" name pp_platform platform] ::
@ -342,15 +342,15 @@ module Job = struct
let contains_debug_bin artifacts = let contains_debug_bin artifacts =
let check f = let check f =
Fpath.has_ext "debug" f.Builder_db.filepath Fpath.has_ext "debug" f.Builder_db.filepath
in in
List.exists check artifacts List.exists check artifacts
module Build = struct module Build = struct
let make_build_info let make_build_info
~name ~name
~delta ~delta
~(build:Builder_db.Build.t) (* ({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build) *) ~(build:Builder_db.Build.t) (* ({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build) *)
~artifacts ~artifacts
~same_input_same_output ~same_input_same_output
@ -454,7 +454,7 @@ module Job = struct
min-width: 38em; min-width: 38em;
min-height: 41em; min-height: 41em;
" "
let make_viz_section ~name ~artifacts ~uuid = let make_viz_section ~name ~artifacts ~uuid =
[ [
(* [ h3 [txt "Analysis"] ]; *) (* [ h3 [txt "Analysis"] ]; *)
@ -491,7 +491,7 @@ module Job = struct
let left_column = let left_column =
make_build_info make_build_info
~name ~name
~delta ~delta
~build ~build
~artifacts ~artifacts
~same_input_same_output ~same_input_same_output
@ -501,7 +501,7 @@ module Job = struct
in in
let style_grid = a_style "display: flex; " in let style_grid = a_style "display: flex; " in
let style_grid_container = a_style "\ let style_grid_container = a_style "\
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-width: 83em; min-width: 83em;
@ -531,7 +531,7 @@ module Job = struct
end end
end end
let key_values xs = let key_values xs =
List.concat_map (fun (k, v) -> [ txtf "%s %s" k v ; br () ]) xs List.concat_map (fun (k, v) -> [ txtf "%s %s" k v ; br () ]) xs
@ -703,4 +703,4 @@ let failed_builds ~start ~count builds =
txt "."; txt ".";
] ]
]) ])