|
ATLAS Offline Software
|
Go to the documentation of this file.
55 using namespace msgEventLoop;
61 data.batchSkipReleaseSetup =
true;
68 const std::string dockerImage {
71 const std::string dockerOptions {
73 if (!dockerOptions.empty())
77 ANA_MSG_WARNING (
"instead you need to provide your own kubernetes config file");
81 const std::string batchSetupFile {
86 const std::string batchConfigFile {
88 std::string baseConfig;
91 baseConfig = std::string (std::istreambuf_iterator<char>(
file),
92 std::istreambuf_iterator<char>() );
94 baseConfig =
RCU::substitute (baseConfig,
"%%DOCKERIMAGE%%", dockerImage);
97 std::ostringstream basedirName;
98 basedirName <<
data.submitDir <<
"/tmp";
101 if (gSystem->MakeDirectory (basedirName.str().c_str()) != 0)
102 RCU_THROW_MSG (
"failed to create directory " + basedirName.str());
105 const std::string jobFilePath {
data.submitDir +
"/job.yml"};
108 std::ofstream jobFile (jobFilePath.c_str());
109 if (!batchSetupFile.empty())
112 std::string setupConfig {std::istreambuf_iterator<char>(
file),
113 std::istreambuf_iterator<char>()};
114 setupConfig =
RCU::substitute (setupConfig,
"%%DOCKERIMAGE%%", dockerImage);
116 jobFile << setupConfig;
120 for (std::size_t jobIndex :
data.batchJobIndices)
122 std::ostringstream dirName;
123 dirName << basedirName.str() <<
"/" << jobIndex;
124 if (gSystem->MakeDirectory (dirName.str().c_str()) != 0)
125 RCU_THROW_MSG (
"failed to create directory " + dirName.str());
132 std::string myConfig = baseConfig;
135 command <<
data.submitDir <<
"/submit/run " << jobIndex;
138 jobFile << myConfig <<
"\n";
142 std::ostringstream
cmd;
143 cmd <<
"kubectl create -f " << jobFilePath;
145 data.submitted =
true;
152 return ::StatusCode::SUCCESS;
char data[hepevt_bytes_allocation_ATLAS]
@ batchScriptVar
create the variables needed for the batch-run script
a Driver to run on Kubernetes
static const std::string optDockerImage
this is the name of the docker image, when using docker with a supported batch driver
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
KubernetesDriver()
effects: standard default constructor guarantee: strong failures: low level errors I
@ doResubmit
call the actual doResubmit method
ClassImp(EL::KubernetesDriver) namespace EL
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
::StatusCode StatusCode
StatusCode definition for legacy code.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
static const std::string optDockerOptions
any extra options we may want to pass to docker
static const std::string optBatchConfigFile
the job submission configuration file (used by some drivers that need more complex configuration)
std::string to_string(const DetectorType &type)
std::string PathResolverFindDataFile(const std::string &logical_file_name)
std::string substitute(const std::string &str, const std::string &pattern, const std::string &with)
effects: substitute all occurences of "pattern" with "with" in the string "str" returns: the substitu...
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...
#define RCU_THROW_MSG(message)
#define RCU_READ_INVARIANT(x)
@ submitJob
do the actual job submission
static const std::string optBatchSetupFile
the job submission setup file.
#define RCU_NEW_INVARIANT(x)