Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-11 08:41:05

0001 #!/usr/bin/env python
0002 # Licensed under the Apache License, Version 2.0 (the "License");
0003 # you may not use this file except in compliance with the License.
0004 # You may obtain a copy of the License at
0005 # http://www.apache.org/licenses/LICENSE-2.0
0006 #
0007 # Authors:
0008 # - Paul Nilsson, paul.nilsson@cern.ch, 2017-2021
0009 
0010 # import logging
0011 # logger = logging.getLogger(__name__)
0012 
0013 
0014 def do_use_container(**kwargs):
0015     """
0016     Decide whether to use a container or not.
0017 
0018     :param kwargs: dictionary of key-word arguments.
0019     :return: True is function has decided that a container should be used, False otherwise (boolean).
0020     """
0021 
0022     return True
0023 
0024 
0025 def wrapper(executable, **kwargs):
0026     """
0027     Wrapper function for any container specific usage.
0028     This function will be called by pilot.util.container.execute() and prepends the executable with a container command.
0029 
0030     :param executable: command to be executed (string).
0031     :param kwargs: dictionary of key-word arguments.
0032     :return: executable wrapped with container command (string).
0033     """
0034 
0035     return executable
0036 
0037 
0038 def create_stagein_container_command(workdir, cmd):
0039     """
0040     Create the stage-in container command.
0041 
0042     The function takes the isolated stage-in command, adds bits and pieces needed for the containerisation and stores
0043     it in a stagein.sh script file. It then generates the actual command that will execute the stage-in script in a
0044     container.
0045 
0046     :param workdir: working directory where script will be stored (string).
0047     :param cmd: isolated stage-in command (string).
0048     :return: container command to be executed (string).
0049     """
0050 
0051     return cmd