-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
louis-jan
wants to merge
5
commits into
feat/local-engine-management
Choose a base branch
from
chore/local-engine-select-default-engine
base: feat/local-engine-management
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: local engine - symlink bundled variants #4342
louis-jan
wants to merge
5
commits into
feat/local-engine-management
from
chore/local-engine-select-default-engine
+219
−290
Conversation
This file contains 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
louis-jan
changed the title
Chore/local engine select default engine
feat: local engine - symlink bundled variants
Dec 26, 2024
louis-jan
had a problem deploying
to
production
December 27, 2024 01:54 — with
GitHub Actions
Failure
louis-jan
had a problem deploying
to
production
December 27, 2024 01:54 — with
GitHub Actions
Failure
louis-jan
had a problem deploying
to
production
December 27, 2024 03:30 — with
GitHub Actions
Failure
louis-jan
had a problem deploying
to
production
December 27, 2024 03:54 — with
GitHub Actions
Failure
louis-jan
had a problem deploying
to
production
December 27, 2024 04:06 — with
GitHub Actions
Failure
urmauur
approved these changes
Dec 27, 2024
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
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.
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
: Replacedtsc
andwebpack
withrolldown
for the build process, added@rollup/plugin-replace
androlldown
as devDependencies, and includedcpu-instructions
as a dependency.rolldown.config.js
: Added a new configuration file forrolldown
to define build settings and plugins.Custom Error Handling:
src/error.ts
: Introduced a newEngineError
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 newEngineError
class. [1] [2] [3]Refactoring Tests:
src/node/index.test.ts
: Refactored and renamed tests to align with the new structure and methods in theengine-management-extension
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]File Renaming and Refactoring:
src/node/index.ts
: Renamed fromexecute.ts
and refactored to include new imports and remove unused functions. [1] [2]