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

Add creation handler (WIP) #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gautamp8
Copy link
Collaborator

@gautamp8 gautamp8 commented Mar 27, 2021

This PR contains the following changes -

  • Add dataclass for custom resource
  • Utilities for generating Kubernetes resources(Pods, Service, Deployments) for worker and flower
  • Some refactoring/re-arranging of old project files

TODOs:

  • Decide the handler status return structure to be stored as status value in custom resource created
  • Support for Celery 5
  • Kopf unit test for creation

Dependent changes -
This PR to be merged only after #15 is merged.

Upcoming changes:

  • Add Update handler
  • Cleaning up of old code of updation, creation, and autoscaling utilities.

@lgtm-com
Copy link

lgtm-com bot commented Mar 27, 2021

This pull request introduces 2 alerts and fixes 2 when merging 14cef07 into 3163d6c - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused local variable
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Mar 27, 2021

This pull request introduces 2 alerts and fixes 2 when merging 5565fa8 into 3163d6c - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused local variable
  • 1 for Unused import

from math import ceil
from collections import namedtuple
import requests
Copy link
Member

Choose a reason for hiding this comment

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

you can try httpx and see if any side effect

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, actually, it's the old code dependency that I wrote for the prototype. I'll remove it in the next PR. It is being used to poll flower API to fetch queue length. Autoscaling implementation will change entirely.

from models.celery_custom_resource import CeleryCustomResource


class FlowerDeploymentGenerator(object):
Copy link
Member

Choose a reason for hiding this comment

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

explicit inheritance from the object is not needed

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.

2 participants