Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ void CLIENT_STATE::show_host_info() {
);
}
if (!wsl.docker_version.empty()) {
msg_printf(NULL, MSG_INFO, "- Docker version %s (%s)",
wsl.docker_version.c_str(),
docker_type_str(wsl.docker_type)
msg_printf(NULL, MSG_INFO, "- %s version %s",
docker_type_str(wsl.docker_type),
wsl.docker_version.c_str()
);
}
if (!wsl.docker_compose_version.empty()) {
msg_printf(NULL, MSG_INFO, "- Docker compose version %s (%s)",
wsl.docker_compose_version.c_str(),
docker_type_str(wsl.docker_compose_type)
msg_printf(NULL, MSG_INFO, "- %s compose version %s",
docker_type_str(wsl.docker_compose_type),
wsl.docker_compose_version.c_str()
);
}
if (wsl.boinc_buda_runner_version) {
Expand Down Expand Up @@ -327,15 +327,15 @@ void CLIENT_STATE::show_host_info() {

#ifndef _WIN64
if (strlen(host_info.docker_version)) {
msg_printf(NULL, MSG_INFO, "Docker: version %s (%s)",
host_info.docker_version,
docker_type_str(host_info.docker_type)
msg_printf(NULL, MSG_INFO, "%s: version %s",
docker_type_str(host_info.docker_type),
host_info.docker_version
);
}
if (strlen(host_info.docker_compose_version)) {
msg_printf(NULL, MSG_INFO, "Docker compose: version %s (%s)",
host_info.docker_compose_version,
docker_type_str(host_info.docker_compose_type)
msg_printf(NULL, MSG_INFO, "%s compose: version %s",
docker_type_str(host_info.docker_compose_type),
host_info.docker_compose_version
);
}
#endif
Expand Down Expand Up @@ -2510,14 +2510,18 @@ void show_docker_messages() {
return;
}

const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Docker-on-Windows";
const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Podman-on-Windows";
#elif defined(__APPLE__)
const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Docker-on-Mac";
const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Podman-on-Mac";
#else
const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Docker-on-Linux";
const char* url = "https://github.com/BOINC/boinc/wiki/Installing-Podman-on-Linux";
#endif
if (gstate.host_info.have_docker()) {
if (!gstate.host_info.have_docker()) {
msg_printf_notice(0, true, url,
"Some projects require Podman; we recommend that you install it."
);
#ifdef _WIN32
} else {
int bdv = gstate.host_info.wsl_distros.boinc_distro_version();
if (bdv) {
if (bdv < gstate.latest_boinc_buda_runner_version) {
Expand All @@ -2528,7 +2532,7 @@ void show_docker_messages() {
}
} else {
msg_printf_notice(0, true, url,
"Docker is present but not using the BOINC WSL distro. Some project apps may not function properly. We recommend that you install the BOINC WSL distro."
"Docker or Podman is present but not using the BOINC WSL distro. Some project apps may not function properly. We recommend that you install the BOINC WSL distro."
);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion client/client_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ bool APP_VERSION::disallowed_by_config(PROJECT *p) {
}
if (cc_config.dont_use_docker && strstr(plan_class, "docker")) {
msg_printf(p, MSG_INFO,
"skipping Docker app: disabled in cc_config.xml"
"skipping Podman app: disabled in cc_config.xml"
);
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions client/cpu_sched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ struct PROC_RESOURCES {
}
}

// if job uses Docker, make sure it's installed
// if job uses Podman, make sure it's installed
//
if (rp->uses_docker()) {
if (!gstate.host_info.have_docker()) {
static bool first = true;
if (first) {
msg_printf(NULL, MSG_USER_ALERT,
"Docker jobs are present but Podman/Docker not found; please install it."
"Podman jobs are present but Podman not found; please install it."
);
msg_printf(NULL, MSG_USER_ALERT,
"See https://github.com/BOINC/boinc/wiki/Installing-Docker"
"See https://github.com/BOINC/boinc/wiki/Installing-Podman"
);
first = false;
}
Expand Down
28 changes: 19 additions & 9 deletions client/cs_apps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ struct DOCKER_JOB_INFO {
}
};

// clean up a Docker installation
// clean up a Podman installation
// (Unix: the host; Win: a WSL distro)
//
void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
Expand All @@ -409,7 +409,9 @@ void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
//
retval = dc.command("ps --all", out, false);
if (retval) {
fprintf(stderr, "Docker command failed: ps --all\n");
fprintf(stderr, "%s command failed: ps --all\n",
docker_type_str(dc.type)
);
} else {
for (string line: out) {
retval = dc.parse_container_name(line, name);
Expand All @@ -419,11 +421,14 @@ void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
sprintf(cmd, "rm -f %s", name.c_str());
retval = dc.command(cmd, out2, true);
if (retval) {
fprintf(stderr, "Docker command failed: %s\n", cmd);
fprintf(stderr, "%s command failed: %s\n",
docker_type_str(dc.type), cmd
);
continue;
}
msg_printf(NULL, MSG_INFO,
"Removed unused Docker container: %s", name.c_str()
"Removed unused %s container: %s",
docker_type_str(dc.type), name.c_str()
);
}
}
Expand All @@ -432,7 +437,9 @@ void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
//
retval = dc.command("images", out, false);
if (retval) {
fprintf(stderr, "Docker command failed: images\n");
fprintf(stderr, "%s command failed: images\n",
docker_type_str(dc.type)
);
} else {
for (string line: out) {
retval = dc.parse_image_name(line, name);
Expand All @@ -442,17 +449,20 @@ void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
sprintf(cmd, "image rm %s", name.c_str());
retval = dc.command(cmd, out2, true);
if (retval) {
fprintf(stderr, "Docker command failed: %s\n", cmd);
fprintf(stderr, "%s command failed: %s\n",
docker_type_str(dc.type), cmd
);
continue;
}
msg_printf(NULL, MSG_INFO,
"Removed unused Docker image: %s", name.c_str()
"Removed unused %s image: %s",
docker_type_str(dc.type), name.c_str()
);
}
}
}

// remove old BOINC images and containers from Docker installations
// remove old BOINC images and containers from Podman installations
//
void CLIENT_STATE::docker_cleanup() {
// make lists of the images and containers used by active jobs
Expand All @@ -468,7 +478,7 @@ void CLIENT_STATE::docker_cleanup() {
info.containers.push_back(s);
}

// go through local Docker installations and remove
// go through local Podman installations and remove
// BOINC images and containers not in the above lists
//
#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion client/cs_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) {
set_n_usable_cpus();

#ifdef __APPLE__
// if Podman hasn't inited yet, don't include Docker info in sched req
// if Podman hasn't inited yet, don't include Podman info in sched req
char tmp[256];
safe_strcpy(tmp, host_info.docker_version);
if (host_info.docker_type == PODMAN && !host_info.podman_inited) {
Expand Down
2 changes: 1 addition & 1 deletion client/hostinfo_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ bool HOST_INFO::get_docker_version_aux(DOCKER_TYPE type){
#endif // __APPLE__

#ifdef __linux__
// if we're running as an unprivileged user, Docker/podman may not work.
// if we're running as an unprivileged user, Docker/Podman may not work.
// Check by running the Hello World image.
//
// Since we do this every time on startup: delete the created container
Expand Down
15 changes: 8 additions & 7 deletions client/hostinfo_wsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static bool got_both(WSL_DISTRO &wd) {
// Get list of WSL distros usable by BOINC
// For each of them:
// try to find the OS name and version
// see if Docker and docker compose are present, get versions
// see if Docker/Podman and compose are present, get versions
// Return nonzero on error
//
int get_wsl_information(WSL_DISTROS &distros) {
Expand Down Expand Up @@ -380,7 +380,7 @@ int get_wsl_information(WSL_DISTROS &distros) {
wd.libc_version = parse_ldd_libc(buf.c_str());
}

// see if Docker is installed in the distro
// see if Podman/Docker is installed in the distro
//
get_docker_version(rs, wd);
get_docker_compose_version(rs, wd);
Expand Down Expand Up @@ -467,20 +467,21 @@ static bool get_docker_version_aux(
ret = true;
if (version.empty()) {
msg_printf(0, MSG_INFO,
"Docker version parse failed: %s", reply.c_str()
"%s version parse failed: %s",
docker_type_str(type), reply.c_str()
);
}
} else {
msg_printf(0, MSG_INFO, "Docker detection in %s:",
wd.distro_name.c_str()
msg_printf(0, MSG_INFO, "%s detection in %s:",
docker_type_str(type), wd.distro_name.c_str()
);
msg_printf(0, MSG_INFO, "- cmd: %s", cmd.c_str());
msg_printf(0, MSG_INFO, "- output: %s", reply.c_str());
}
CloseHandle(rs.proc_handle);
} else {
msg_printf(0, MSG_INFO, "Docker detection in %s:",
wd.distro_name.c_str()
msg_printf(0, MSG_INFO, "%s detection in %s:",
docker_type_str(type), wd.distro_name.c_str()
);
msg_printf(0, MSG_INFO, "- cmd failed: %s", cmd.c_str());
}
Expand Down
3 changes: 2 additions & 1 deletion client/log_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void CC_CONFIG::show() {
msg_printf(NULL, MSG_INFO, "Config: don't use VirtualBox");
}
if (dont_use_docker) {
msg_printf(NULL, MSG_INFO, "Config: don't use Docker");
msg_printf(NULL, MSG_INFO, "Config: don't use Podman/Docker");
}
if (dont_use_wsl) {
msg_printf(NULL, MSG_INFO, "Config: don't use Windows Subsystem for Linux");
Expand Down Expand Up @@ -386,6 +386,7 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) {
continue;
}
if (xp.parse_bool("dont_use_docker", dont_use_docker)) continue;
if (xp.parse_bool("dont_use_podman", dont_use_docker)) continue;
if (xp.match_tag("exclude_gpu")) {
EXCLUDE_GPU eg;
retval = eg.parse(xp);
Expand Down
11 changes: 0 additions & 11 deletions lib/hostinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,6 @@ const char* docker_cli_prog(DOCKER_TYPE type) {
return "unknown";
}

// display name
//
const char* docker_type_str(DOCKER_TYPE type) {
switch (type) {
case DOCKER: return "Docker";
case PODMAN: return "podman";
default: break;
}
return "unknown";
}

// parse a string like
// Docker version 24.0.7, build 24.0.7-0ubuntu2~22.04.1
// or
Expand Down
15 changes: 14 additions & 1 deletion lib/hostinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const char file_osrelease[] = "/etc/os-release";
const char file_redhatrelease[] = "/etc/redhat-release";

extern const char* docker_cli_prog(DOCKER_TYPE type);
extern const char* docker_type_str(DOCKER_TYPE type);

// if you add fields, update clear_host_info()

Expand Down Expand Up @@ -224,4 +223,18 @@ extern NXEventHandle gEventHandle;
//
extern int is_filesystem_remote(const char* path, bool&);

// user-visible name
//
inline const char* docker_type_str(DOCKER_TYPE t) {
switch (t) {
case DOCKER:
return "Docker";
case PODMAN:
return "Podman";
case NONE:
break;
}
return "Unknown";
}

#endif
1 change: 1 addition & 0 deletions lib/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ void PROJECT_LIST_ENTRY::clear() {
platforms.clear();
home.clear();
image.clear();
is_account_manager = false;
}

bool compare_project_list_entry(
Expand Down
Loading