Beispiel #1
0
    def __init__(self, namespace='default', sqlfilepath='sqltool-pv-sql', sqlaccountpath='sqltool-pv-account',
                 harbor=None, retrytimes=600, *args, **kwargs):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']


        self.AppInfo['SQLFilePath'] = os.path.join(self.AppInfo['DataStorageBasePath'], '-'.join([namespace, sqlfilepath]))
        self.AppInfo['SQLAccountPath'] = os.path.join(self.AppInfo['DataStorageBasePath'], '-'.join([namespace, sqlaccountpath]))


        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()



        self.DataStorageObj = getClsObj(datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(logstoragenode['type'])(**logstoragenode)
    def __init__(self, namespace='default', screendataaccessdata='screen-data-access-pv-data',
                 harbor=None, retrytimes=60, *args, **kwargs):

        namespace = namespace.strip()
        kwargs['namespace'] = namespace
        kwargs['harbor'] = harbor
        self.kwargs = kwargs

        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']



        self.AppInfo['ScreenDataAccessDataPath'] = os.path.join(self.AppInfo['DataStorageBasePath'], '-'.join([namespace, screendataaccessdata]))
        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(logstoragenode['type'])(**logstoragenode)

        self.DependencyDict ={}
        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath= os.path.realpath(os.path.join(TmpCWDPath, '../../..'))

        if  self.getValues():
            print ('load from file....')
            self.AppInfo = deepcopy(self.getValues())
    def __init__(self,
                 namespace='default',
                 nfsdatapath='nfs-provisioner',
                 harbor=None,
                 retrytimes=60):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        try:
            from storagenode import dynamicstoragenode as datastoragenode
        except Exception as e:
            pass

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        self.AppInfo['Namespace'] = namespace
        self.AppInfo['NFSDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, nfsdatapath]))

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)
Beispiel #4
0
    def __init__(self,
                 namespace='default',
                 ckmdatapath='ckm',
                 harbor=None,
                 retrytimes=10):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        self.AppInfo['CKMDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, ckmdatapath]))

        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)
Beispiel #5
0
    def __init__(self,
                 namespace='default',
                 mysqldatapath='nacos_mysql',
                 nacosdatapath='nfs-provisioner',
                 harbor=None,
                 retrytimes=60):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        #self.AppInfo['MysqlDataPath'] = os.path.join(self.AppInfo['DataStorageBasePath'], '-'.join([namespace, mysqldatapath]))

        ###  Mysql data path not changeable  ##
        self.AppInfo['MysqlDataPath'] = os.path.join(
            '/TRS/DATA', '-'.join([namespace, mysqldatapath]))
        self.AppInfo['NacosDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, nacosdatapath]))
        self.AppInfo['Namespace'] = namespace
        self.AppInfo['ProvisionerPath'] = nacosdatapath

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)

        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath = os.path.realpath(
            os.path.join(TmpCWDPath, '../../..'))

        if self.getValues():
            print('load from file....')
            self.AppInfo = deepcopy(self.getValues())
Beispiel #6
0
    def __init__(self,
                 namespace='default',
                 paperreviewlogdata='paperreview-pv-log',
                 harbor=None,
                 retrytimes=60,
                 *args,
                 **kwargs):

        namespace = namespace.strip()
        kwargs['namespace'] = namespace
        kwargs['harbor'] = harbor
        self.kwargs = kwargs

        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        self.AppInfo['PaperReviewLogPath'] = os.path.join(
            self.AppInfo['LogStorageBasePath'],
            '-'.join([namespace, paperreviewlogdata]))
        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)

        self.DependencyDict = {}
        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath = os.path.realpath(
            os.path.join(TmpCWDPath, '../../..'))
Beispiel #7
0
    def __init__(self, namespace='default', downimgdatapath='trswcm-pv-data/WCMData/webpic', downimglogdata='tmyimgcenter-pv-log' ,
                 harbor=None, retrytimes=60, *args, **kwargs):

        namespace = namespace.strip()
        kwargs['namespace'] = namespace
        kwargs['harbor'] = harbor
        self.kwargs = kwargs

        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']



        TmpdownimgdatapathList = downimgdatapath.split('/')
        self.AppInfo['DownImgDataPath'] = os.path.join(self.AppInfo['DataStorageBasePath'], '-'.join([namespace, TmpdownimgdatapathList[0]]), *(TmpdownimgdatapathList[1:]))
        self.AppInfo['DownImgLogPath'] = os.path.join(self.AppInfo['LogStorageBasePath'], '-'.join([namespace, downimglogdata]))
        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()


        self.DataStorageObj = getClsObj(datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(logstoragenode['type'])(**logstoragenode)


        self.DependencyDict ={}
        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath= os.path.realpath(os.path.join(TmpCWDPath, '../../..'))

        if  self.getValues():
            print ('load from file....')
            self.AppInfo = deepcopy(self.getValues())
Beispiel #8
0
    def __init__(self,
                 namespace='default',
                 redisdatapath='redis-pv-data',
                 harbor=None,
                 retrytimes=60):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        self.AppInfo['RedisDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, redisdatapath]))

        self.AppInfo['Namespace'] = namespace

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)

        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath = os.path.realpath(
            os.path.join(TmpCWDPath, '../../..'))

        if self.getValues():
            print('load from file....')
            self.AppInfo = deepcopy(self.getValues())
Beispiel #9
0
    def __init__(self,
                 namespace='default',
                 nginxdatapath='nginx-pv-web',
                 nginxlogpath='nginx-pv-log',
                 nginxconfigpath='nginx-pv-config',
                 nginxwcmdatapath='trswcm-pv-data/WCMData',
                 nginxwcmpublishdatapath='trswcm-pv-data/WCMPubData',
                 nginxmcndatapath='mcn-pv-data/MCNData',
                 harbor=None,
                 retrytimes=60,
                 *args,
                 **kwargs):

        namespace = namespace.strip()
        self.RetryTimes = int(retrytimes)
        self.AppInfo = deepcopy(AppInfo)

        self.AppInfo['DataStorageAddr'] = datastoragenode['hostname']
        self.AppInfo['DataStorageBasePath'] = datastoragenode['basepath']
        self.AppInfo['LogStorageAddr'] = logstoragenode['hostname']
        self.AppInfo['LogStorageBasePath'] = logstoragenode['basepath']

        self.AppInfo['NginxDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, nginxdatapath]))
        self.AppInfo['NginxLogDataPath'] = os.path.join(
            self.AppInfo['LogStorageBasePath'],
            '-'.join([namespace, nginxlogpath]))
        self.AppInfo['NginxConfigDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([namespace, nginxconfigpath]))

        self.AppInfo['Namespace'] = namespace

        #### 20210202 ###
        TmpList = nginxwcmdatapath.split('/')
        self.AppInfo['NginxWCMDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([self.AppInfo['Namespace'], TmpList[0]]), *TmpList[1:])

        TmpList = nginxwcmpublishdatapath.split('/')
        self.AppInfo['NginxWCMPublishDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([self.AppInfo['Namespace'], TmpList[0]]), *TmpList[1:])

        TmpList = nginxmcndatapath.split('/')
        self.AppInfo['NginxMCNDataPath'] = os.path.join(
            self.AppInfo['DataStorageBasePath'],
            '-'.join([self.AppInfo['Namespace'], TmpList[0]]), *TmpList[1:])

        #### END ####

        self.AppInfo['HarborAddr'] = harbor
        self.k8sObj = k8s_tools.K8SClient()

        self.DataStorageObj = getClsObj(
            datastoragenode['type'])(**datastoragenode)
        self.LogStorageObj = getClsObj(
            logstoragenode['type'])(**logstoragenode)

        TmpCWDPath = os.path.abspath(__file__)
        TmpCWDPath = os.path.dirname(TmpCWDPath)
        self.BaseDIRPath = os.path.realpath(
            os.path.join(TmpCWDPath, '../../..'))

        if self.getValues():
            print('load from file....')
            self.AppInfo = deepcopy(self.getValues())