Based on multiple discussions nodes support is being deprecated with 2.8.0. As such we need to take a few steps to properly deprecate it. See the checklist for details. The nodes docs they refer to are here.
NOTE: with DeprecationWarning we need to ensure they are having the effect we think they are. Two things to consider/test:
- In Python 2.6 DeprecationWarning was loud by default, but has been silenced in 2.7+.
- The -W argument (iirc) enables/disables warnings so that could be a meaningful difference between a dev and production environment
#14 Updated by daviddavis over 3 years ago
- Checklist item log in the foreground a banner output indicating deprecation for any pulp-admin command starting with `pulp-admin node` set to Done
- Checklist item Add a deprecation banner to the top of the nodes docs suggesting that users do a natural sync instead set to Done
- Checklist item log in the foreground a deprecation notice for any pulp node consumer command set to Done
#17 Updated by daviddavis about 3 years ago
What should I do about node calls that rely on code that's not specific to nodes? For example, when I call node sync on the parent, it looks like the server just creates a consumer update_content task. I may be mistaken but it looks like this task isn't specific to nodes (at least for the parent—on the child, there is some node specific importer code).
I could either:
1. Add code to pulp core and check if the consumer is a node and then display a warning message
2. Not worry about showing a deprecation warning when code not specific to nodes (but used by nodes) is called.
I'm kind of leaning toward option 2 as I had hoped to keep this change limited to nodes directory.
#18 Updated by daviddavis about 3 years ago
As mentioned in the bug description, it does indeed look like DeprecationWarning is silenced by default in 2.7. One option would be to run python with '-W all' or something similar in dev mode. I'm not sure exactly where/how to configure this flag though?
Also, we could update the logging code by adding something like:
I'm not sure how to tell though when we're in a dev setup. Maybe we could add a deprecation config variable?
#19 Updated by bmbouter about 3 years ago
I think we should not add the -W and instead use the
warnings.simplefilter as you suggest. Adding that to the logging setup code would set that for all server side processes, but you'll also have to add it for
pulp-consumer. Those standalone, client-side binaries don't use the logging code.
In terms of the shared codepaths, I also prefer option 2 where we only add deprecation warnings to code that we know is node specific. Overall I believe for each server side processes (daemon processes) having at least 1 deprecation warning logged for each node operation (sync, publish) would be good. Also for interactive processes (pulp-admin, pulp-consumer) having at least 1 deprecation warning shown in the foreground for each node operation would be good.
#22 Updated by daviddavis about 3 years ago
- Checklist item deleted (
Create a blog post showing how to sync content between pulp instances)
- Checklist item deleted (
Email the pulp mailing list to announce nodes are being removed)
Went ahead and opened a separate issue to address creating a blog post after this issue is closed out:
#24 Updated by daviddavis about 3 years ago
So turning on logging for deprecation warnings is spitting out tons of deprecation warnings in places we don't control like:
Dec 02 09:06:35 dev.example.com pulp: py.warnings:WARNING: (18247-87552) /usr/lib/python2.7/site-packages/mongoengine/queryset/base.py:461: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead. Dec 02 09:06:35 dev.example.com pulp: py.warnings:WARNING: (18247-87552) upsert=upsert, **write_concern)
This is from mongoengine calling update which pymongo deprecated: https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/collection.py#L2482-L2483
I'm not sure if we want or care about these messages? Another alternative is to define a new deprecation warning like NodeDeprecationWarning and just turn on those.
#25 Updated by bmbouter about 3 years ago
- Checklist item add a big deprecation note in the nodes documentation page (docs/user-guide/nodes.rst) added
@daviddavis, I thought we had deprecated nodes in an earlier release, but in searching for the details, I see that we have not declared it deprecated. It looks like the release note checklist item you are doing will be the official nodes deprecation. I've added another checklist item to add a big deprecation note on the nodes.rst page.
#26 Updated by bmbouter about 3 years ago
Let's not enable all deprecation warnings. I really like the idea of declaring a NodeDeprecationWarning and just enabling that one.
Does it make any sense to write a blog post about nodes being deprecated with 2.12 and giving specific recommendations for how users can switch from nodes to a natural sync? I think that would be good. We could link to that blog post from the deprecation statement in the release notes and on nodes.rst pages. That should either become a checklist item or its own task. I think doing it all as 1 task would be good. Whatever you decide, would you be willing to track that work (as checklist item or its own task)?
FYI, here is a draft post on writing blog posts that @dkliban is working on: https://github.com/pulp/pulpproject.org/pull/29
Thank you for doing all of this, it's a big job!
#30 Updated by daviddavis about 3 years ago
Adding in deprecation warnings to the parent/child code is kind of tricky because there are often multiple places where I can add them. For example, when I bind a repo to a node, we could add a deprecation warning here:
But it looks like this also gets called:
Also it looks like there are places in the code that I am not sure how to reach. Here's an example:
#31 Updated by bmbouter about 3 years ago
I think the fact that  is called by  is fine because  is the publish repo inside of the pulp_node package so I expect  is only called for node calls.
Regarding , I believe the platform will call that when a orphan delete occurs. The platform would be running an orphan delete celery task through the node workflow. @jortel could confirm this I think.
Please register to edit this issue