-
Notifications
You must be signed in to change notification settings - Fork 0
Remove conda from development setup and fix 7zr.exe path resolution #174
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
base: dev
Are you sure you want to change the base?
Conversation
Remove conda-based setup instructions and replace with simplified uv-based workflow. The fetch-build-resources script now handles downloading uv.exe to the correct location (build/resources/) where it's expected during development. Co-authored-by: tnglemongrass <[email protected]>
| ``` | ||
|
|
||
| You should now have a basic Python environment located at `build-envs\online\prototype-python-env`. | ||
| This will download `uv` (Python package manager) and other required tools to the `build/resources/` directory. |
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.
@copilot
This is correct, but you still missed an important point. If set up like this, the following doesn't work as expected:
- I open the App,
- click "Install" on the "Ai Playground Setup" page in the "Ai Playground" row, and
- Status: Failed
And in the dev tools I can see:
[ai-backend] Set up of service failed due to Error: Unzip error: Error: Command failed:
and
ai-playground\7zr.exe"' is not recognized as an internal or external command, operable program or batch file.
I am sure it looks for 7zr in the wrong path. That is what was meant by that "adjust path" comment in the original ticket.
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.
Fixed in commit 24514e1. The GitService was looking for 7zr.exe in the repo root, but fetch-build-resources downloads it to build/resources/7zr.exe. I've added a buildResources() helper function (same pattern as in uv.ts) to correctly resolve the path to build/resources/7zr.exe in development mode and to the packaged resources path in production.
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.
Iirc there is some entry in the .gitignore, which should no longer be needed now.
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.
Fixed in commit a400b82. Removed the obsolete 7zr.exe entry from .gitignore since the file is now at build/resources/7zr.exe, which is already covered by the /build/ entry on line 7.
The GitService was looking for 7zr.exe in the repo root, but fetch-build-resources downloads it to build/resources/7zr.exe. Applied the same pattern as uv.ts to resolve paths correctly in both development and packaged modes. Fixes: GitService now uses buildResources() helper to locate 7zr.exe at build/resources/7zr.exe during development and at the correct resources path when packaged. Co-authored-by: tnglemongrass <[email protected]>
| ``` | ||
|
|
||
| ### Prepare Python Environment | ||
| ### Prepare Development Environment |
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.
Did you check for other places where conda and the likes are mentioned?
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.
Fixed in commit 9ba814c. Removed conda references from AGENTS.md and WebUI/build/README.md. All documentation now reflects the simplified uv-based workflow.
| readonly sha256 = 'f5764d546ff9a2511b50ec4e20424c5f4669de1695abc3fa4128e7f7d4a7b2cd' | ||
| readonly zipPath = path.resolve(path.join(this.baseDir, 'portable-git.7z.exe')) | ||
| readonly unzipExePath = path.resolve(path.join(this.baseDir, '7zr.exe')) | ||
| readonly unzipExePath = path.resolve(path.join(buildResources(), '7zr.exe')) |
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.
Please name this this.buildResourcesDir similar to this.buildDir, and use either what was there before, or the other path (when in during dev setup).
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.
Fixed in commit 9ba814c. Refactored buildResources() to be an instance property this.buildResourcesDir in the GenericServiceImpl class, following the same pattern as this.baseDir. This provides better consistency and code organization.
- Updated AGENTS.md to remove conda setup instructions - Updated WebUI/build/README.md to remove miniforge/conda references - Refactored buildResources() function to be an instance property buildResourcesDir in GenericServiceImpl class (similar to baseDir) - GitService now uses this.buildResourcesDir instead of buildResources() This provides better consistency and follows the existing pattern where baseDir is an instance property. Co-authored-by: tnglemongrass <[email protected]>
| ``` | ||
|
|
||
| You should now have a basic Python environment located at `build-envs\online\prototype-python-env`. | ||
| This will download `uv` (Python package manager) and other required tools to the `build/resources/` directory. |
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.
Iirc there is some entry in the .gitignore, which should no longer be needed now.
|
|
||
| # Prepare Python environment | ||
| npm run fetch-build-resources -- --conda_env_dir=<path_to_conda_env> | ||
| npm run prepare-build |
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.
Since you removed prepare-build (good), did you check:
- What does it do?
- Is prepare-build used anywhere else?
- Is it still needed?
If not, it should be removed at least from the scripts section and probably other places as well.
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.
prepare-build is still needed and correctly used. It runs fetch-build-resources + prepare-python-env and is required for installer builds (documented in WebUI/build/README.md). The prepare-python-env script creates a Python environment that gets packaged with the installer. For development, only fetch-build-resources is needed (as documented in main README and AGENTS.md), which is why we removed it from those docs.
The 7zr.exe entry was for when the file was expected at repo root. Since we fixed path resolution to use build/resources/7zr.exe, this entry is no longer needed. The /build/ entry already covers build/resources/ directory. Co-authored-by: tnglemongrass <[email protected]>
Description:
The README and other documentation listed conda as a development prerequisite, but the codebase has migrated to
uvfor Python environment management. Additionally, there was a path resolution bug where7zr.exewas not being found during development setup, causing Git installation to fail with "7zr.exe is not recognized as an internal or external command" error. This PR also includes cleanup of obsolete.gitignoreentries.Changes Made:
npm run fetch-build-resourcescommand across all documentationbuild-envs\online\prototype-python-envpathuvand7zr.exedownload tobuild/resources/directoryGitServicewhere7zr.exewas expected at repo root instead ofbuild/resources/buildResourcesDirinstance property inGenericServiceImplclass (follows same pattern asbaseDir)GitServiceto usethis.buildResourcesDirfor consistent code organization7zr.exeentry from.gitignore(now covered by existing/build/entry)Development workflow now:
Path resolution fix:
Testing Done:
fetch-build-resourcesscript downloads bothuv.exeand7zr.exeto correct location (build/resources/)installBackend()which runsuv syncautomaticallyprepare-python-envis only required for installer builds, not developmentGitServicecan now correctly locate and execute7zr.exeduring setup.gitignorecleanup does not affect build process (7zr.exe in build/resources/ is properly ignored by/build/entry)Screenshots:
N/A - Documentation and code refactoring changes
Checklist:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.