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

Fix logging in the TransT serverless function #6290

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Jun 12, 2023

Motivation and context

The Docker image for this function includes Conda, and uses conda run to run the Nuclio processor. Unfortunately, conda run buffers the entire output of the child process until that process exits, and since the processor never exits, its logs are never printed (and slowly consume memory).

Conda is actually completely useless here, so just get rid of it, which fixes the problem.

In addition, apply a few other improvements:

  • Synchronize the PyTorch and TransT versions between the CPU and GPU variants.

  • Replace opencv-python with opencv-python-headless, which has fewer dependencies.

  • Use the ADD command instead of wget.

Altogether, these improvements shave ~780 MB off the size of the CPU image (didn't check for the GPU one).

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have added a description of my changes into the CHANGELOG file
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@SpecLad SpecLad force-pushed the transt-conda branch 2 times, most recently from 8cacc2d to 66b1ea4 Compare June 12, 2023 08:33
@sizov-kirill
Copy link
Contributor

I've tested this patch on GPU, it works fine for me.

The Docker image for this function includes Conda, and uses `conda run` to
run the Nuclio processor. Unfortunately, `conda run` buffers the entire output
of the child process until that process exits, and since the processor never exits,
its logs are never printed (and slowly consume memory).

Conda is actually completely useless here, so just get rid of it, which fixes
the problem.

In addition, apply a few other improvements:

* Synchronize the PyTorch and TransT versions between the CPU and GPU
  variants.

* Replace `opencv-python` with `opencv-python-headless`, which has fewer
  dependencies.

* Use the `ADD` command instead of wget.

Altogether, these improvements shave ~780 MB off the size of the CPU image
(didn't check for the GPU one).
@SpecLad SpecLad marked this pull request as ready for review June 13, 2023 15:40
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Merging #6290 (cf3efbf) into develop (e8a31b8) will increase coverage by 5.36%.
The diff coverage is n/a.

❗ Current head cf3efbf differs from pull request most recent head ed04e29. Consider uploading reports for the commit ed04e29 to get more accurate results

@@             Coverage Diff             @@
##           develop    #6290      +/-   ##
===========================================
+ Coverage    73.14%   78.50%   +5.36%     
===========================================
  Files          320      320              
  Lines        37249    37249              
  Branches      6748     6748              
===========================================
+ Hits         27244    29243    +1999     
+ Misses        9725     7725    -2000     
- Partials       280      281       +1     
Components Coverage Δ
cvat-ui 74.63% <ø> (+11.27%) ⬆️
cvat-server 82.02% <ø> (ø)

@SpecLad SpecLad merged commit c253809 into cvat-ai:develop Jun 14, 2023
@SpecLad SpecLad deleted the transt-conda branch June 14, 2023 10:04
@azhavoro azhavoro mentioned this pull request Jun 16, 2023
bsekachev added a commit that referenced this pull request Jun 16, 2023
## \[2.4.7] - 2023-06-16
### Added
- \[API\] API Now supports the creation and removal of Ground Truth
jobs. (<#6204>)
- \[API\] We've introduced task quality estimation endpoints.
(<#6204>)
- \[CLI\] An option to select the organization.
(<#6317>)

### Fixed
- Issues with running serverless models for EXIF-rotated images.
(<#6275>)
- File uploading issues when using https configuration.
(<#6308>)
- Dataset export error with `outside` property of tracks.
(<#5971>)
- Broken logging in the TransT serverless function.
(<#6290>)

---------

Co-authored-by: Anastasia Yasakova <yasakova_anastasiya@mail.ru>
Co-authored-by: Mariia Acoca <39969264+mdacoca@users.noreply.github.com>
Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
Co-authored-by: klakhov <kirill.9992@gmail.com>
Co-authored-by: Roman Donchenko <roman@cvat.ai>
Co-authored-by: Kirill Sizov <kirill.sizov@cvat.ai>
Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
Co-authored-by: Paweł Kotiuk <kotiuk@zohomail.eu>
Co-authored-by: Nikita Manovich <nikita@cvat.ai>
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.

3 participants