client: fix bug in Docker cleanup

docker wrapper: pass cmdline args in an env var ARGS
This commit is contained in:
davidpanderson 2024-12-03 01:18:56 -08:00
parent 2ae1d9a9d1
commit b45b2c0f7e
3 changed files with 7 additions and 5 deletions

View File

@ -238,7 +238,7 @@ void CLIENT_STATE::app_test_init() {
);
#endif
#ifdef APP_DOCKER_WRAPPER
wu->command_line = "--verbose";
wu->command_line = "--verbose --nsecs 20";
wu->input_files.push_back(
*make_file(proj, "infile", "in", INPUT_FILE, false)
);

View File

@ -422,7 +422,7 @@ void cleanup_docker(DOCKER_JOB_INFO &info, DOCKER_CONN &dc) {
if (!docker_is_boinc_name(name.c_str())) continue;
if (info.container_present(name)) continue;
sprintf(cmd, "rm %s", name.c_str());
retval = dc.command(cmd, out);
retval = dc.command(cmd, out2);
if (retval) {
fprintf(stderr, "Docker command failed: %s\n", cmd);
continue;

View File

@ -291,16 +291,18 @@ int create_container() {
);
}
}
sprintf(cmd, "create --name %s %s %s %s",
sprintf(cmd, "create --name %s %s %s",
container_name,
slot_cmd, project_cmd,
image_name
slot_cmd, project_cmd
);
// add command-line args
strcat(cmd, " -e ARGS=\"");
for (string arg: app_args) {
strcat(cmd, " ");
strcat(cmd, arg.c_str());
}
strcat(cmd, "\" ");
strcat(cmd, image_name);
retval = docker_conn.command(cmd, out);
if (retval) return retval;
if (error_output(out)) return -1;