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

Add docker_wrapper and associated client/server changes #5855

Merged
merged 32 commits into from
Oct 25, 2024

Conversation

davidpanderson
Copy link
Contributor

Support app versions that run jobs in Docker containers.
This also works with podman, an open-source and daemonless Docker equivalent.

Also: some changes to the client in terms of how Docker and podman are detected,
and the corresponding data structures.

Also: minor changes to the scheduler for parsing this info
(to be used by plan class specs).

Fixes #5825

davidpanderson and others added 30 commits October 6, 2024 00:24
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Instead, use a WSL container containing the docker engine,
and send it commands using the WSL mechanism
An image (especially in the universal model) may contain WU-specific files,
or maybe completely a function of the WU.

It's OK if we create lots of images.
In general they'll share most of their layers
so there's no disk penalty.
Remove container and image at end of job
User docker log to should output from container

In standalone mode, slot dir is . and project is project/

Add some verbose output; send all debugging output to stderr
We don't use Docker Desktop.
Instead we use a WSL Ubuntu 24.04 image in which podman is installed.
    Either or both could be present on both Linux and Win/WSL.
    If both, use podman.
    Do this separately for engine and compose;
    a host could have the podman engine but Docker compose.

data structures:
old: (in both HOSTINFO and WSL_DISTRO):
    bool is_docker_available: it's present, AND allowed by config
    string docker_version
    ... and same for docker_compose
new:
    string docker_version: empty if not present
    DOCKER_TYPE docker_version_type (DOCKER or PODMAN)
        We send this in sched requests even if Docker disallowed by prefs
        (send that flag separately).
    This way projects can know what software a host has,
    even if they can't use it.
    (Should use this approach with VBox too)
… requests.

(still query the presence of docker, and report it in sched requests).

scheduler: parse the above

docker_wrapper: use either docker or podman, depending on what's there
(on the host (Unix) or in a WSL distro (Win))
use pause/unpause instead of start/stop
Note: this works with podman only if root;
need to figure out how to do that
needed for podman's pause and unpause to work

Add a lib function run_command_pipe() for this purpose.
@AenBleidd
Copy link
Member

@davidpanderson, please fix build error: https://github.com/BOINC/boinc/actions/runs/11507373201/job/32033412490?pr=5855
And also afterwards please fix the formatting error by running next command while being in the root folder of the BOINC source code:

python3 ci_tools/trailing_whitespaces_check.py . --fix

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 82 lines in your changes missing coverage. Please review.

Project coverage is 10.76%. Comparing base (370c32a) to head (e4f0452).
Report is 67 commits behind head on master.

Files with missing lines Patch % Lines
lib/hostinfo.cpp 0.00% 53 Missing ⚠️
lib/wslinfo.cpp 0.00% 18 Missing ⚠️
lib/util.cpp 0.00% 9 Missing ⚠️
sched/sched_types.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5855      +/-   ##
============================================
+ Coverage     10.51%   10.76%   +0.25%     
  Complexity     1068     1068              
============================================
  Files           280      280              
  Lines         36021    36493     +472     
  Branches       8441     8444       +3     
============================================
+ Hits           3789     3930     +141     
- Misses        31843    32174     +331     
  Partials        389      389              
Files with missing lines Coverage Δ
lib/common_defs.h 0.00% <ø> (ø)
lib/util.h 40.00% <ø> (ø)
lib/wslinfo.h 0.00% <ø> (ø)
sched/plan_class_spec.h 0.00% <ø> (ø)
sched/sched_types.h 0.00% <ø> (ø)
sched/sched_types.cpp 0.00% <0.00%> (ø)
lib/util.cpp 32.23% <0.00%> (-2.60%) ⬇️
lib/wslinfo.cpp 0.00% <0.00%> (ø)
lib/hostinfo.cpp 0.00% <0.00%> (ø)

... and 93 files with indirect coverage changes

@davidpanderson
Copy link
Contributor Author

Done

@AenBleidd AenBleidd merged commit 9c9ccad into master Oct 25, 2024
145 of 146 checks passed
@AenBleidd AenBleidd deleted the dpa_docker_wrapper branch October 25, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment