Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
moyodiallo committed Dec 4, 2023
1 parent 53e4c0e commit ffe2df9
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 47 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM ocaml/opam:debian-12-ocaml-5.1 AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev libzstd-dev -y --no-install-recommends
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard b61304c6db353e679a36720d8b914b029d6fbc0c && opam update
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard bc52affc41b55ff00c0d3ac9a376538d79695aaf && opam update
RUN sudo ln -sf /usr/bin/opam-2.1 /usr/bin/opam
COPY --chown=opam scache/scache.opam /src/scache/
COPY --chown=opam solver-service.opam solver-service-api.opam /src/
WORKDIR /src
RUN opam pin add -yn scache.dev "./scache"
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam exec -- dune build @install
Expand Down
4 changes: 3 additions & 1 deletion dune
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
(dirs :standard \ var cache)
(dirs :standard \ var)

(vendored_dirs scache)
117 changes: 83 additions & 34 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,48 +1,97 @@
(lang dune 3.7)

(name solver-service)

(formatting (enabled_for dune))
(formatting
(enabled_for dune))

(generate_opam_files true)
(source (github ocurrent/solver-service))
(authors "Thomas Leonard <[email protected]>" "Patrick Ferris <[email protected]>")
(maintainers "[email protected]" "Tim McGilchrist <[email protected]>")

(source
(github ocurrent/solver-service))

(authors
"Thomas Leonard <[email protected]>"
"Patrick Ferris <[email protected]>")

(maintainers [email protected] "Tim McGilchrist <[email protected]>")

(package
(name solver-service)
(synopsis "Choose package versions to test")
(depends
(ocaml (>= 5.0.0))
; Examples dependencies
(current_web (and (>= 0.6.4) :with-test))
(current_git (and (>= 0.6.4) :with-test))
(current_github (and (>= 0.6.4) :with-test))
(current_ocluster (and (>= 0.2.1) :with-test))
(ppx_deriving_yojson (>= 3.6.1))
(ppx_deriving (>= 5.1))
(yojson (>= 2.1.0))
(lwt (>= 5.6.1))
(eio (>= 0.12))
(eio_main (>= 0.12))
(lwt_eio (>= 0.5))
(logs (>= 0.7.0))
(fmt (>= 0.9.0))
(ocaml-version (>= 3.6.1))
(solver-service-api (= :version))
(dune-build-info (>= 3.8.0))
(opam-0install (>= 0.4.3))
(git-unix (>= 3.12.0))
(ocluster-api (>= 0.2.1))
(prometheus-app (>= 1.2))
(capnp-rpc-net (>= 1.2.3))
(capnp-rpc-unix (>= 1.2.3)))
(conflicts (carton (< 0.4.2))))
(opam-file-format
(>= 2.1.6))
(ocaml
(>= 5.0.0))
(current_web
(and
(>= 0.6.4)
:with-test))
(current_git
(and
(>= 0.6.4)
:with-test))
(current_github
(and
(>= 0.6.4)
:with-test))
(current_ocluster
(and
(>= 0.2.1)
:with-test))
(ppx_deriving_yojson
(>= 3.6.1))
(ppx_deriving
(>= 5.1))
(yojson
(>= 2.1.0))
(lwt
(>= 5.6.1))
(eio
(>= 0.12))
(eio_main
(>= 0.12))
(lwt_eio
(>= 0.5))
(logs
(>= 0.7.0))
(fmt
(>= 0.9.0))
sqlite3
(ocaml-version
(>= 3.6.1))
(solver-service-api
(= :version))
(dune-build-info
(>= 3.8.0))
(opam-0install
(>= 0.4.3))
(git-unix
(>= 3.12.0))
(ocluster-api
(>= 0.2.1))
(prometheus-app
(>= 1.2))
(capnp-rpc-net
(>= 1.2.3))
(capnp-rpc-unix
(>= 1.2.3)))
(conflicts
(carton
(< 0.4.2))))

(package
(name solver-service-api)
(synopsis "Cap'n Proto API for the solver service")
(depends
(ocaml (>= 4.14.1))
(capnp (>= 3.5.0))
(capnp-rpc-lwt (>= 1.2.3))
(ppx_deriving_yojson (>= 3.6.1))
(ppx_deriving (>= 5.1))))
(ocaml
(>= 4.14.1))
(capnp
(>= 3.5.0))
(capnp-rpc-lwt
(>= 1.2.3))
(ppx_deriving_yojson
(>= 3.6.1))
(ppx_deriving
(>= 5.1))))
22 changes: 11 additions & 11 deletions service/git_clone.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ module Make (Cache : CacheType) = struct
let run_rm ?cwd t args =
Eio.Process.run (Cache.process_mgr t) (rm_command ?cwd args)

let line_opt r =
if Eio.Buf_read.at_end_of_input r then None
else Some (Eio.Buf_read.line r)
let line_opt r =
if Eio.Buf_read.at_end_of_input r then None
else Some (Eio.Buf_read.line r)

let run_git_line ?cwd t args =
Eio.Process.parse_out (Cache.process_mgr t) line_opt (git_command ?cwd args)
let run_git_line ?cwd t args =
Eio.Process.parse_out (Cache.process_mgr t) line_opt (git_command ?cwd args)

let take_all_opt r =
if Eio.Buf_read.at_end_of_input r then None
Expand Down Expand Up @@ -141,18 +141,18 @@ let run_git_line ?cwd t args =
let clone_path = repo_url_to_clone_path t repo_url |> Fpath.to_string in
run_git_lines t ~cwd:clone_path
@@ "log"
:: "--reverse"
:: [ "--format=format:%H" ]
:: "--reverse"
:: [ "--format=format:%H" ]
|> Option.value ~default:[]

let diff_pkgs t ~repo_url ~new_commit ~old_commit =
let clone_path = repo_url_to_clone_path t repo_url |> Fpath.to_string in
run_git_take_all t ~cwd:clone_path
@@ "diff"
:: old_commit
:: new_commit
:: "--"
:: [ "packages" ]
:: old_commit
:: new_commit
:: "--"
:: [ "packages" ]
|> function
| None -> []
| Some diff ->
Expand Down
2 changes: 2 additions & 0 deletions solver-service.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ homepage: "https://github.com/ocurrent/solver-service"
bug-reports: "https://github.com/ocurrent/solver-service/issues"
depends: [
"dune" {>= "3.7"}
"opam-file-format" {>= "2.1.6"}
"ocaml" {>= "5.0.0"}
"current_web" {>= "0.6.4" & with-test}
"current_git" {>= "0.6.4" & with-test}
Expand All @@ -23,6 +24,7 @@ depends: [
"lwt_eio" {>= "0.5"}
"logs" {>= "0.7.0"}
"fmt" {>= "0.9.0"}
"sqlite3"
"ocaml-version" {>= "3.6.1"}
"solver-service-api" {= version}
"dune-build-info" {>= "3.8.0"}
Expand Down

0 comments on commit ffe2df9

Please sign in to comment.