@@ -41,14 +41,22 @@ async def verify_github_run(
4141 github_cog : GitHubCog ,
4242 choice : app_commands .Choice ,
4343 interaction : discord .Interaction ,
44+ lang : str ,
4445 ) -> bool :
4546 github_command = github_cog .run_github
46- cuda_file = create_mock_attachment (
47- "test.cu" , Path ("examples/identity_cuda/submission.cuh" ).read_text ()
48- )
49- reference_code = Path ("examples/identity_cuda/reference.cuh" ).read_text ()
47+ if lang == "py" :
48+ sub_code = create_mock_attachment (
49+ "submission.py" , Path ("examples/identity_py/submission.py" ).read_text ()
50+ )
51+ ref_code = Path ("examples/identity_py/reference.py" ).read_text ()
52+ else :
53+ sub_code = create_mock_attachment (
54+ "test.cu" , Path ("examples/identity_cuda/submission.cuh" ).read_text ()
55+ )
56+ ref_code = Path ("examples/identity_cuda/reference.cuh" ).read_text ()
57+
5058 github_thread = await github_command .callback (
51- github_cog , interaction , cuda_file , choice , reference_code = reference_code
59+ github_cog , interaction , sub_code , choice , reference_code = ref_code
5260 )
5361
5462 message_contents = [msg .content async for msg in github_thread .history (limit = None )]
@@ -57,7 +65,7 @@ async def verify_github_run(
5765 "Processing `.*` with" ,
5866 "GitHub Action triggered! Run ID:" ,
5967 "Training completed with status: success" ,
60- ".*``` \n Logs.*: " ,
68+ "'check': 'pass' " ,
6169 "View the full run at:" ,
6270 ]
6371
@@ -69,7 +77,7 @@ async def verify_github_run(
6977 if all_patterns_found :
7078 await send_discord_message (
7179 interaction ,
72- f"✅ GitHub run ({ choice .name } ) completed successfully - "
80+ f"✅ GitHub run ({ choice .name } ) for { lang } completed successfully - "
7381 "all expected messages found!" ,
7482 )
7583 return True
@@ -81,26 +89,35 @@ async def verify_github_run(
8189 ]
8290 await send_discord_message (
8391 interaction ,
84- f"❌ GitHub run ({ choice .name } ) verification failed. Missing expected messages:\n "
92+ f"❌ GitHub run ({ choice .name } ) for { lang } verification failed. Missing expected messages:\n "
8593 + "\n " .join (f"- { pattern } " for pattern in missing_patterns ),
8694 )
8795 return False
8896
89- async def verify_modal_run (self , modal_cog : ModalCog , interaction : discord .Interaction ) -> bool :
97+ async def verify_modal_run (
98+ self , modal_cog : ModalCog , interaction : discord .Interaction , lang : str
99+ ) -> bool :
90100 t4 = app_commands .Choice (name = "T4" , value = "t4" )
91101 modal_command = modal_cog .run_modal
92102
93- sub_code = create_mock_attachment (
94- "submission.py" , Path ("examples/identity_py/submission.py" ).read_text ()
95- )
96- ref_code = Path ("examples/identity_py/reference.py" ).read_text ()
103+ if lang == "py" :
104+ sub_code = create_mock_attachment (
105+ "submission.py" , Path ("examples/identity_py/submission.py" ).read_text ()
106+ )
107+ ref_code = Path ("examples/identity_py/reference.py" ).read_text ()
108+ else :
109+ sub_code = create_mock_attachment (
110+ "test.cu" , Path ("examples/identity_cuda/submission.cuh" ).read_text ()
111+ )
112+ ref_code = Path ("examples/identity_cuda/reference.cuh" ).read_text ()
113+
97114 modal_thread = await modal_command .callback (
98115 modal_cog , interaction , sub_code , t4 , reference_code = ref_code
99116 )
100117
101118 message_contents = [msg .content async for msg in modal_thread .history (limit = None )]
102119
103- required_patterns = ["Running on Modal..." , "Job completed !" ]
120+ required_patterns = ["Running on Modal..." , "Success !" ]
104121
105122 all_patterns_found = all (
106123 any (re .search (pattern , content , re .DOTALL ) is not None for content in message_contents )
@@ -110,7 +127,7 @@ async def verify_modal_run(self, modal_cog: ModalCog, interaction: discord.Inter
110127 if all_patterns_found :
111128 await send_discord_message (
112129 interaction ,
113- "✅ Modal run completed successfully - all expected messages found!" ,
130+ f "✅ Modal run for { lang } completed successfully - all expected messages found!" ,
114131 )
115132 return True
116133 else :
@@ -121,7 +138,7 @@ async def verify_modal_run(self, modal_cog: ModalCog, interaction: discord.Inter
121138 ]
122139 await send_discord_message (
123140 interaction ,
124- "❌ Modal run verification failed. Missing expected messages:\n "
141+ f "❌ Modal run verification for { lang } failed. Missing expected messages:\n "
125142 + "\n " .join (f"- { pattern } " for pattern in missing_patterns ),
126143 )
127144 return False
@@ -145,9 +162,11 @@ async def verify_runs(self, interaction: discord.Interaction):
145162 amd = app_commands .Choice (name = "AMD" , value = "amd" )
146163
147164 results = await asyncio .gather (
148- self .verify_github_run (github_cog , nvidia , interaction ),
149- self .verify_github_run (github_cog , amd , interaction ),
150- self .verify_modal_run (modal_cog , interaction ),
165+ self .verify_github_run (github_cog , nvidia , interaction , "py" ),
166+ self .verify_github_run (github_cog , nvidia , interaction , "cu" ),
167+ self .verify_modal_run (modal_cog , interaction , "py" ),
168+ self .verify_github_run (github_cog , amd , interaction , "py" ),
169+ self .verify_modal_run (modal_cog , interaction , "cu" ),
151170 )
152171
153172 if all (results ):
0 commit comments