Skip to content
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

feat: local engine - symlink bundled variants #4342

Open
wants to merge 5 commits into
base: feat/local-engine-management
Choose a base branch
from

Conversation

louis-jan
Copy link
Contributor

Describe Your Changes

Currently, Jan packages all the available engines into the compressed app resource folder. E.g. on MacOS, it's inside Jan.app > Contents > Resources > app.asar.unpacked > shared. Since this folder is read-only, there's no way to download, install, or update the engine variant in the directory.

Now Jan symlinks all available bundled variant versions to Jan Data Folder, so that cortex.cpp server can function consistently without issue about writing permissions. The engine_path environment variable is set so that cortex.cpp can remove the complex implementation of handling the engine environment.

This PR also experimented with rolldown.rs to compile extensions much faster.

Fixes Issues

Changes made

This pull request includes significant updates to the engine-management-extension package. The changes involve switching the build system, adding new dependencies, introducing a custom error class, updating the main extension logic, and refactoring tests.

Build System and Dependencies:

  • package.json: Replaced tsc and webpack with rolldown for the build process, added @rollup/plugin-replace and rolldown as devDependencies, and included cpu-instructions as a dependency.
  • rolldown.config.js: Added a new configuration file for rolldown to define build settings and plugins.

Custom Error Handling:

  • src/error.ts: Introduced a new EngineError class to handle specific engine-related errors.

Main Extension Logic:

  • src/index.ts: Updated the main extension logic to handle symlinking engines, running health checks, and comparing engine versions using the new EngineError class. [1] [2] [3]

Refactoring Tests:

File Renaming and Refactoring:

  • src/node/index.ts: Renamed from execute.ts and refactored to include new imports and remove unused functions. [1] [2]

@louis-jan louis-jan changed the title Chore/local engine select default engine feat: local engine - symlink bundled variants Dec 26, 2024
Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants