Giter Site home page Giter Site logo

How to correctly inject config? about flower HOT 2 OPEN

ntarocco avatar ntarocco commented on July 21, 2024 1
How to correctly inject config?

from flower.

Comments (2)

Andrew-Cha avatar Andrew-Cha commented on July 21, 2024

Hi, I am also not able to monitor my workers (the error above is identical).

In docker container "My Celery Worker" the celery workers are configured to serialize over pickle.
In another docker container "My Flower Monitoring" the celery flower lives (using the official image).

I am unable to match the config of "My Celery Worker" and "My Flower Monitoring" Celery applications.

What is the accepted solution to configure Flower's Celery instance in the official image?

When Pickle Serializer is used in the worker container (Untrusted Content Error)

image

When the Pickle Serializer is not used in the worker container (Everything works)

image

from flower.

eexwhyzee avatar eexwhyzee commented on July 21, 2024

so i ran into the same issue with the untrusted content errors today and was able to figure out how to inject the celery config correctly, the --config arg for the celery CLI is actually expecting a python-import-style module for the config and not a file path.

I have a similar setup as @ntarocco with k8s and what you want to do is mount the config map with your celery configuration at the path of the docker container where celery/flower is being invoked, and then pass just the file name (without the .py extension) to the --config arg.

Here's my k8s deployment/configmap specs from my working setup for reference:

apiVersion: v1
kind: ConfigMap
metadata:
  name: celery-config
data:
  celeryconfig.py: |
    accept_content = ['application/x-python-serialize', 'application/json']
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: flower
  name: flower
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flower
  template:
    metadata:
      labels:
        app: flower
    spec:
      containers:
      - name: flower
        image: mher/flower:2.0.1
        command:
        - "celery"
        args:
        - "--config=celeryconfig"
        - "flower"
        env:
        - name: CELERY_BROKER_URL
          value: <your_broker_url>
        ports:
        - containerPort: 5555
          protocol: TCP
        volumeMounts:
        - mountPath: /data # path where celery/flower is being invoked in the docker container
          name: flower-config
      volumes:
      - configMap:
          name: flower-config
        name: flower-config

from flower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.