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

Added Watchmedo command to worker container to allow container to res… #2685

Merged
merged 3 commits into from
Nov 4, 2022

Conversation

itdependsnetworks
Copy link
Contributor

@itdependsnetworks itdependsnetworks commented Oct 25, 2022

Closes: DNE

What's Changed

Added Watchmedo command to worker container to allow container to restart on file change.

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)

@itdependsnetworks
Copy link
Contributor Author

itdependsnetworks commented Oct 25, 2022

Confirmed (by changing a file) that it works

nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | worker: Hitting Ctrl+C again will terminate all running tasks!
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | worker: Warm shutdown (MainProcess)
nautobot-celery_worker-1  | /usr/local/lib/python3.7/site-packages/celery/platforms.py:841: SecurityWarning: You're running the worker with superuser privileges: this is
nautobot-celery_worker-1  | absolutely not recommended!
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | Please specify a different user using the --uid option.
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | User information: uid=0 euid=0 gid=0 egid=0
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  |   uid=uid, euid=euid, gid=gid, egid=egid,
nautobot-celery_worker-1  |  
nautobot-celery_worker-1  |  -------------- celery@c08313901761 v5.2.7 (dawn-chorus)
nautobot-celery_worker-1  | --- ***** ----- 
nautobot-celery_worker-1  | -- ******* ---- Linux-5.10.124-linuxkit-aarch64-with-debian-11.5 2022-10-25 23:37:30
nautobot-celery_worker-1  | - *** --- * --- 
nautobot-celery_worker-1  | - ** ---------- [config]
nautobot-celery_worker-1  | - ** ---------- .> app:         nautobot:0xffffb2aad210
nautobot-celery_worker-1  | - ** ---------- .> transport:   redis://:**@redis:6379/0
nautobot-celery_worker-1  | - ** ---------- .> results:     redis://:**@redis:6379/0
nautobot-celery_worker-1  | - *** --- * --- .> concurrency: 5 (prefork)
nautobot-celery_worker-1  | -- ******* ---- .> task events: ON
nautobot-celery_worker-1  | --- ***** ----- 
nautobot-celery_worker-1  |  -------------- [queues]
nautobot-celery_worker-1  |                 .> celery           exchange=celery(direct) key=celery
nautobot-celery_worker-1  |                 
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | [tasks]
nautobot-celery_worker-1  |   . nautobot.extras.datasources.git.git_repository_diff_origin_and_local
nautobot-celery_worker-1  |   . nautobot.extras.datasources.git.pull_git_repository_and_refresh_data
nautobot-celery_worker-1  |   . nautobot.extras.jobs.run_job
nautobot-celery_worker-1  |   . nautobot.extras.jobs.scheduled_job_handler
nautobot-celery_worker-1  |   . nautobot.extras.tasks.delete_custom_field_data
nautobot-celery_worker-1  |   . nautobot.extras.tasks.process_webhook
nautobot-celery_worker-1  |   . nautobot.extras.tasks.provision_field
nautobot-celery_worker-1  |   . nautobot.extras.tasks.update_custom_field_choice_data
nautobot-celery_worker-1  |   . nautobot.utilities.tasks.get_releases
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | [2022-10-25 23:37:30,802: INFO/MainProcess] Connected to redis://:**@redis:6379/0
nautobot-celery_worker-1  | [2022-10-25 23:37:30,807: INFO/MainProcess] mingle: searching for neighbors
nautobot-celery_worker-1  | [2022-10-25 23:37:31,823: INFO/MainProcess] mingle: all alone
nautobot-celery_worker-1  | [2022-10-25 23:37:31,850: WARNING/MainProcess] /usr/local/lib/python3.7/site-packages/celery/fixups/django.py:204: UserWarning: Using settings.DEBUG leads to a memory
nautobot-celery_worker-1  |             leak, never use this setting in production environments!
nautobot-celery_worker-1  |   leak, never use this setting in production environments!''')
nautobot-celery_worker-1  | 
nautobot-celery_worker-1  | [2022-10-25 23:37:31,850: INFO/MainProcess] celery@c08313901761 ready.

Watchdog (the Python packaged that runs watchmedo) is already installed via mkdocs

├── mkdocs >=1.3.0
│   ├── click >=3.3 
│   │   ├── colorama * 
│   │   └── importlib-metadata * 
│   │       ├── typing-extensions >=3.6.4 
│   │       └── zipp >=0.5 
│   ├── ghp-import >=1.0 
│   │   └── python-dateutil >=2.8.1 
│   │       └── six >=1.5 
│   ├── importlib-metadata >=4.3 (circular dependency aborted here)
│   ├── jinja2 >=2.10.2 
│   │   └── markupsafe >=2.0 
│   ├── markdown >=3.2.1,<3.4 
│   │   └── importlib-metadata >=4.4 (circular dependency aborted here)
│   ├── mergedeep >=1.3.4 
│   ├── packaging >=20.5 
│   │   └── pyparsing >=2.0.2,<3.0.5 || >3.0.5 
│   ├── pyyaml >=3.10 
│   ├── pyyaml-env-tag >=0.1 
│   │   └── pyyaml * (circular dependency aborted here)
│   └── watchdog >=2.0 

@glennmatthews
Copy link
Contributor

Thanks for the PR! I think it would be good to add watchdog as an explicit dev-dependency just in case mkdocs ever changes its dependencies to no longer require it. It would also be good to update the documentation. It looks like for the virtualenv workflow we don't even have any documentation about running the Celery worker in development - we should add a section about that and document using watchmedo in that case for convenience and feature parity with the docker-compose workflow.

@itdependsnetworks
Copy link
Contributor Author

I gave the docs updates the old college try

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Docs changes look good. Any idea why poetry.lock is showing so many updated versions of other dependencies?

@itdependsnetworks
Copy link
Contributor Author

Honestly, I don't know enough about poetry. Initially I tried poetry add -D watchdog, that created another group, so i moved it into the existing group, and then ran poetry lock. Perhaps I did not follow the correct way to do it.

@itdependsnetworks
Copy link
Contributor Author

Thanks @glennmatthews!! Now I understand

Copy link
Member

@bryanculver bryanculver left a comment

Choose a reason for hiding this comment

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

Addressed merge conflicts. Should be GTG

@glennmatthews glennmatthews merged commit e73d25c into nautobot:develop Nov 4, 2022
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.

None yet

3 participants