Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/mcp/mcp_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if __name__ == '__main__':

parser = argparse.ArgumentParser()
parser.add_argument('--name', type=str, default='mcp-pytest', help='Name of run')
parser.add_argument('--name', type=str, default='mcp-pytest', help='Base name of run')
parser.add_argument('--cluster', type=str, default='r1z4', help='Cluster to use')
parser.add_argument('--gpu_type', type=str, default='a100_40gb', help='Type of GPU to use')
parser.add_argument('--gpu_num', type=int, default=2, help='Number of the GPU to use')
Expand All @@ -26,20 +26,24 @@
parser.add_argument('--timeout', type=int, default=1800, help='Timeout for run (in seconds)')
args = parser.parse_args()

name = args.name
git_integration = {
'integration_type': 'git_repo',
'git_repo': 'mosaicml/composer',
'ssh_clone': 'False',
}
if args.git_branch is not None and args.git_commit is None:
name += f'-branch-{args.git_branch}'
git_integration['git_branch'] = args.git_branch
if args.git_commit is not None:
name += f'-commit-{args.git_commit}'
git_integration['git_commit'] = args.git_commit

command = 'cd composer'

# Checkout a specific PR if specified
if args.pr_number is not None:
name += f'-pr-{args.pr_number}'
command += f'''

git fetch origin pull/{args.pr_number}/head:pr_branch
Expand All @@ -48,6 +52,10 @@

'''

# Shorten name if too long
if len(name) > 56:
name = name[:56]

command += f'''

pip install --upgrade --user .[all]
Expand All @@ -64,7 +72,7 @@
'''

config = RunConfig(
name=args.name,
name=name,
cluster=args.cluster,
gpu_type=args.gpu_type,
gpu_num=args.gpu_num,
Expand Down