Task #1488
closedDeprecate nodes
Added by bmbouter almost 9 years ago. Updated over 5 years ago.
100%
Description
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[0].
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
[0]: http://pulp.readthedocs.org/en/latest/user-guide/nodes.html
Related issues
Updated by mhrivnak almost 9 years ago
- Priority changed from High to Normal
- Severity changed from 3. High to 2. Medium
- Platform Release deleted (
2.8.0) - Triaged changed from No to Yes
Updated by mhrivnak almost 9 years ago
- Tracker changed from Issue to Task
- Groomed set to Yes
- Sprint Candidate set to Yes
Updated by amacdona@redhat.com about 8 years ago
- Sprint Candidate changed from No to Yes
Updated by jortel@redhat.com about 8 years ago
- Sprint/Milestone changed from 27 to 28
Updated by ipanova@redhat.com about 8 years ago
- Assignee deleted (
daviddavis) - Sprint/Milestone changed from 28 to 29
Updated by daviddavis about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by daviddavis almost 8 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[0]. 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.
Updated by daviddavis almost 8 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[0] by adding something like:
warnings.simplefilter('always', DeprecationWarning)
I'm not sure how to tell though when we're in a dev setup. Maybe we could add a deprecation config variable?
Updated by bmbouter almost 8 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-admin
and 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.
Updated by daviddavis almost 8 years ago
- Blocks Task #2460: Write a blog post about nodes being deprecated and what functionality users can use to replace them added
Updated by daviddavis almost 8 years ago
Went ahead and opened a separate issue to address creating a blog post after this issue is closed out:
Updated by daviddavis almost 8 years ago
bmbouter, you mentioned that we previously deprecated nodes in a release of pulp but looking through the docs/user-guide/release-notes directory of pulp, I am not seeing it. Do you remember the release?
Updated by daviddavis almost 8 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[18247]: 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[18247]: 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.
Updated by bmbouter almost 8 years ago
@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.
Updated by bmbouter almost 8 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!
Updated by daviddavis almost 8 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:
Updated by bmbouter almost 8 years ago
I think the fact that [0] is called by [1] is fine because [1] is the publish repo inside of the pulp_node package so I expect [1] is only called for node calls.
Regarding [2], 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.
[0]: https://git.io/v10R2
[1]: https://git.io/v10RM
[2]: https://git.io/v10R9
Added by daviddavis almost 8 years ago
Added by daviddavis almost 8 years ago
Revision 490203cf | View on GitHub
Deprecate Pulp nodes
Update the documentation and release notes to indicate that nodes are deprecated. Also, add warnings in the parent/child tasks and CLI commands.
Updated by daviddavis almost 8 years ago
- Status changed from ASSIGNED to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|490203cfe117568aefdca982c64971bc4ef4e814.
Updated by semyers almost 8 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Deprecate Pulp nodes
Update the documentation and release notes to indicate that nodes are deprecated. Also, add warnings in the parent/child tasks and CLI commands.
fixes #1488 https://pulp.plan.io/issues/1488