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.
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 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.
* 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
```
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`):
```ocaml
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_type.unit
{| 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,
console, script, main_binary, job
FROM build |}
let insert_old_build =
Caqti_request.exec ~oneshot:true
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)
>>= fun main_binary_id ->
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 () ->
Db.exec drop_build () >>= fun () ->
Db.exec rename_build () >>= fun () ->
Db.exec idx_build_job_start () >>= fun () ->
Db.exec (Grej.set_version new_version) ()
let rollback _ (module Db : Caqti_blocking.CONNECTION) =
let open Grej.Infix in
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)
>>= fun filepath ->
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 () ->
Db.exec drop_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
in
Some section, infer_synopsis_and_descr opam_switch
let remove_tag =
Caqti_request.exec
Caqti_type.unit

View file

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

View file

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

View file

@ -204,7 +204,7 @@ let add_routes datadir =
[ "dependencies"; opam_switch_path ]
|> visualization_cmd
in
let job_build_viztreemap req =
let _job_name = Dream.param "job" req
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
(*> 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
html
(head (title (txt title_))
@ -303,7 +303,7 @@ let markdown_to_html data =
Omd.to_html omd
module Job = struct
let make ~failed name platform readme builds =
layout ~nav:(`Job (name, platform)) ~title:(Fmt.str "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 check f =
Fpath.has_ext "debug" f.Builder_db.filepath
Fpath.has_ext "debug" f.Builder_db.filepath
in
List.exists check artifacts
module Build = struct
module Build = struct
let make_build_info
~name
~delta
~delta
~(build:Builder_db.Build.t) (* ({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build) *)
~artifacts
~same_input_same_output
@ -454,7 +454,7 @@ module Job = struct
min-width: 38em;
min-height: 41em;
"
let make_viz_section ~name ~artifacts ~uuid =
[
(* [ h3 [txt "Analysis"] ]; *)
@ -491,7 +491,7 @@ module Job = struct
let left_column =
make_build_info
~name
~delta
~delta
~build
~artifacts
~same_input_same_output
@ -501,7 +501,7 @@ module Job = struct
in
let style_grid = a_style "display: flex; " in
let style_grid_container = a_style "\
display: flex;
display: flex;
align-items: center;
justify-content: center;
min-width: 83em;
@ -531,7 +531,7 @@ module Job = struct
end
end
let key_values 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 ".";
]
])