Пример #1
0
 def add_container_volumes(self):
     self.cmd_container_execution += ["-v", lambda_instance.temporal_folder]
     self.cmd_container_execution += ["-v", "/dev", "-v", "/proc", "-v", "/etc/hosts", "--nosysdirs"]
     if utils.is_variable_in_environment('EXTRA_PAYLOAD'):
         self.cmd_container_execution += ["-v", lambda_instance.permanent_folder]
Пример #2
0
 def has_input_bucket(self):
     return utils.is_variable_in_environment('INPUT_BUCKET')
Пример #3
0
import shutil
import subprocess
import traceback
import socket
import uuid
import base64
import sys
from urllib.parse import unquote_plus

sys.path.append("..")
sys.path.append(".")
# Works in lambda environment
import src.utils as utils

logger = logging.getLogger()
if utils.is_variable_in_environment('LOG_LEVEL'):
    logger.setLevel(utils.get_environment_variable('LOG_LEVEL'))
else:
    logger.setLevel('INFO')
logger.info('SCAR: Loading lambda function')
lambda_instance = None

#######################################
#        S3 RELATED FUNCTIONS         #
#######################################
class S3():
    
    @utils.lazy_property
    def client(self):
        client = boto3.client('s3')
        return client
Пример #4
0
 def has_output_bucket_folder(self):
     return utils.is_variable_in_environment('OUTPUT_FOLDER')
Пример #5
0
 def get_extra_payload_path(self):
     ppath = []
     if utils.is_variable_in_environment('EXTRA_PAYLOAD'):
         ppath += self.parse_container_environment_variable("EXTRA_PAYLOAD", 
                                                            utils.get_environment_variable("EXTRA_PAYLOAD"))
     return ppath