8000 Reload workers on code change (or improve documentation) · Issue #3846 · ansible/awx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Reload workers on code change (or improve documentation) #3846

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

Closed
cdvv7788 opened this issue May 7, 2019 · 8 comments
Closed

Reload workers on code change (or improve documentation) #3846

cdvv7788 opened this issue May 7, 2019 · 8 comments

Comments

@cdvv7788
Copy link
Contributor
cdvv7788 commented May 7, 2019
ISSUE TYPE
  • Documentation
COMPONENT NAME
  • Installer
SUMMARY

I followed all the steps at https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md and was able to set up the project locally. That much works.
However, when I started to modify python code, to see the changes I have to restart the whole process (tools_awx_1). I went to the irc (which is not very active) and couldn't find a way to enable the development server. Refreshing changes manually is very slow, and I don't think that every contributor does it that way.
I would like to have a little more information in the document about how to work and contribute to the project, because as it is, I would spend most of my time refreshing a server instead of making progress.
I noticed that there is something that should be reloading the code on changes (see additional information).
Maybe the code I am modifying is not running on uwsgi? (not familiar with the architecture yet, sorry). If the code needs to be refreshed on some async task runner (celery, maybe?), that is not happening.
Just fyi, I am trying to change notifications a little: awx/notifications/slack_backend.py

ENVIRONMENT
  • AWX version: 4.0.0
  • AWX install method: docker for mac
  • Ansible version: 2.7.10
  • Operating System: Macos
  • Web Browser: Chrome
STEPS TO REPRODUCE

Follow steps at https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md to setup server. Then change awx/notifications/slack_backend.py (with the dev server running)

EXPECTED RESULTS

The servers are reloaded, and the new code changes are reflected in the site.

ACTUAL RESULTS

It seems that uwsgi is reloaded, but code changes are still not reflected.

ADDITIONAL INFORMATION

image

@jbradberry
Copy link
Contributor
jbradberry commented May 7, 2019

@cdvv7788 The Slack notification backend does not delegate to task workers, so the reload of uwsgi should be sufficient. I am completely puzzled why the reloader would see your changes and reload, but you still have to restart your container to have those changes take effect.

Edit: though it may be that notifications are getting issued from within a task, so it might still be that the task worker reloader is not working correctly.

@cdvv7788
Copy link
Contributor Author
cdvv7788 commented May 7, 2019

@jbradberry I am running the test notification on the notification screen (the one with the bell icon).
I suspect of the async workers because of this:
image
uwsgi workers are logged like:
image
As I mentioned earlier, I am not very familiar with the project yet, but the dispatcher line (instead of uwsgi) makes me thing that it goes through a different worker.

@jbradberry
Copy link
Contributor

Ok, you are probably correct. I'll dig into it a bit more tomorrow.

@jbradberry
Copy link
Contributor

@cdvv7788 As a faster way of dealing with this before the fix gets in, try starting a shell session in your container and then running awx-manage run_dispatcher --reload.

@cdvv7788
Copy link
Contributor Author
cdvv7788 commented May 8, 2019

@jbradberry I am seeing the following:
image
However, code changes are still not making it through. I am using a logger.error line inside the 8000 slack file and it always prints the original line.
Other than the merge, is there something else required for the change to catch up?

@ryanpetrello
Copy link
Contributor
ryanpetrello commented May 8, 2019

I think this just plain doesn’t work because the parent dispatcher process forks its children.
When code changes in the development environment, the parent dispatcher process isn't recreated itself, so its children still have the old code.

To really accomplish this we’d need to have some way to restart the entire dispatcher process tree. I don't think honcho has a way to restart processes it's managing though.

@ryanpetrello
Copy link
Contributor
ryanpetrello commented May 8, 2019

@cdvv7788 thanks for reporting this, it should be resolved when #3855 merges (shortly).

@cdvv7788
Copy link
Contributor Author
cdvv7788 commented May 8, 2019

@ryanpetrello got it. Thanks a lot for your quick response.

ryanpetrello pushed a commit to ryanpetrello/awx that referenced this issue Oct 29, 2019
* Instance Groups Instances slider renders properly, and that list wraps properly.

* Instance Groups responds properly

* assorted container groups ui fixes
updated responsiveness of instance groups and instances list
fix layout of container group form
update help text for container group form elements
update text for tech preview top bar

* update container group doclink

* list styling updates based on feedback
ryanpetrello pushed a commit to ryanpetrello/awx that referenced this issue Oct 29, 2019
* Instance Groups Instances slider renders properly, and that list wraps properly.

* Instance Groups responds properly

* assorted container groups ui fixes
updated responsiveness of instance groups and instances list
fix layout of container group form
update help text for container group form elements
update text for tech preview top bar

* update container group doclink

* list styling updates based on feedback
AlanCoding pushed a commit to AlanCoding/awx that referenced this issue Oct 29, 2019
* Instance Groups Instances slider renders properly, and that list wraps properly.

* Instance Groups responds properly

* assorted container groups ui fixes
updated responsiveness of instance groups and instances list
fix layout of container group form
update help text for container group form elements
update text for tech preview top bar

* update container group doclink

* list styling updates based on feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0