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

Retrieve launch plan interfaces from admin #103

Merged
merged 14 commits into from
Apr 8, 2020

Conversation

wild-endeavor
Copy link
Contributor

@wild-endeavor wild-endeavor commented Apr 3, 2020

TL;DR

When Propeller comes across a launch plan node in a DynamicJobSpec it will hit Admin to retrieve the interface for the LP to do the interface check.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Please see the issue linked below and also the SDK PR flyteorg/flytekit#92 for more information. A sample dynamic job spec object has been uploaded here as well. Please see the text file for the type of dynamic job spec this PR is meant to support.
dynamic_job_spec.txt

  • Added a GetLaunchPlan function to a launchplan/Reader interface which sits alongside the launchplan/Executor interface. Admin client wrapper now satisfies both interfaces.
  • Added a call to that function in the dynamic job handler buildContextualDynamicWorkflow function.

Tracking Issue

flyteorg/flyte#139

Follow-up issue

flyteorg/flyte#246
This PR will be deprecated upon completion of this issue.

@kumare3
Copy link
Contributor

kumare3 commented Apr 3, 2020

What is this for? Dynamic LP?

@wild-endeavor
Copy link
Contributor Author

Yes.

pkg/controller/nodes/dynamic/handler.go Show resolved Hide resolved
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
)

// Should we call this something else? It can be used more generally if ever necessary.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically: I wanted to make both tasks and launchplan parameters in the compiler to take InterfaceProviders... but then launch plans diverged (with expected* stuff) maybe there is still hope?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of a good name... InterfaceProviderProvider was the best I could come up with, so I'm leaving it as is for now.

@codecov-io
Copy link

Codecov Report

Merging #103 into master will increase coverage by 0.11%.
The diff coverage is 71.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   50.01%   50.13%   +0.11%     
==========================================
  Files         128      129       +1     
  Lines        7966     8007      +41     
==========================================
+ Hits         3984     4014      +30     
- Misses       3594     3601       +7     
- Partials      388      392       +4     
Impacted Files Coverage Δ
...kg/controller/nodes/subworkflow/launchplan/noop.go 73.33% <0.00%> (-11.29%) ⬇️
pkg/controller/nodes/dynamic/handler.go 64.09% <61.11%> (+0.30%) ⬆️
...g/controller/nodes/subworkflow/launchplan/admin.go 75.23% <66.66%> (-1.11%) ⬇️
pkg/compiler/admin.go 100.00% <100.00%> (ø)
pkg/compiler/workflow_compiler.go 80.00% <100.00%> (ø)
pkg/controller/nodes/handler_factory.go 47.82% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd3571d...7fee006. Read the comment docs.

@@ -97,6 +97,26 @@ func (a *adminLaunchPlanExecutor) GetStatus(ctx context.Context, executionID *co
return item.ExecutionClosure, item.SyncError
}

func (a *adminLaunchPlanExecutor) GetLaunchPlan(ctx context.Context, launchPlanRef *core.Identifier) (*admin.LaunchPlan, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this method here is fine, but having a separate interface for this method is useful to differentiate the use cases and usage paths

"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
)

// This object is meant to satisfy github.com/lyft/flytepropeller/pkg/compiler/common.InterfaceProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not answer why this is needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a struct to satisfy the interface because the function that we pass it to, compiler.CompileWorkflow takes the common.InterfaceProvider interface.

@kumare3
Copy link
Contributor

kumare3 commented Apr 8, 2020

Thank you for the changes.

Copy link
Contributor

@kumare3 kumare3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wild-endeavor wild-endeavor merged commit 89406fb into master Apr 8, 2020
kumare3 pushed a commit to nuclyde-io/flytepropeller that referenced this pull request Feb 4, 2021
* Initial copy from propeller

* Remove travis

* Linking the makefile

* add k8s integration

* add description for bumping versions

* add permissions

* add permissions

* load my awesome image

* use flyteadmin:test

* Pick a running admin pod

* Setup a clean cluster for integration tests

* use builder phase

* Request more memory for postgres

* Fix script
eapolinario pushed a commit to eapolinario/flytepropeller that referenced this pull request Aug 9, 2023
# TL;DR
When Propeller comes across a launch plan node in a `DynamicJobSpec` it will hit Admin to retrieve the interface for the LP to do the interface check.

## Type
 - [ ] Bug Fix
 - [x] Feature
 - [ ] Plugin

## Are all requirements met?

 - [x] Code completed
 - [x] Smoke tested
 - [x] Unit tests added
 - [x] Code documentation added
 - [x] Any pending items have an associated Issue

## Complete description
Please see the issue linked below and also the SDK PR flyteorg/flytekit#92 for more information.  A sample dynamic job spec object has been uploaded here as well.  Please see the text file for the type of dynamic job spec this PR is meant to support.
[dynamic_job_spec.txt](https://github.com/lyft/flytepropeller/files/4430252/dynamic_job_spec.txt)

* Added a `GetLaunchPlan` function to a `launchplan/Reader` interface which sits alongside the `launchplan/Executor` interface.  Admin client wrapper now satisfies both interfaces.
* Added a call to that function in the dynamic job handler `buildContextualDynamicWorkflow` function.

## Tracking Issue
flyteorg/flyte#139

## Follow-up issue
flyteorg/flyte#246
This PR will be deprecated upon completion of this issue.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants