Conversation
fdccca4 to
371b080
Compare
- Enhance error coercion in common/errors/errors.ts - Sync protos/execution.proto and protos/jit.proto with new fields
* feat: add worker process management for JiT compilation - Introduce base worker and JiT-specific child process logic - Implement RPC bridge for database access during JiT - Add VM scripts and loader for isolated execution - Add unit tests for the RPC mechanism
* feat: add action descriptor support to JiT compilation results - Implement action and column descriptor logic in core/jit_compiler.ts - Support overrides for descriptions, labels, and tags in JiT results - Enhance error coercion in common/errors/errors.ts - Add comprehensive JiT metadata tests in core/jit_compiler_test.ts - Sync protos/execution.proto and protos/jit.proto with new result fields
* feat: enable JiT compilation in CLI run, build and compile commands - Connect main CLI execution flow to the JiT worker process - Add comprehensive JiT test suite - Finalize AoT build logic to preserve JiT-specific fields - Update CLI console and entry points for integrated JiT support
371b080 to
18042dd
Compare
kolina
left a comment
There was a problem hiding this comment.
Let's test compatibility with different Dataform core versions.
Also this change seems worth it to bump a minor version of Dataform core
| this.childProcess.on("close", exitCode => { | ||
| if (exitCode !== 0) { | ||
| reject(new Error(`Compilation child process exited with exit code ${exitCode}.`)); | ||
| const timeoutValue = compileConfig.timeoutMillis || DEFAULT_COMPILATION_TIMEOUT_MILLIS; |
There was a problem hiding this comment.
It seems that the default timeout is smaller currently?
| reject(coerceAsError(messageOrError)); | ||
| }); | ||
|
|
||
| this.childProcess.on("close", exitCode => { |
There was a problem hiding this comment.
Just to clarify: in the base worker you have a hook for "exit", they'll be equivalent?
| return await compileInChildProcess; | ||
| } finally { | ||
| if (!this.childProcess.killed) { | ||
| this.childProcess.kill("SIGKILL"); |
There was a problem hiding this comment.
In the base worker you don't send SIGKILL, I'd preserve this logic to avoid compiler ignoring SIGTERM for some reason
| private readonly dbadapter: dbadapters.IDbAdapter, | ||
| private readonly graph: dataform.IExecutionGraph, | ||
| private readonly executionOptions: IExecutionOptions = {}, | ||
| private readonly projectDir: string, |
There was a problem hiding this comment.
if it's part of IExecutionOptions, do you need to pass it separately?
| if (this.stopped) { | ||
| return actionResult; | ||
| try { | ||
| await this.dbadapter.withClientLock(async client => { |
There was a problem hiding this comment.
This withClientLock function doesn't do anything meaningful today (maybe it was needed before when we supported other warehouses), I'd remove it.
| type: "table", | ||
| tableType: "incremental", | ||
| jitCode: `async (jctx) => { | ||
| return jctx.incremental() ? "SELECT 'inc' as t" : "SELECT 'full' as t"; |
There was a problem hiding this comment.
add a test for incremental mode?
| this.childProcess = childProcess; | ||
| export class CompileChildProcess extends BaseWorker<string, string | Error> { | ||
| constructor() { | ||
| super("../../vm/compile_loader"); |
There was a problem hiding this comment.
Do I understand correctly that this will change the order of fork script resolution? I'd prefer to keep the original order
| // AoT compile() in cli/vm/compile.ts returns a JSON string of CompiledGraph. | ||
| // We need to wrap it in a CoreExecutionResponse and Base64 encode it | ||
| // to match what cli/api/commands/compile.ts expects. |
There was a problem hiding this comment.
Is it true? From my reading of code:
compileincli/vm/compile.tscallsmainfunction of Dataform core and returns its result here, in the CLI we always pass base-64 core execution request here- The
mainfunction in the Dataform core in this case returns base64-encoded serialized proto response here (comment about older version of the Dataform CLI is a bit confusing)
| reserved 1, 3, 7, 13; | ||
| bool disabled = 15; | ||
|
|
||
| reserved 1, 3, 7; |
There was a problem hiding this comment.
why do we have less reserved field numbers here?
| await callback(mockDbAdapterInstance); | ||
|
|
||
| const runner = new Runner(mockDbAdapterInstance, RUN_TEST_GRAPH); | ||
| const runner = new Runner(mockDbAdapterInstance, RUN_TEST_GRAPH, "."); |
There was a problem hiding this comment.
If someone uses the Dataform CLI as a library, will they need to update their code in the same manner?
ikholopov-omni
left a comment
There was a problem hiding this comment.
Blocked on review of https://github.com/dataform-co/dataform/pull/2109/changes
No description provided.