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

Release v2.11.0 #7510

Merged
merged 19 commits into from
Feb 23, 2024
Merged

Release v2.11.0 #7510

merged 19 commits into from
Feb 23, 2024

Conversation

cvat-bot[bot]
Copy link
Contributor

@cvat-bot cvat-bot bot commented Feb 23, 2024

Added

Changed

Removed

Fixed

cvat-bot bot and others added 19 commits February 9, 2024 11:12
Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
This is a preparatory PR before I add more events.

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- ~~[ ] I have created a changelog fragment~~ <!-- see top comment in
CHANGELOG.md -->
- ~~[ ] I have updated the documentation accordingly~~
- ~~[ ] I have added tests to cover my changes~~
- ~~[ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~
- ~~[ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
By default failed rq jobs are kept for 1 year. It is too long and leads
to keeping a lot of unnecessary results in Redis.
…ansaction (#7460)

Non-database actions like deleting directories, sending webhooks,
scheduling reports should only be done after the current transaction is
committed. If we do it immediately, and the transaction is later
aborted, then we will have (for example) sent a webhook about an event
that didn't actually happen.

There's also a secondary benefit to moving this action outside of the
transaction; the less time we spend inside a transaction, the better,
since a transaction may lock out other clients from working on the
affected DB rows.

In addition, prevent the affected actions from crashing the view handler
with an exception (using the `robust=True` option). I don't think it's
reasonable to (for example) return a 500 response to a `PATCH` request
just because we failed to send the corresponding webhook.

There is one more type of action that should be modified in this way
(sending events), but it would be easier to do that after a refactoring
that I did in another patch, so I'll do it later.
Currently CVAT is just waiting for the database to start the server
process and the worker processes, but if redis instances (for queue and
cache processing) are not running we will get a non-functional cvat.
This PR adds availability checking for redis_ondisk and redis_inmem
This is a small addendum to #7460, which I couldn't include in that PR,
because it was blocked by #7430.
Currently, there are a lot of places where changing one object requires
updating the `updated_date` field on other objects. Usually, the `.save`
method is used for this purpose, which results in a generic SQL `UPDATE`
query that replaces the values in all columns.

Introduce and use a specialized method that only changes the date. This
provides the following advantages:

* Prevents the date updates from overwriting updates to other fields
that may happen at the same time.

* Possibly makes the updates more efficient due to fewer columns being
updated (I have no data on this, though).

* Makes it easier to recognize the purpose of the query when analyzing
logs/live statistics.

* Makes the purpose of the code more obvious.

Additionally, update `__save_job_handler`, where we don't want to save
_just_ the date, but we still only need to save two fields.
This can provide useful statistics on the use of this functionality.

Note that I chose to use the same scope for operations on projects,
tasks and jobs, because the import/export operations work more-or-less
the same on each of them and have the same parameters. It's still
possible to distinguish which type of object the operation was performed
on by examining the various `*_id` fields in the event.
Usage statistics on app.cvat.ai show that this format is rarely used,
with single-digit numbers of projects/tasks/jobs being exported or
imported using this format. Moreover, TensorFlow's popularity appears to
be shrinking, so I'm not expecting this format to make a comeback.

Meanwhile, supporting this format has a cost that has to be borne by
everyone deploying CVAT, because it requires TensorFlow to be installed
and loaded. This has various ill effects:

1. Loading time is increased. In my testing, even a command as trivial
   as `manage.py --help` is slowed down by 3.6 seconds. This may not seem
   like much, but the effect is compounded, because we have multiple
   processes (server + workers) all loading the same codebase. Plus, the
   container entrypoint may execute several Django commands.

2. Memory usage is increased. TensorFlow adds ~100MB of RAM usage per
   process with data alone; and the libraries add more (although it's hard
   to estimate the impact of library code, since it can be shared between
   processes in RAM).

3. Docker image size is increased by ~1.5GB (when unpacked). This is
   more than half of the current total size! Building time is increased as
   well.

Overall, it seems that the drawbacks of keeping support for this format
outweigh the benefits, so it's time to drop it.
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Merging #7510 (0a14ea5) into master (b4eed78) will decrease coverage by 0.07%.
Report is 11 commits behind head on master.
The diff coverage is 92.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7510      +/-   ##
==========================================
- Coverage   83.59%   83.52%   -0.07%     
==========================================
  Files         374      372       -2     
  Lines       39742    39666      -76     
  Branches     3731     3718      -13     
==========================================
- Hits        33223    33132      -91     
- Misses       6519     6534      +15     
Components Coverage Δ
cvat-ui 79.41% <91.66%> (-0.13%) ⬇️
cvat-server 87.31% <94.17%> (-0.03%) ⬇️

@cvat-bot cvat-bot bot merged commit a942f09 into master Feb 23, 2024
31 checks passed
@cvat-bot cvat-bot bot deleted the release-2.11.0 branch February 23, 2024 12:14
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.

6 participants