-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Dockerize evals #2157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dockerize evals #2157
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
41cca8a
Dockerize evals
cte 4c78a0b
Update README
cte e13e68e
Add git config commands
cte 029f97f
Increase task time limit
cte b493535
More progress
cte aae03e9
Remove debuggin
cte 76e6e59
Log cli output to tempfile
cte 8470280
It's working
cte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
|
|
||
| # Build artifacts | ||
| bin/ | ||
| !bin/roo-code-latest.vsix | ||
| dist/ | ||
| **/dist/ | ||
| out/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,10 +147,20 @@ const run = async (toolbox: GluegunToolbox) => { | |
| await Promise.all(runningPromises) | ||
|
|
||
| const result = await finishRun(run.id) | ||
| console.log("[cli#run]", result) | ||
| try { | ||
| console.log("[cli#run]", result) | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| } catch (error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid empty catch blocks. Instead of commenting out the error log (lines 151-155), consider logging error details using a structured logging method so that errors aren’t silently ignored. |
||
| // console.error(error) | ||
| } | ||
|
|
||
| if (parentPid) { | ||
| console.log(await execa`kill -INT ${parentPid}`) | ||
| try { | ||
| console.log(await execa`kill -INT ${parentPid}`) | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| } catch (error) { | ||
| // console.error(error) | ||
| } | ||
| } | ||
|
|
||
| console.log(await execa({ cwd: exercisesPath })`git add .`) | ||
|
|
@@ -163,11 +173,24 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server | |
| const dirname = path.dirname(run.socketPath) | ||
| const taskSocketPath = path.resolve(dirname, `${dirname}/task-${task.id}.sock`) | ||
|
|
||
| await execa({ | ||
| env: { ROO_CODE_IPC_SOCKET_PATH: taskSocketPath }, | ||
| })`code -n ${path.resolve(exercisesPath, language, exercise)}` | ||
| let codeCommand = `code --wait --verbose --disable-workspace-trust` | ||
|
|
||
| const isDocker = fs.existsSync("/.dockerenv") | ||
|
|
||
| if (isDocker) { | ||
| codeCommand = `xvfb-run --auto-servernum --server-num=1 ${codeCommand} --disable-gpu --password-store="basic"` | ||
| } | ||
|
|
||
| const subprocess = execa({ | ||
| env: { | ||
| ROO_CODE_IPC_SOCKET_PATH: taskSocketPath, | ||
| }, | ||
| shell: "/bin/bash", | ||
| })`${codeCommand} -n ${path.resolve(exercisesPath, language, exercise)}` | ||
|
|
||
| subprocess.stdout.pipe(process.stdout) | ||
|
|
||
| console.log(`Connecting to ${taskSocketPath}`) | ||
| console.log(`Connecting to ${taskSocketPath} (pid: ${subprocess.pid})`) | ||
|
|
||
| const createClient = (taskSocketPath: string) => { | ||
| const ipcClient = new IpcClient(taskSocketPath) | ||
|
|
@@ -208,10 +231,10 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server | |
| isTaskFinished = true | ||
| }) | ||
|
|
||
| const ignoreEvents = [ | ||
| RooCodeEventName.Message, | ||
| RooCodeEventName.TaskTokenUsageUpdated, | ||
| RooCodeEventName.TaskAskResponded, | ||
| const ignoreEvents: RooCodeEventName[] = [ | ||
| // RooCodeEventName.Message, | ||
| // RooCodeEventName.TaskTokenUsageUpdated, | ||
| // RooCodeEventName.TaskAskResponded, | ||
| ] | ||
|
|
||
| let taskStartedAt = Date.now() | ||
|
|
@@ -230,6 +253,7 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server | |
|
|
||
| if (!ignoreEvents.includes(eventName)) { | ||
| console.log(`[cli#runExercise | ${language} / ${exercise}] taskEvent -> ${eventName}`) | ||
| console.log(payload) | ||
| } | ||
|
|
||
| if (eventName === RooCodeEventName.TaskStarted) { | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider changing 'Navigation to localhost:3000 in your browser.' to 'Navigate to localhost:3000 in your browser.' for a clearer call to action.