-
Notifications
You must be signed in to change notification settings - Fork 77
Add Switch transpiler with --include-llm-transpiler flag
#2066
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: main
Are you sure you want to change the base?
Conversation
- Add Switch installer with resource configuration and job creation - Implement uninstall functionality with proper cleanup - Add comprehensive test coverage for SwitchInstaller - Improve path handling and type-safe configuration - Add include-llm-transpiler option for flexible installation
|
✅ 46/46 passed, 7 flaky, 3m8s total Flaky tests:
Running from acceptance #2730 |
Implement SwitchInstaller to integrate Switch transpiler with Lakebridge: - Install Switch package to local virtual environment and deploy to workspace - Create and manage Databricks job for Switch transpilation - Configure Switch resources (catalog, schema, volume) interactively - Support job-level parameters with JobParameterDefinition for flexibility - Handle installation state and job lifecycle management - Add comprehensive test suite covering installation, job management, and configuration
0f749b8 to
7cb9ea9
Compare
The SwitchInstaller was failing to find the config when the config.yml used "Switch" (capitalized) as the name, while the code only checked for "switch" (lowercase). This caused job creation to fail with a "config.yml not found" error. Updated _get_switch_job_parameters() to check both the display name (capitalized) and transpiler ID (lowercase) to handle both cases.
| wheel_name = self._PYPI_PACKAGE_NAME.replace("-", "_") | ||
| return wheel_name in artifact.name and artifact.suffix == ".whl" | ||
|
|
||
| def install(self, artifact: Path | None = None) -> bool: |
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.
This is how we have separated things out: the installer installs things locally, deployer deploys to the workspace. You need something similar to recon deployer that way you don't need to have workspace client inside TranspilerInstaller
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.
Thanks for the feedback. Updated in 8439314 - created SwitchDeployment for workspace operations (following ReconDeployment pattern) and removed workspace dependencies from TranspilerInstaller.
| for transpiler_installer in self._transpiler_installers: | ||
| transpiler_installer.install() | ||
| if not config: | ||
| config = self.configure(module) |
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.
| config = self.configure(module, include-llm) |
and use configure to implement switch-related prompts and have a deployer similar to recon deployment for doing workspace-related interaction.
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.
Thanks for the suggestion. Updated in 8439314 to use the configure(module, include_llm) pattern. Switch resources are now prompted during configuration, stored in TranspileConfig, and passed to SwitchDeployment for workspace setup.
Separates Switch transpiler's local installation logic from workspace deployment, following established patterns (BladebridgeInstaller for local installation, ReconDeployment for workspace deployment). Key changes: - Add SwitchDeployment class (~260 lines) for workspace operations - Simplify SwitchInstaller to match BladebridgeInstaller pattern (~20 lines) - Add include_llm and switch_resources fields to TranspileConfig - Update WorkspaceInstallation to use SwitchDeployment - Refactor tests to avoid protected member access using fixture separation - Group Switch-related tests in TestSwitchInstallation class
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2066 +/- ##
==========================================
- Coverage 64.78% 64.29% -0.50%
==========================================
Files 96 97 +1
Lines 7891 8068 +177
Branches 820 838 +18
==========================================
+ Hits 5112 5187 +75
- Misses 2599 2699 +100
- Partials 180 182 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| return { | ||
| "name": job_name, | ||
| "tags": {"created_by": self._ws.current_user.me().id, "switch_version": f"v{switch_version}"}, |
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.
@sundarshankar89 By using .id, the created_by tag value will be the user's ID (e.g. 5099015744649857) rather than the user's email address. While this is clearer from a system perspective, it may be less intuitive for users themselves.
Changes
This PR adds Switch, an LLM-powered transpiler, as an optional component in Lakebridge's
install-transpileworkflow. Switch installation is controlled by the new--include-llm-transpilerflag.What does this PR do?
Implements complete Switch transpiler integration with idempotent installation, workspace deployment, job management, and resource configuration including Unity Catalog Volume for Switch.
Relevant implementation details
CLI Integration:
--include-llm-transpilerflag toinstall-transpilecommand (default:false)SwitchInstaller Implementation:
TranspilerInstallerwith unified constructor signaturedatabricks-switch-plugin)/Users/{user}/.lakebridge/switch/LAKEBRIDGE_Switchjob with NotebookTask for parallel LLM processingUninstall Integration:
databricks labs uninstall lakebridgeworkflowCaveats/things to watch out for when reviewing:
--include-llm-transpilerflag to install Switchinclude-llm-transpiler, "true"to user agentmax-argsfrom 12 to 13 inpyproject.tomlto accommodate new CLI parameterLinked issues
Resolves #2048
Console Output
Functionality
databricks labs lakebridge install-transpile(adds--include-llm-transpilerflag and Switch installation support)databricks labs uninstall lakebridge(adds Switch job and resource cleanup)Tests