From patchwork Thu Apr 28 13:53:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 7303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DABB4C4332F for ; Thu, 28 Apr 2022 13:54:07 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.10587.1651154042090443224 for ; Thu, 28 Apr 2022 06:54:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20210112.gappssmtp.com header.s=20210112 header.b=WCcfecmP; spf=softfail (domain: sakoman.com, ip: 209.85.210.173, mailfrom: steve@sakoman.com) Received: by mail-pf1-f173.google.com with SMTP id y14so4299044pfe.10 for ; Thu, 28 Apr 2022 06:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=V6SNOsoAyBdPVMzbq25pk1NVWNd24iqcbCFdm2IwmhU=; b=WCcfecmP+q7HGchbZwGQsV90FNycDadxDvKB5wuWGKz4Vq6EleJt9w6L/2J3SUBrN2 oi15MXH8LUi7DV9l6mrFncqk6smjbit0mNWn77OzHFE/ZkOIPCTEe3zGQdt/GE2NY4ML Ip2e767Xuex3oLvGnHoNUJ1kG5fGRRgOoGztUl1SuP1hUXoSNz4cHMvdHy7MDsHWHUuP qEBj3awdQ1Gw5WSu1MdyN2fELRZoEZj0N1KD6iIPCLe/1MaRwN/iuJ8nBNjEBFyYHEwD evQshAdHAJY3uogMw5NiIuMVpZ+0hjn9AcgVHAK+oh8fqCIzrCmiH6X53u0DYbjBohLA WtGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V6SNOsoAyBdPVMzbq25pk1NVWNd24iqcbCFdm2IwmhU=; b=Jc8qC9eawC9tvFnZuZ24ra10SPcOK7mUNhtdv1/YqQeH8RXa+A8bYHTJond+v7LVCl ox0Rl9pbJ6EtBcOqNATDnheFQ5ISKYGi3TKpwtlCPHp3q6njRVoWdj95m8Cw2LIWv1PR v889cMHB9lea8k40liN9GY1QRlloIowcYrhi08Bj7hx0yTf26sjnBnx9b9k5S+Lda4I4 qQxPiOAkU3NzvOCdTpoPF2qXMNomVZ0xcmuoI+rbbEQfbRDgFOqK1S3OgxHAMZ0AXNAS 3osA9F0vHrlzFk6XvEmD1xzNVPvSxG1vuG02jdsu8Nu8qFaT6kqp5Ow8scuN4r2YXqAc 5rBg== X-Gm-Message-State: AOAM532suP9/uc72+66aFul112fKc+d2gR7is8sSflC0/7iyMzmoO+19 GR29V8Y75wCBV8dLtvAfFIkJNctFKE0zJhxV0As= X-Google-Smtp-Source: ABdhPJxiIWdbw00wVwlODZZWQNl14hqeaQYUA0TjRKDZnnRdJG7Drki9Pjq6FdGHDUlNUPDHzLGxCQ== X-Received: by 2002:a62:6411:0:b0:50a:81df:bfa6 with SMTP id y17-20020a626411000000b0050a81dfbfa6mr35267034pfb.26.1651154040923; Thu, 28 Apr 2022 06:54:00 -0700 (PDT) Received: from hexa.router0800d9.com (dhcp-72-253-6-214.hawaiiantel.net. [72.253.6.214]) by smtp.gmail.com with ESMTPSA id m1-20020a17090ade0100b001cb3feaddfcsm5256615pjv.2.2022.04.28.06.53.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 06:54:00 -0700 (PDT) From: Steve Sakoman To: yocto@lists.yoctoproject.org Subject: [yocto-autobuilder-helper][dunfell 1/2] scripts/build-perf-test-wrapper: Update to only send text based emails Date: Thu, 28 Apr 2022 03:53:19 -1000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 28 Apr 2022 13:54:07 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/56941 From: Richard Purdie Signed-off-by: Richard Purdie (cherry picked from commit c77f588773924fd724b3c42daace24d6cce50d52) Signed-off-by: Steve Sakoman --- scripts/build-perf-test-wrapper | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/scripts/build-perf-test-wrapper b/scripts/build-perf-test-wrapper index 660ef82..53a47ea 100755 --- a/scripts/build-perf-test-wrapper +++ b/scripts/build-perf-test-wrapper @@ -68,18 +68,6 @@ if args.results_dir: git_repo = args.results_dir + "/archive-repo" global_results = args.results_dir -if args.email_addr: - try: - subprocess.check_output(["which", "phantomjs"]) - except subprocess.CalledProcessError: - print("Please install phantomjs to email reports") - sys.exit(1) - try: - subprocess.check_output(["which", "optipng"]) - except subprocess.CalledProcessError: - print("Please install optipng to email reports") - sys.exit(1) - op = fcntl.LOCK_EX try: lf = open("/tmp/oe-build-perf-test-wrapper.lock", 'a+') @@ -218,7 +206,7 @@ if git_repo: os_name = subprocess.check_output(". /etc/os-release; eval echo '$'PRETTY_NAME", shell=True).decode("utf-8").strip() cmd = scriptsdir + "/oe-build-perf-report-email.py --to '" + args.email_addr + \ "' --subject 'Build Perf Test Report for " + os_name + "' --text " + \ - report_txt + " --html " + report_html + report_txt try: subprocess.check_call(cmd, shell=True) except subprocess.CalledProcessError: From patchwork Thu Apr 28 13:53:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 7304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA0E6C433F5 for ; Thu, 28 Apr 2022 13:54:07 +0000 (UTC) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web09.10635.1651154045947602267 for ; Thu, 28 Apr 2022 06:54:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20210112.gappssmtp.com header.s=20210112 header.b=CRXyzWIL; spf=softfail (domain: sakoman.com, ip: 209.85.215.170, mailfrom: steve@sakoman.com) Received: by mail-pg1-f170.google.com with SMTP id r83so4052555pgr.2 for ; Thu, 28 Apr 2022 06:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yJMemLSMsaJMrh5xsPp/cCjJLZiFP3hNLUTbmlZlQ80=; b=CRXyzWIL8dHSeadKirAoxT2KuQ2qdAjOfghD9V9oqyM5VyB00IaJAQKty5+2LwKoyN flRyaQVnuHWQQ7IU6/nk2ohKi11pz3OGCGrqsjqrb4ZcnlcGSIbdMKW3s/+GIYY3Jmd2 qdGAEfUaXtAO/92JL9za+CCWWkm1apy/NTiPcZi+0+yix4iYXXink1Hmq4R1/MfzbYbg 99WyOiOHAploqQDoA3wuZb4orvw5mEhReZhMBpnLGD2TkGg8kTMUS4OV6uDrGEYYfQyb nEAuqDDNa9Cmbjx1gQ4pyEeEEvGtAsx9M6jHVW9biqsz7W66nzGuspzsjdzmba36duWw rdmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yJMemLSMsaJMrh5xsPp/cCjJLZiFP3hNLUTbmlZlQ80=; b=J5k5lrpkDND20Ts1iprEV3oBWN5GZlCPMiDC9IKUN3lJp3E0JzgBSF/n6mBW003pOL VTqof4D0nFIeZl1XxsAHeFfTZ59v5r+lpZhVt1w3wx3NvWA09ChB37lz1t3HNvCitN5d dMWI7NhhsJ6xbCTqg202m6fgeKgDhgbNTQ9gTRsE/hA1dWNuF8mk1DpzcYTCTjWK5jH+ Vc+E/lc9CN4b7cQsHtYCpCELgpopa+Wgz2vDbC5bCJD2m11/HVcxXURxZyVG7SCTYa6i IBeMMGAu2qm0WjfwoRBiT427ygS6gk7jNNrczBGt077g0bCtJ1l8ihih6wyAGhzNk2x4 DlFg== X-Gm-Message-State: AOAM530tUZXZzatJeEj9ZWtisDNnZhDDgPhHXCFzWO+1M5s/I/Ud3hXb LnkdfK/TSWaQUzca2mEwCXXg/jqHkJUsDwtxWKk= X-Google-Smtp-Source: ABdhPJyocpZJWOvkE9Z4/kuKlHHcKMsTbECftbGdZipQA2BQqE64+UISIfu2IELE6FOxQXhaWF9qmA== X-Received: by 2002:a63:6b87:0:b0:3aa:e0eb:d157 with SMTP id g129-20020a636b87000000b003aae0ebd157mr23982449pgc.23.1651154044670; Thu, 28 Apr 2022 06:54:04 -0700 (PDT) Received: from hexa.router0800d9.com (dhcp-72-253-6-214.hawaiiantel.net. [72.253.6.214]) by smtp.gmail.com with ESMTPSA id m1-20020a17090ade0100b001cb3feaddfcsm5256615pjv.2.2022.04.28.06.54.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 06:54:03 -0700 (PDT) From: Steve Sakoman To: yocto@lists.yoctoproject.org Subject: [yocto-autobuilder-helper][dunfell 2/2] oe-build-perf-report-email: Drop phantomjs email generation support Date: Thu, 28 Apr 2022 03:53:20 -1000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 28 Apr 2022 13:54:07 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/56942 From: Richard Purdie This approach didn't work reliably so switch to text based emails pointing at the website version with graphs and data. Signed-off-by: Richard Purdie (cherry picked from commit c0a7cac39acba54e106fa74143c5de7c5eeefab8) Signed-off-by: Steve Sakoman --- scripts/oe-build-perf-report-email.py | 158 +------------------------- 1 file changed, 6 insertions(+), 152 deletions(-) diff --git a/scripts/oe-build-perf-report-email.py b/scripts/oe-build-perf-report-email.py index f4476f5..6d16892 100755 --- a/scripts/oe-build-perf-report-email.py +++ b/scripts/oe-build-perf-report-email.py @@ -25,8 +25,6 @@ import socket import subprocess import sys import tempfile -from email.mime.image import MIMEImage -from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText @@ -42,22 +40,6 @@ if not os.path.isfile(SCRAPE_JS): sys.exit(1) -class ReportError(Exception): - """Local errors""" - pass - - -def check_utils(): - """Check that all needed utils are installed in the system""" - missing = [] - for cmd in ('phantomjs', 'optipng'): - if not shutil.which(cmd): - missing.append(cmd) - if missing: - log.error("The following tools are missing: %s", ' '.join(missing)) - sys.exit(1) - - def parse_args(argv): """Parse command line arguments""" description = """Email build perf test report""" @@ -82,137 +64,20 @@ def parse_args(argv): "the email parts") parser.add_argument('--text', help="Plain text message") - parser.add_argument('--html', - help="HTML peport generated by oe-build-perf-report") parser.add_argument('--phantomjs-args', action='append', help="Extra command line arguments passed to PhantomJS") args = parser.parse_args(argv) - if not args.html and not args.text: - parser.error("Please specify --html and/or --text") + if not args.text: + parser.error("Please specify --text") return args -def decode_png(infile, outfile): - """Parse/decode/optimize png data from a html element""" - with open(infile) as f: - raw_data = f.read() - - # Grab raw base64 data - b64_data = re.sub('^.*href="data:image/png;base64,', '', raw_data, 1) - b64_data = re.sub('">.+$', '', b64_data, 1) - - # Replace file with proper decoded png - with open(outfile, 'wb') as f: - f.write(base64.b64decode(b64_data)) - - subprocess.check_output(['optipng', outfile], stderr=subprocess.STDOUT) - - -def mangle_html_report(infile, outfile, pngs): - """Mangle html file into a email compatible format""" - paste = True - png_dir = os.path.dirname(outfile) - with open(infile) as f_in: - with open(outfile, 'w') as f_out: - for line in f_in.readlines(): - stripped = line.strip() - # Strip out scripts - if stripped == '': - paste = False - elif stripped == '': - paste = True - elif paste: - if re.match('^.+href="data:image/png;base64', stripped): - # Strip out encoded pngs (as they're huge in size) - continue - elif 'www.gstatic.com' in stripped: - # HACK: drop references to external static pages - continue - - # Replace charts with elements - match = re.match('