Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit f0db511

Browse files
authored
Supporting DataLoadingConfig on K8sPod type (#325)
* supporting data loading config for k8s pod type Signed-off-by: Daniel Rammer <daniel@union.ai> * should be checking dataLoadingConfig for nil Signed-off-by: Daniel Rammer <daniel@union.ai> * updated flyteidl Signed-off-by: Daniel Rammer <daniel@union.ai> --------- Signed-off-by: Daniel Rammer <daniel@union.ai>
1 parent be833e2 commit f0db511

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/athena v1.0.0
1313
github.com/bstadlbauer/dask-k8s-operator-go-client v0.1.0
1414
github.com/coocood/freecache v1.1.1
15-
github.com/flyteorg/flyteidl v1.3.6
15+
github.com/flyteorg/flyteidl v1.3.12
1616
github.com/flyteorg/flytestdlib v1.0.15
1717
github.com/go-test/deep v1.0.7
1818
github.com/golang/protobuf v1.5.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL
232232
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
233233
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
234234
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
235-
github.com/flyteorg/flyteidl v1.3.6 h1:PI846AdnrQZ84pxRVAzA3WGihv+xXmjQHO91nj/kV9g=
236-
github.com/flyteorg/flyteidl v1.3.6/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM=
235+
github.com/flyteorg/flyteidl v1.3.12 h1:RTcxCrqKU235cWuy+j3gkmqPJOaaYEcJaT6fsRjoS8Q=
236+
github.com/flyteorg/flyteidl v1.3.12/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM=
237237
github.com/flyteorg/flytestdlib v1.0.15 h1:kv9jDQmytbE84caY+pkZN8trJU2ouSAmESzpTEhfTt0=
238238
github.com/flyteorg/flytestdlib v1.0.15/go.mod h1:ghw/cjY0sEWIIbyCtcJnL/Gt7ZS7gf9SUi0CCPhbz3s=
239239
github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk=

go/tasks/pluginmachinery/flytek8s/pod_helper.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,21 @@ func ApplyFlytePodConfiguration(ctx context.Context, tCtx pluginsCore.TaskExecut
219219
}
220220

221221
// add copilot configuration to primaryContainer and PodSpec (if necessary)
222-
if taskTemplate.GetContainer() != nil {
223-
if err := AddCoPilotToContainer(ctx, config.GetK8sPluginConfig().CoPilot, primaryContainer,
224-
taskTemplate.Interface, taskTemplate.GetContainer().DataConfig); err != nil {
222+
var dataLoadingConfig *core.DataLoadingConfig
223+
if container := taskTemplate.GetContainer(); container != nil {
224+
dataLoadingConfig = container.GetDataConfig()
225+
} else if pod := taskTemplate.GetK8SPod(); pod != nil {
226+
dataLoadingConfig = pod.GetDataConfig()
227+
}
228+
229+
if dataLoadingConfig != nil {
230+
if err := AddCoPilotToContainer(ctx, config.GetK8sPluginConfig().CoPilot,
231+
primaryContainer, taskTemplate.Interface, dataLoadingConfig); err != nil {
225232
return nil, nil, err
226233
}
227234

228235
if err := AddCoPilotToPod(ctx, config.GetK8sPluginConfig().CoPilot, podSpec, taskTemplate.GetInterface(),
229-
tCtx.TaskExecutionMetadata(), tCtx.InputReader(), tCtx.OutputWriter(), taskTemplate.GetContainer().GetDataConfig()); err != nil {
236+
tCtx.TaskExecutionMetadata(), tCtx.InputReader(), tCtx.OutputWriter(), dataLoadingConfig); err != nil {
230237
return nil, nil, err
231238
}
232239
}

0 commit comments

Comments
 (0)