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

Edit Docker Compose File, Add "accept-content" To Dockerfile's Entrypoint #300

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

Conversation

rojinebrahimi
Copy link

Hello! Hope everything is alright with you.

I had this problem with new version of Celery which forced me to use accept-content for de-serialization, Currently, I am using the Helm chart and I have added the command section to make it up & running:

 command:
    - python
    - /app/cli.py
    - >-
      --accept-content=json,pickle,application/json,application/x-python-serialize

I thought it would be great to add this to the main Dockerfile so the image would be ready to use.

Moreover, I have made some changes in the main docker-compose.yml so that the image could be tested locally.
Hope it helps others, too.

Your consideration is appreciated.

@danihodovic
Copy link
Owner

You can use the environment variable CE_ACCEPT_CONTENT I think. Can you give that a try?

https://github.com/danihodovic/celery-exporter/blob/master/src/cli.py#L43

@FedericoSinisi
Copy link

FedericoSinisi commented Nov 21, 2024

Hey I test this and it work OK!

env:
  - name: CE_BROKER_URL
    value: "amqp://XXXX:[email protected]/"
  - name: CE_ACCEPT_CONTENT
    value: "json,pickle,application/json,application/json,application/x-python-serialize"

And the pod startup show exactly the same

➜  ~ k logs -f pod/celery-exporter-5c89594f74-c5rhx -n backend
2024-11-21 15:33:30.961 | INFO     | src.exporter:run:335 - Setting celery accept_content ['json', 'pickle', 'application/json', 'application/json', 'application/x-python-serialize'] 
2024-11-21 15:33:30.988 | INFO     | src.http_server:start_http_server:66 - Started celery-exporter at host='0.0.0.0' on port='9808'

Thanks!

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