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(controller): prevent closing input in aliyun oss #1791

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

jialeicui
Copy link
Contributor

@jialeicui jialeicui commented Feb 7, 2023

Description

aliyun oss sdk will close the original input stream at the end of the put.

https://github.com/aliyun/aliyun-oss-java-sdk/blob/10727ab9f79efa2a4f2c7fbec348e44c04dd6c42/src/main/java/com/aliyun/oss/common/comm/ServiceClient.java#L89

This makes the uploading of the model fail in this block

TarFileUtil.extract(inputStream, (name, size, in) ->
        storageAccessService.put(
                String.format(FORMATTER_STORAGE_SRC_FILE_PATH, storagePath, name), in, size
        )
);

Modules

  • UI
  • Controller
  • Agent
  • Client
  • Python-SDK
  • Others

Checklist

  • run code format and lint check
  • add unit test
  • add necessary doc

@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #1791 (b744d01) into main (5708997) will decrease coverage by 8.20%.
The diff coverage is 52.17%.

@@             Coverage Diff              @@
##               main    #1791      +/-   ##
============================================
- Coverage     82.14%   73.95%   -8.20%     
- Complexity     1961     1965       +4     
============================================
  Files           354      276      -78     
  Lines         18968     9418    -9550     
  Branches       1037     1037              
============================================
- Hits          15582     6965    -8617     
+ Misses         2952     2020     -932     
+ Partials        434      433       -1     
Flag Coverage Δ
controller 73.95% <52.17%> (-0.04%) ⬇️
standalone ?
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tarwhale/mlops/datastore/impl/MemoryTableImpl.java 89.59% <0.00%> (ø)
.../starwhale/mlops/storage/NopCloserInputStream.java 44.44% <44.44%> (ø)
...in/java/ai/starwhale/mlops/common/TarFileUtil.java 45.88% <100.00%> (+0.09%) ⬆️
...ops/storage/aliyun/StorageAccessServiceAliyun.java 78.57% <100.00%> (+0.38%) ⬆️
client/starwhale/api/evaluation.py
client/starwhale/core/model/store.py
client/starwhale/core/model/default_handler.py
client/starwhale/core/dataset/copy.py
client/starwhale/base/store.py
... and 75 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@anda-ren anda-ren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jialeicui jialeicui merged commit 175a290 into star-whale:main Feb 7, 2023
@jialeicui jialeicui deleted the mp-aliyun branch February 7, 2023 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working controller 🏘️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants