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

async implementation #10

Merged
merged 34 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
efb8d17
WIP: first async draft
d70-t Sep 15, 2021
20b44ce
adding async dependencies
d70-t Sep 15, 2021
a558efa
upgrade local ipfs version
d70-t Sep 15, 2021
7955c5b
increase udp read buffer size
d70-t Sep 15, 2021
fba2cb6
CI: wait for IPFS daemon to start
d70-t Sep 15, 2021
0dc8012
disabled workflows using remote gateways
d70-t Sep 15, 2021
c293512
use sudo to increase UDP memory
d70-t Sep 15, 2021
d2a857d
return FileNotFound also for paths without CID
d70-t Sep 21, 2021
341b119
added open() for async filesystem
d70-t Sep 21, 2021
6ec7f94
return CID as ukey
d70-t Sep 21, 2021
c91dd1a
cleanup
d70-t Sep 21, 2021
36406a7
flake8
d70-t Sep 21, 2021
a152990
ship IPFS testdata as car
d70-t Sep 21, 2021
2e7758d
CI: change back directory
d70-t Sep 21, 2021
9e77a2f
Merge branch 'master' into async
d70-t Oct 27, 2021
bdf0bfd
async: added gateway switching facility
d70-t Nov 17, 2021
817e87e
Merge branch 'main' into async
d70-t Mar 9, 2022
2be1e7c
refactor: separated AsyncIPFSGatewayBase
d70-t Mar 9, 2022
5f92fc1
async: added MultiGateway
d70-t Mar 10, 2022
cd27711
refactor async tests: use session fixture
d70-t Mar 10, 2022
2a8da0c
async: enable backoff
d70-t Mar 11, 2022
b6b7d41
make the async implementation the default
d70-t Mar 11, 2022
9fb6159
async: improved retry algorithm
d70-t Mar 11, 2022
42598a0
CI: run tests with only default gateways
d70-t Mar 11, 2022
65fd970
CI: enable more tests
d70-t Mar 11, 2022
c6854bc
CI: enable tests without local gateway
d70-t Mar 11, 2022
6186044
CI: require pytest-asyncio for all tests
d70-t Mar 11, 2022
7aa6096
handle ClientResponseErrors as backoff reason
d70-t Mar 11, 2022
6548cad
pytest: register local_gw marker
d70-t Mar 11, 2022
2d4ea48
async: handle TimeoutError
d70-t Mar 11, 2022
3af9cb3
reduced complexity of _gw_op
d70-t Mar 11, 2022
8473960
async: raise RequestsTooQuick within AsyncIPFSGateway
d70-t Mar 11, 2022
5286e26
async: schedule next request earlier to actually delay async requests
d70-t Mar 11, 2022
5c9bca4
async: enable retry logic also for response bodies
d70-t Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/default_gateways.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test without local gateway

on: [push]

jobs:
test:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest pytest-asyncio
pytest -m "not local_gw"
17 changes: 12 additions & 5 deletions .github/workflows/local_gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
ipfs-version: ["0.8.0"]
python-version: ["3.8", "3.9", "3.10"]
ipfs-version: ["0.12.0"]
include:
- python-version: "3.10"
ipfs-version: "0.9.1"
env:
IPFSSPEC_GATEWAYS: "http://127.0.0.1:8080" # use only localhost as gateway
steps:
Expand All @@ -27,12 +30,16 @@ jobs:
run: |
wget https://dist.ipfs.io/go-ipfs/v${{ matrix.ipfs-version }}/go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
tar -xvzf go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
cd go-ipfs
pushd go-ipfs
sudo bash install.sh
sudo sysctl -w net.core.rmem_max=2500000
popd
ipfs --version
ipfs init --profile server
ipfs daemon > ipfs.log &
ipfs daemon 2>ipfs.log | grep -i -o -m1 'Daemon is ready' & tail -f --pid=$! ipfs.log
ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme
ipfs dag import test/testdata.car
- name: Test with pytest
run: |
pip install pytest
pip install pytest pytest-asyncio
pytest
6 changes: 4 additions & 2 deletions ipfsspec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from .core import IPFSFileSystem
from .async_ipfs import AsyncIPFSFileSystem
from fsspec import register_implementation

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
# register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
register_implementation(AsyncIPFSFileSystem.protocol, AsyncIPFSFileSystem)

__all__ = ["__version__", "IPFSFileSystem"]
__all__ = ["__version__", "IPFSFileSystem", "AsyncIPFSFileSystem"]
Loading