Skip to content

Commit 93af9b8

Browse files
authored
Merge branch 'main' into feat/handle-lakefs-exception
2 parents 4eab50b + 850fd85 commit 93af9b8

27 files changed

Lines changed: 756 additions & 55 deletions

File tree

.github/workflows/build-and-push-images.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ on:
4949
- both
5050
- amd64
5151
- arm64
52+
with_r_support:
53+
description: 'Enable R support for workflow-execution-coordinator'
54+
required: false
55+
default: false
56+
type: boolean
5257
schedule:
5358
# Run nightly at 2:00 AM UTC
5459
- cron: '0 2 * * *'
@@ -70,6 +75,7 @@ jobs:
7075
docker_registry: ${{ steps.set-params.outputs.docker_registry }}
7176
services: ${{ steps.set-params.outputs.services }}
7277
platforms: ${{ steps.set-params.outputs.platforms }}
78+
with_r_support: ${{ steps.set-params.outputs.with_r_support }}
7379
steps:
7480
- name: Set build parameters
7581
id: set-params
@@ -82,13 +88,15 @@ jobs:
8288
echo "docker_registry=apache" >> $GITHUB_OUTPUT
8389
echo "services=*" >> $GITHUB_OUTPUT
8490
echo "platforms=both" >> $GITHUB_OUTPUT
91+
echo "with_r_support=false" >> $GITHUB_OUTPUT
8592
else
8693
echo "Manual workflow_dispatch - using user inputs"
8794
echo "branch=${{ github.event.inputs.branch || 'main' }}" >> $GITHUB_OUTPUT
8895
echo "image_tag=${{ github.event.inputs.image_tag }}" >> $GITHUB_OUTPUT
8996
echo "docker_registry=${{ github.event.inputs.docker_registry || 'apache' }}" >> $GITHUB_OUTPUT
9097
echo "services=${{ github.event.inputs.services || '*' }}" >> $GITHUB_OUTPUT
9198
echo "platforms=${{ github.event.inputs.platforms || 'both' }}" >> $GITHUB_OUTPUT
99+
echo "with_r_support=${{ github.event.inputs.with_r_support || 'false' }}" >> $GITHUB_OUTPUT
92100
fi
93101
94102
# Step 1: Generate JOOQ code once and share it
@@ -350,6 +358,8 @@ jobs:
350358
tags: ${{ env.DOCKER_REGISTRY }}/${{ matrix.image_name }}:${{ needs.set-parameters.outputs.image_tag }}-amd64
351359
cache-from: type=gha,scope=${{ matrix.image_name }}-amd64
352360
cache-to: type=gha,mode=max,scope=${{ matrix.image_name }}-amd64
361+
build-args: |
362+
${{ (matrix.service == 'computing-unit-master' || matrix.service == 'computing-unit-worker') && needs.set-parameters.outputs.with_r_support == 'true' && 'WITH_R_SUPPORT=true' || '' }}
353363
labels: |
354364
org.opencontainers.image.title=${{ matrix.image_name }}
355365
org.opencontainers.image.description=Apache Texera ${{ matrix.image_name }} (AMD64)
@@ -427,6 +437,8 @@ jobs:
427437
tags: ${{ env.DOCKER_REGISTRY }}/${{ matrix.image_name }}:${{ needs.set-parameters.outputs.image_tag }}-arm64
428438
cache-from: type=gha,scope=${{ matrix.image_name }}-arm64
429439
cache-to: type=gha,mode=max,scope=${{ matrix.image_name }}-arm64
440+
build-args: |
441+
${{ (matrix.service == 'computing-unit-master' || matrix.service == 'computing-unit-worker') && needs.set-parameters.outputs.with_r_support == 'true' && 'WITH_R_SUPPORT=true' || '' }}
430442
labels: |
431443
org.opencontainers.image.title=${{ matrix.image_name }}
432444
org.opencontainers.image.description=Apache Texera ${{ matrix.image_name }} (ARM64)
@@ -487,6 +499,7 @@ jobs:
487499
echo "- **Tag:** \`${{ needs.set-parameters.outputs.image_tag }}\`" >> $GITHUB_STEP_SUMMARY
488500
echo "- **Services:** ${{ needs.set-parameters.outputs.services }}" >> $GITHUB_STEP_SUMMARY
489501
echo "- **Platforms:** ${{ needs.set-parameters.outputs.platforms }}" >> $GITHUB_STEP_SUMMARY
502+
echo "- **R Support:** ${{ needs.set-parameters.outputs.with_r_support }}" >> $GITHUB_STEP_SUMMARY
490503
echo "" >> $GITHUB_STEP_SUMMARY
491504
echo "## Build Method" >> $GITHUB_STEP_SUMMARY
492505
echo "**Parallel platform builds** (faster)" >> $GITHUB_STEP_SUMMARY

amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/CostBasedScheduleGenerator.scala

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,15 @@ class CostBasedScheduleGenerator(
304304
*/
305305
private def createRegionDAG(): DirectedAcyclicGraph[Region, RegionLink] = {
306306
val searchResultFuture: Future[SearchResult] = Future {
307-
if (ApplicationConfig.useTopDownSearch)
308-
topDownSearch(globalSearch = ApplicationConfig.useGlobalSearch)
309-
else
310-
bottomUpSearch(globalSearch = ApplicationConfig.useGlobalSearch)
307+
workflowContext.workflowSettings.executionMode match {
308+
case ExecutionMode.MATERIALIZED =>
309+
getFullyMaterializedSearchState
310+
case ExecutionMode.PIPELINED =>
311+
if (ApplicationConfig.useTopDownSearch)
312+
topDownSearch(globalSearch = ApplicationConfig.useGlobalSearch)
313+
else
314+
bottomUpSearch(globalSearch = ApplicationConfig.useGlobalSearch)
315+
}
311316
}
312317
val searchResult = Try(
313318
Await.result(searchResultFuture, ApplicationConfig.searchTimeoutMilliseconds.milliseconds)
@@ -477,6 +482,29 @@ class CostBasedScheduleGenerator(
477482
)
478483
}
479484

485+
/** Constructs a baseline fully materialized region plan (one operator per region) and evaluates its cost. */
486+
def getFullyMaterializedSearchState: SearchResult = {
487+
val startTime = System.nanoTime()
488+
489+
val (regionDAG, cost) =
490+
tryConnectRegionDAG(physicalPlan.links) match {
491+
case Left(dag) => (dag, allocateResourcesAndEvaluateCost(dag))
492+
case Right(_) =>
493+
(
494+
new DirectedAcyclicGraph[Region, RegionLink](classOf[RegionLink]),
495+
Double.PositiveInfinity
496+
)
497+
}
498+
499+
SearchResult(
500+
state = Set.empty,
501+
regionDAG = regionDAG,
502+
cost = cost,
503+
searchTimeNanoSeconds = System.nanoTime() - startTime,
504+
numStatesExplored = 1
505+
)
506+
}
507+
480508
/**
481509
* Another direction to perform the search. Depending on the configuration, either a global search or a greedy search
482510
* will be performed to find an optimal plan. The search starts from a plan where all edges are materialized, and

amber/src/main/scala/org/apache/texera/workflow/WorkflowCompiler.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ class WorkflowCompiler(
151151
val (physicalPlan, outputPortsNeedingStorage) =
152152
expandLogicalPlan(logicalPlan, logicalPlanPojo.opsToViewResult, None)
153153

154-
context.workflowSettings =
155-
WorkflowSettings(context.workflowSettings.dataTransferBatchSize, outputPortsNeedingStorage)
154+
context.workflowSettings = context.workflowSettings.copy(
155+
outputPortsNeedingStorage = outputPortsNeedingStorage
156+
)
156157

157158
Workflow(context, logicalPlan, physicalPlan)
158159
}

0 commit comments

Comments
 (0)