Skip to content
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

Implement sidecar tasks and task resource specification #263

Merged
merged 7 commits into from
Dec 1, 2020

Conversation

katrogan
Copy link
Contributor

Moved the resources to a separate location to avoid a circular dependency with task and python_function_task, let me know if it belongs elsewhere.

Also the foo().with_overrides(cpu="1") syntax is not implemented by these changes

from flytekit.common.exceptions import user as _user_exceptions
from flytekit.models import task as _task_model
from flytekit.models import task as _task_models
from flytekit.plugins import k8s as _lazy_k8s
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think you need to do this. But, I guess lets keep it. I need to move all the _lazy_k8s logic to the plugins

limits: Resource = None


def _get_resources(**kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not _

Copy link
Contributor

Choose a reason for hiding this comment

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

also, does it work if you put all the kwargs in the function declaration? doesn't really matter, but maybe can play around with it.

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 will gladly not _

@@ -88,6 +89,8 @@ def __init__(
self._task_function = task_function
self._task_config = task_config
self._container_image = container_image
# TODO(katrogan): Implement resource overrides
self._resources = _get_resources(**kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

if you're going to use self._resources then add a property so that self.resources returns the object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

storage_limit=self._resources.limits.storage,
cpu_limit=self._resources.limits.cpu,
gpu_limit=self._resources.limits.gpu,
memory_limit=self._resources.limits.mem,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

should add **kwargs as the last item.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

talked offline, added to get_resources

@katrogan katrogan merged commit d853b45 into annotations Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants