Skip to content

Conversation

@gautamp8
Copy link
Contributor

@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

@gautamp8 gautamp8 force-pushed the kopf-creation-handler branch from 14cef07 to 5565fa8 Compare March 27, 2021 07:39
@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

import constants
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
Contributor 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