Skip to content

Commit

Permalink
Merge Pull Request #7550 from trilinos/Trilinos/master_merge_20200618…
Browse files Browse the repository at this point in the history
…_000629

Automatically Merged using Trilinos Master Merge AutoTester
PR Title: Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20200618_000629 branch to master
PR Author: trilinos-autotester
  • Loading branch information
trilinos-autotester authored Jun 18, 2020
2 parents c63487d + abeb459 commit 6e5c6c9
Show file tree
Hide file tree
Showing 19 changed files with 887 additions and 471 deletions.
4 changes: 2 additions & 2 deletions cmake/std/PullRequestLinuxCudaDriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fi
set -x

#TODO: review appropriate job size
bsub -x -Is -q rhel7F -n 16 -J $JOB_NAME -W $BSUB_CTEST_TIME_LIMIT \
$WORKSPACE/Trilinos/cmake/std/PullRequestLinuxDriver.sh
bsub -x -Is -q rhel7F -n 16 -J ${JOB_NAME} -W ${BSUB_CTEST_TIME_LIMIT} \
${WORKSPACE}/Trilinos/cmake/std/PullRequestLinuxDriver.sh

# NOTE: Above, this bsub command should grab a single rhel7F (Firestone,
# Dual-Socket POWER8, 8 cores per socket, K80 GPUs) node. The option '-x'
Expand Down
87 changes: 36 additions & 51 deletions cmake/std/PullRequestLinuxDriverMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,40 @@
import sys
sys.dont_write_bytecode = True

import os
import argparse
import os
import subprocess
from textwrap import dedent



def write_header():
print('''--------------------------------------------------------------------------------
-
- Begin: PullRequestLinuxDriver-Merge.py
-
--------------------------------------------------------------------------------''',
file=sys.stdout)
print(dedent('''\
--------------------------------------------------------------------------------
-
- Begin: PullRequestLinuxDriver-Merge.py
-
--------------------------------------------------------------------------------'''))


def echoJenkinsVars(workspace):
print('''
================================================================================
Jenkins Environment Variables:
- WORKSPACE : {workspace}
print(dedent('''\
================================================================================
Jenkins Environment Variables:
- WORKSPACE : {workspace}
================================================================================
Environment:
================================================================================
Environment:
pwd = {cwd}
'''.format(workspace=workspace,
cwd=os.getcwd()), file=sys.stdout)
pwd = {cwd}
''').format(workspace=workspace, cwd=os.getcwd()))

for key in os.environ:
print(key +' = ' + os.environ[key])
print('''
================================================================================''',
file=sys.stdout)

print('\n' + 80*"=")



def parseArgs():
Expand Down Expand Up @@ -93,43 +94,33 @@ def merge_branch(source_url, source_branch, target_branch, sourceSHA):
if 'source_remote' in remote_list:
print('git remote exists, removing it', file=sys.stdout)
subprocess.check_call(['git', 'remote', 'rm', 'source_remote'])
subprocess.check_call(['git', 'remote', 'add', 'source_remote',
source_url])
subprocess.check_call(['git', 'remote', 'add', 'source_remote', source_url])

fetch_succeeded = False
for i in range(3):
try:
subprocess.check_call(['git', 'fetch', 'source_remote',
source_branch])
subprocess.check_call(['git', 'fetch', 'source_remote', source_branch])
fetch_succeeded = True
break
except subprocess.CalledProcessError:
pass
if not fetch_succeeded:
raise SystemExit(12)

subprocess.check_call(['git', 'fetch', 'origin',
target_branch])
subprocess.check_call(['git', 'reset', '--hard',
'HEAD'])
subprocess.check_call(['git', 'checkout', '-B',
target_branch, 'origin/' + target_branch])
subprocess.check_call(['git', 'merge', '--no-edit',
'source_remote/' + source_branch]),
subprocess.check_call(['git', 'fetch', 'origin', target_branch])
subprocess.check_call(['git', 'reset', '--hard', 'HEAD'])
subprocess.check_call(['git', 'checkout', '-B', target_branch, 'origin/' + target_branch])
subprocess.check_call(['git', 'merge', '--no-edit', 'source_remote/' + source_branch]),

actual_source_SHA = subprocess.check_output(['git', 'rev-parse',
'source_remote/' + source_branch])
actual_source_SHA = subprocess.check_output(['git', 'rev-parse', 'source_remote/' + source_branch])

actual_source_SHA = actual_source_SHA.strip()

if actual_source_SHA != sourceSHA:
print('The SHA ({source_sha}) for the last commit on branch {source_branch}'.format(source_sha=actual_source_SHA,
source_branch=source_branch),
file=sys.stdout)
print(' in repo {source_repo} is different than the expected SHA,'.format(source_repo=source_url),
file=sys.stdout)
print(' which is: {source_sha}.'.format(source_sha=sourceSHA),
file=sys.stdout)
source_branch=source_branch), file=sys.stdout)
print(' in repo {source_repo} is different than the expected SHA,'.format(source_repo=source_url), file=sys.stdout)
print(' which is: {source_sha}.'.format(source_sha=sourceSHA), file=sys.stdout)
raise SystemExit(-1)


Expand All @@ -143,8 +134,7 @@ def run():
os.chdir(os.path.join(arguments.workspaceDir, 'Trilinos'))
print("Set CWD = {dirName}".format(dirName=os.path.join(
arguments.workspaceDir,
'Trilinos')),
file=sys.stdout)
'Trilinos')))
write_header()
echoJenkinsVars(arguments.workspaceDir)
try:
Expand All @@ -156,20 +146,15 @@ def run():
return_value = False
except subprocess.CalledProcessError as cpe:
return_value = False
print('Recieved subprocess.CalledProcessError - returned {error_num}'.format(error_num=cpe.returncode),
file=sys.stdout)
print(' from command {cmd}'.format(cmd=cpe.cmd),
file=sys.stdout)
print(' output {out}'.format(out=cpe.output),
file=sys.stdout)
print('Recieved subprocess.CalledProcessError - returned {error_num}'.format(error_num=cpe.returncode), file=sys.stdout)
print(' from command {cmd}'.format(cmd=cpe.cmd), file=sys.stdout)
print(' output {out}'.format(out=cpe.output), file=sys.stdout)
try:
print(' stdout {out}'.format(out=cpe.stdout),
file=sys.stdout)
print(' stdout {out}'.format(out=cpe.stdout), file=sys.stdout)
except AttributeError:
pass
try:
print(' stderr {eout}'.format(eout=cpe.stderr),
file=sys.stdout)
print(' stderr {eout}'.format(eout=cpe.stderr), file=sys.stdout)
except AttributeError:
pass

Expand Down
Loading

0 comments on commit 6e5c6c9

Please sign in to comment.