def updatePsanaCondaRecipe(self): recipeDir = util.psanaCondaRecipeDir(self.basedir, self.manageSubDir) renderedMetaFile = os.path.join(self.logDir, 'psana-conda-rendered.yaml.txt') cmd = 'conda-render -f %s %s' % (renderedMetaFile, recipeDir) if os.path.exists(os.path.join(self.logDir, 'recipe.success')): master = file(self.logFname, 'a') master.write("<h2>psana conda recipe</h2>\n") master.write( "** SUCCESS ** <a href=psana-conda-rendered.yaml.txt>psana-conda-rendered.yaml.txt</a><br>cmd= %s<br>\n" % cmd) master.close() return print( "--AUTO: calling %s\nSo that the psana-conda recipe can be examined to check that the package version matches %s" % (cmd, self.version_str)) sys.stdout.flush() sys.stderr.flush() assert 0 == os.system(cmd) meta = yaml.load(file(renderedMetaFile, 'r')) assert meta['package'][ 'name'] == 'psana-conda', "rendered meta.yaml for psana-conda package name is wrong" if meta['package']['version'] != self.version_str: print( "--- AUTO: ERROR: You must update the meta.yaml to use version=%s in directory\n %s. Currently it is %s" % (self.version_str, recipeDir, meta['package']['version'])) sys.exit(0) f = file(os.path.join(self.logDir, 'recipe.success'), 'w') f.close() print("--- AUTO: psana-conda recipe has correct version.") sys.stdout.flush()
def build_psana(self, name): cmd = 'ana-rel-admin --cmd bld-pkg' if self.dev: cmd += ' --force --recipe %s/manage/recipes/external/szip' % self.basedir else: cmd += ' --recipe %s' % util.psanaCondaRecipeDir(self.basedir, self.manageSubDir) cmd = self.add_opts(cmd) # we want to capture all conda build output to our own file cmd += ' --nolog' self.execute_multihost_step(name=name, devel=True, env='manage', tester=False, cmd_or_cmddict=cmd, html=False)
def notify(self, hdr, msg, step=None): msg = msg.format(version=self.version_str, relName=self.relName, swVer=self.swGroup, master_log_file=self.logFname, psanaCondaRecipeDir=util.psanaCondaRecipeDir(self.basedir, self.manageSubDir), step=step) msg=MIMEText(msg) msg['Subject'] = 'ana-rel-admin AUTO %s *%s*' % (self.relName, hdr) msg['From'] = '*****@*****.**' % os.environ.get('USERNAME','unknown') msg['To'] = self.email # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP('localhost') s.sendmail(msg['From'], [msg['To']], msg.as_string()) s.quit()