Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendoring solver service #634

Merged
merged 10 commits into from
Jan 4, 2023

Conversation

moyodiallo
Copy link
Contributor

Solver-service replace the local solver. And ocam-ci-service can submit for solving to a scheduler that manage a solver-worker.

ocaml-ci-service can be depolyed like the previous version, and also possible to launch it by providing a submission cap file for a scheduler that manage a solver-worker.

@moyodiallo moyodiallo force-pushed the vendoring-solver-service branch 2 times, most recently from 3b1dfb3 to ea3a65c Compare November 25, 2022 09:09
@moyodiallo
Copy link
Contributor Author

It is a specific branch (https://github.com/ocurrent/solver-service/tree/solver-ci) that is vendored. The difference to the main (https://github.com/ocurrent/solver-service/tree/main) is that all the vendored dependencies is removed, because of some conflict (ocaml-dockerfile, ocurrent, ocluster).

After the merge of ocaml/dune#6577 and the next release after that, it's going to be OK to vendor the main branch of solver-service and override its conflict dependencies.

Copy link
Contributor

@MisterDA MisterDA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, I'll test tomorrow and I'll test on Windows too!

test/web/test.mli Outdated Show resolved Hide resolved
service/local.ml Outdated Show resolved Hide resolved
service/main.ml Outdated Show resolved Hide resolved
@maiste
Copy link
Member

maiste commented Nov 29, 2022

Just a note for GitHub to simplify issue tracking. This addresses #446.

@MisterDA
Copy link
Contributor

MisterDA commented Dec 1, 2022

Can you rebase? There are some conflicts introduced by Etienne's merge of migrations.

@moyodiallo
Copy link
Contributor Author

Rebase done.

Copy link
Member

@maiste maiste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Small question but will the solver-service be released in opam? The current system removes the possibility of building ocaml-ci deps with opam install --deps-only as it can't find the solver service.

gitlab/main.ml Outdated Show resolved Hide resolved
service/local.ml Outdated Show resolved Hide resolved
service/main.ml Outdated Show resolved Hide resolved
@moyodiallo
Copy link
Contributor Author

Small question but will the solver-service be released in opam?

I think this is the goal, but at the moment it's not a big deal because of vendoring make it as a part of the project.

@MisterDA MisterDA self-requested a review December 3, 2022 11:27
Copy link
Contributor

@MisterDA MisterDA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/solver_pool.ml is dead code, remove this file.

@MisterDA
Copy link
Contributor

MisterDA commented Dec 5, 2022

I'm ok with the changes, but I've opened a bunch of PRs on upstream solver-service. I'd like your input there, and then you can update the submodule here, and I'll keep testing on Windows after.

@maiste
Copy link
Member

maiste commented Dec 5, 2022

Should this be deployed on live-engine with GitHub to ensure it can support the charge?

@moyodiallo
Copy link
Contributor Author

Should this be deployed on live-engine with GitHub to ensure it can support the charge?

Not ready yet, I talk with @mtelvers and @tmcgilchrist about this deployment and we notice it needs some investigation about how many process is spawned for each request. It seems each time the solver-worker receive a request there's more than one process spawned for solving. And what expected is one request for one process(make more sense).

@moyodiallo
Copy link
Contributor Author

After the merge of ocurrent/solver-service#30 and ocurrent/solver-service#31, I think it's OK to merge and start deploying in order to test the change. We know now, how the solver-service is spawning processes (ocurrent/solver-service#31).

@tmcgilchrist @mtelvers

@moyodiallo
Copy link
Contributor Author

This is PR is ready to be merged. Any suggestion ?

@maiste
Copy link
Member

maiste commented Dec 15, 2022

Could we try it on live-engine before merging as we have done for the MacOS worker?

@moyodiallo moyodiallo force-pushed the vendoring-solver-service branch 2 times, most recently from b126e21 to 1ec71a2 Compare December 16, 2022 09:51
Copy link
Member

@maiste maiste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version is working on my local test 👍

@@ -34,8 +39,11 @@ RUN opam pin add -yn current_docker.dev "./ocurrent" && \
opam pin add -yn ocaml-version.dev "./ocaml-version" && \
opam pin add -yn dockerfile.dev "./ocaml-dockerfile" && \
opam pin add -yn dockerfile-opam.dev "./ocaml-dockerfile" && \
opam pin add -yn solver-service-api.dev "./solver-service" && \
opam pin add -yn solver-service.dev "./solver-service" && \
opam pin add -yn solver-worker.dev "./solver-service" && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
opam pin add -yn solver-worker.dev "./solver-service" && \

Pinning the solver-worker is not required here.

Copy link
Contributor Author

@moyodiallo moyodiallo Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, even solver-service.dev is not needed, only solver-service_api.dev

COPY --chown=opam \
solver-service/solver-service-api.opam \
solver-service/solver-service.opam \
solver-service/solver-worker.opam \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
solver-service/solver-worker.opam \

Dockerfile Outdated
COPY --chown=opam \
solver-service/solver-service-api.opam \
solver-service/solver-service.opam \
solver-service/solver-worker.opam \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
solver-service/solver-worker.opam \

Dockerfile Outdated
@@ -32,8 +37,11 @@ RUN opam pin add -yn current_docker.dev "./ocurrent" && \
opam pin add -yn ocaml-version.dev "./ocaml-version" && \
opam pin add -yn dockerfile.dev "./ocaml-dockerfile" && \
opam pin add -yn dockerfile-opam.dev "./ocaml-dockerfile" && \
opam pin add -yn solver-service-api.dev "./solver-service" && \
opam pin add -yn solver-service.dev "./solver-service" && \
opam pin add -yn solver-worker.dev "./solver-service" && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
opam pin add -yn solver-worker.dev "./solver-service" && \


type t =
[ `Remote of Current_ocluster.Connection.t
| `Local of Ocaml_ci_api.Solver.t Lwt.t ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these constructors aren't used elsewhere they can just be regular variants.

lib/platform.ml Outdated
@@ -140,7 +140,7 @@ module Query = struct
let run No_context job { Key.docker_context; variant }
{ Value.image; host_image } =
Current.Job.start job ~level:Current.Level.Mostly_harmless >>= fun () ->
let prep_image = Fmt.str "ocurrent/ocaml-ci:%a" Variant.pp variant in
let prep_image = "ocurrent/ocaml-ci:" ^ Variant.docker_tag variant in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let prep_image = "ocurrent/ocaml-ci:" ^ Variant.docker_tag variant in
let prep_image = Fmt.str "ocurrent/ocaml-ci:%s" (Variant.docker_tag variant) in

@@ -62,7 +62,7 @@ let expected_linux_spec =
(* Create testable Sexp for Alcotest. *)
let sexp = Alcotest.testable Sexplib0__Sexp.pp_hum Sexplib0__Sexp.equal

let test_macos_spec () =
let test_macos_spec _ () =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why these tests need to use Alcotest LWT now. They do not require any LWT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids splitting the tests in LWT and none.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to fit the tests in two categories test/service and test/web.

test/service/dune Outdated Show resolved Hide resolved
@tmcgilchrist tmcgilchrist merged commit 2b8bc91 into ocurrent:master Jan 4, 2023
@moyodiallo moyodiallo deleted the vendoring-solver-service branch December 5, 2023 14:22
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants