Skip to content

Commit bea4967

Browse files
authored
Merge pull request #187 from coreweave/eta/signature-v4
fix(stream_io): Default to signature version 4 for most object storage endpoints
2 parents 915e2ec + 7ee094a commit bea4967

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Build & push docker image
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

1515
- name: 'Login to GitHub Container Registry'
1616
uses: docker/login-action@v1

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ on:
77
jobs:
88
build_dist:
99
name: Build distribution on Ubuntu
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313

14-
- uses: actions/setup-python@v3
14+
- uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.8'
16+
python-version: '3.10'
1717

1818
- name: Install build dependencies
1919
run: python -m pip install --no-cache-dir -U setuptools build
@@ -28,7 +28,7 @@ jobs:
2828
upload_dist:
2929
needs: [ build_dist ]
3030
name: Upload distribution to PyPI
31-
runs-on: ubuntu-20.04
31+
runs-on: ubuntu-22.04
3232
if: github.event_name == 'release' && github.event.action == 'published'
3333
steps:
3434
- uses: actions/download-artifact@v3

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on: [push, pull_request]
55
jobs:
66
run_tests:
77
name: Run tests
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1111

12-
- uses: actions/setup-python@v3
12+
- uses: actions/setup-python@v5
1313
with:
14-
python-version: '3.8'
14+
python-version: '3.10'
1515
cache: 'pip'
1616

1717
- name: Install dependencies

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
[2.9.3] - 2025-05-09
9+
10+
### Changed
11+
12+
- `stream_io.open_stream()` now defaults to authenticating with signature
13+
version 4 rather than signature version 2 when no `s3_signature_version`
14+
is specified for reads from most object storage endpoints
15+
816
[2.9.2] - 2025-02-20
917

1018
### Fixed
@@ -416,6 +424,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
416424
- `get_gpu_name`
417425
- `no_init_or_tensor`
418426

427+
[2.9.3]: https://github.com/coreweave/tensorizer/compare/v2.9.2...v2.9.3
419428
[2.9.2]: https://github.com/coreweave/tensorizer/compare/v2.9.1...v2.9.2
420429
[2.9.1]: https://github.com/coreweave/tensorizer/compare/v2.9.0...v2.9.1
421430
[2.9.0]: https://github.com/coreweave/tensorizer/compare/v2.8.1...v2.9.0

tensorizer/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.9.2"
1+
__version__ = "2.9.3"

tensorizer/stream_io.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,9 @@ def _s3_download_url(
978978
s3_signature_version: Optional[str] = None,
979979
) -> str:
980980
bucket, key = _parse_s3_uri(path_uri)
981-
# v2 signature is important to easily align the presigned URL expiry
982-
# times. This allows multiple clients to generate the exact same
981+
# v2 signature is important with accel-object
982+
# to easily align the presigned URL expiry times.
983+
# This allows multiple clients to generate the exact same
983984
# presigned URL, and get hits on a HTTP caching proxy.
984985
#
985986
# why v2 signature?
@@ -989,7 +990,8 @@ def _s3_download_url(
989990
# See upstream bug https://github.com/boto/botocore/issues/2230
990991
#
991992
if not s3_signature_version:
992-
s3_signature_version = "s3"
993+
is_accel: bool = "accel-object" in s3_endpoint.lower().split(".")
994+
s3_signature_version = "s3" if is_accel else "v4"
993995
client = _new_s3_client(
994996
s3_access_key_id,
995997
s3_secret_access_key,

0 commit comments

Comments
 (0)