Conversation
talex5
left a comment
There was a problem hiding this comment.
There shouldn't be any docker-specific stuff in build.ml. Can the sandbox API be extended to allow making all this generic?
|
Thinking on about this... the Build module creates a builder from a store and a sandbox. That will work on Linux (runc+btrfs), mac (users+zfs) and probably on FreeBSD (jails+zfs). But it doesn't work with Docker, because Docker already combines a store and a sandbox. So probably this should be an alternative to the build.ml module instead. |
|
Thanks for the review, I agree with your conclusion and will refactor the code to merge the Docker sandbox, A note regarding the use of the Docker Engine API: I wanted to replace the process calls to the
I'm putting this on hold for now, and I'll stay with the docker client until openapi-generator is fixed. |
52288a1 to
da98be5
Compare
fdaea39 to
1920afa
Compare
c8729ea to
68e9084
Compare
To avoid code duplication with the users of OBuilder as a library (think ocluster-worker).
Otherwise embedded text get crlf line endings.
Mounts are read-write to preserve current behaviour.
This allows to specify the entrypoint of a `Sandbox.run job`. This is only needed for the Docker sandbox, to override the Docker image entrypoint.
Granted, it's more difficult to read, but way easier to copy-paste to inspect manually what's happening.
This prevents errors on Windows where a file cannot be renamed, moved or deleted if it is open by another process. It also ensure that the database is left in a clean state.
…q-cmdliner', 'MisterDA/docker-windows-spec' and 'MisterDA/docker-windows-prerequisites' into docker
Checking the result for the Docker backend requires asynchronous calls to Docker.
With the Docker backend on Windows, it's easier to store logs in a location where they're not moved, as a directory cannot be renamed if it contains open file descriptors. For the btrfs and zfs backends, the original location is retained.
|
I lost the race to merge before macOS. The rebase wasn't easy, I've probably broken one or two new things in my code. |
This PR implements the Docker backend for OBuilder. It should support running on Windows with Docker for Windows, and on Linux with the usual Docker.
This PR contains a batch of prerequisites, and then the backend.
I have tested it on Windows and Linux, on basic examples.
is_blockingindupanddup2to fixENOTSOCKon Windows ocsigen/lwt#869?cloexec:boolargument to wrappedUnixfunctions inLwt_unixocsigen/lwt#901