def get_Url(self): readconfig = ReadConfig() scheme= readconfig.get_http('scheme') url = readconfig.get_http('baseurl') port = readconfig.get_http('port') new_url = scheme+'://' + url + ':'+ port # logger.info('new_url'+new_url) return new_url
#coding=utf-8 import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from utils.readConfig import ReadConfig from utils.auth_ipipe import Get_ipipe_auth from utils.db import Database from utils import bosclient import os import time import datetime import logging from tornado.httpclient import AsyncHTTPClient requests.packages.urllib3.disable_warnings(InsecureRequestWarning) localConfig = ReadConfig() logging.basicConfig( level=logging.INFO, filename='./logs/event.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) def ifDocumentFix(message): document_fix = True if 'test=document_fix' in message else False return document_fix def ifAlreadyExist(query_stat): db = Database() result = list(db.query(query_stat))
import time import requests import json import sys sys.path.append("..") from utils.readConfig import ReadConfig from utils.test_auth_ipipe import xlyOpenApiRequest from utils.handler_xly import jobHandler localConfig = ReadConfig('../conf/config.ini') class getQueueUpCIList(jobHandler): """The final displayed list of queuedCI""" def __init__(self): self.container_cardType = ['v100', 'p4'] self.sa_cardType = [ 'win', 'mac', 'cpu', 'benchmark', 'cinn', 'approval' ] # 'kunlun', 'cinn self.container_ci = [ 'PR-CI-Coverage', 'PR-CI-Py3', 'PR-CI-CPU-Py2', 'PR-CI-Inference', 'xly-PR-CI-PY35', 'xly-PR-CI-PY27', 'FluidDoc1', 'build-paddle', 'xly-PR-CI-PY2', 'xly-PR-CI-PY3', 'PR-CI-CUDA9-CUDNN7', 'PaddleServing文档测试' ] self.sa_ci = [ 'PR-CI-Windows', 'PR-CI-Windows-OPENBLAS', 'PR-CI-Mac', 'PR-CI-Mac-Python3', 'PR-CI-APPROVAL', 'PR-CI-OP-Benchmark', 'cinn-ci' ]
from gidgethub import aiohttp as gh_aiohttp import sys import pandas as pd sys.path.append("..") from utils.auth import get_jwt, get_installation, get_installation_access_token from utils.test_auth_ipipe import xlyOpenApiRequest from utils.readConfig import ReadConfig logging.basicConfig( level=logging.INFO, filename='../logs/regularMark.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) localConfig = ReadConfig(path='../conf/config.ini') class MarkTimeoutCI(object): def __init__(self, user, repo, gh): self.pr_url = 'https://api.github.com/repos/%s/%s/pulls?per_page=100&page=1&q=addClass' % ( user, repo) self.gh = gh self.user = user self.repo = repo self.mark_url = 'https://xly.bce.baidu.com/open-api/ipipe/rest/v1/job-builds/{}/mark' self.rerun_url = 'http://www.cipaddlepaddle.cn:8081/%s/%s/{}/{}' % ( user, repo) self.comment_url = 'https://api.github.com/repos/%s/%s/issues/{}/comments' % ( user, repo)
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor from apscheduler.events import EVENT_JOB_EXECUTED, EVENT_JOB_ERROR from utils.readConfig import ReadConfig import logging from regularClose_auth import regularClose_job import sys sys.path.append("..") from gitee.GithubToGitee import Main from gitee.pr_merge import gitee_merge_pr from gitee.pr_migration import githubPrMigrateGitee import time localConfig = ReadConfig(path='conf/job.conf') logging.basicConfig( level=logging.INFO, format= '%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='logs/weekly_sched.log', filemode='a') def job_listener(event): """set a job listener""" logging.info('listenning on...%s' % str(event)) if event.exception: print(event.exception) logging.info('exception happend') else: