Skip to content

Commit

Permalink
Merge pull request #1135 from golemfactory/0.10-to-master
Browse files Browse the repository at this point in the history
0.10 to master
  • Loading branch information
shadeofblue committed Jun 13, 2023
2 parents 3573e7f + 7f66a21 commit 43f0d79
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 187 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.9'
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.2.2
- run: poetry install
- run: poetry run poe tests_unit
- run: poetry run poe checks_codestyle
Expand All @@ -32,10 +30,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.9'
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.2.2
- name: Get git release tag
run: echo "git-release-tag=yapapi $(git describe --tags)" >> $GITHUB_OUTPUT
id: git_describe
Expand Down Expand Up @@ -65,10 +61,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.9'
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.2.2
- name: Retrieve the built package
uses: actions/download-artifact@v2
with:
Expand All @@ -89,10 +83,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.9'
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.2.2
- name: Retrieve the built package
uses: actions/download-artifact@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/goth-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
- name: Configure python
uses: actions/setup-python@v4
with:
python-version: '3.8.0'
python-version: '3.9'

- name: Install and configure Poetry
run: python -m pip install -U pip setuptools poetry==1.3.2

- name: Install dependencies
run: |
poetry env use python3.8
poetry env use python3.9
poetry install
- name: Disconnect Docker containers from default network
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
# Python version below should agree with the version set up by this job.
# In future we'll be able to use the `--all` flag here to remove envs for
# all Python versions (https://github.com/python-poetry/poetry/issues/3208).
run: poetry env remove python3.8
run: poetry env remove python3.9

- name: Send Discord notification on failure
uses: Ilshidur/action-discord@0.3.2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/goth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
- name: Configure python
uses: actions/setup-python@v4
with:
python-version: '3.8.0'
python-version: '3.9'

- name: Install and configure Poetry
run: python -m pip install -U pip setuptools poetry==1.3.2

- name: Install dependencies
run: |
poetry env use python3.8
poetry env use python3.9
poetry install
- name: Disconnect Docker containers from default network
Expand Down Expand Up @@ -85,4 +85,4 @@ jobs:
# Python version below should agree with the version set up by this job.
# In future we'll be able to use the `--all` flag here to remove envs for
# all Python versions (https://github.com/python-poetry/poetry/issues/3208).
run: poetry env remove python3.8
run: poetry env remove python3.9
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.2.2

- run: echo "ENABLE=1" >> $GITHUB_OUTPUT
if: ${{ matrix.os == 'ubuntu-latest' }}
name: Enable extended checks
id: extended-checks
- run: echo "ENABLE=1" >> $GITHUB_OUTPUT
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
name: Enable sphinx check
id: extended-checks-sphinx

Expand Down
2 changes: 1 addition & 1 deletion examples/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def build_parser(description: str) -> argparse.ArgumentParser:
"--payment-driver", "--driver", help="Payment driver name, for example `erc20`"
)
parser.add_argument(
"--payment-network", "--network", help="Payment network name, for example `rinkeby`"
"--payment-network", "--network", help="Payment network name, for example `goerli`"
)
parser.add_argument("--subnet-tag", help="Subnet name, for example `public`")
parser.add_argument(
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.8"

setuptools = [
{ version = "*", python = ">=3.8" },
]
aiohttp = "^3.6"
aiohttp-sse-client = "^0.1.7"
dataclasses = { version = "^0.8", python = ">=3.6, <3.7" }
Expand All @@ -44,10 +41,13 @@ attrs = ">=19.3"
Deprecated = "^1.2.12"
python-statemachine = "^0.8.0"

setuptools = "*"
pip = "*"

# Docs
sphinx = { version = "^4.0.1", optional = true }
sphinx-autodoc-typehints = { version = "^1.12.0", optional = true }
sphinx-rtd-theme = { version = "^1.0.0", optional = true }
sphinx-rtd-theme = { version = "^1.0.0", optional = true}

[tool.poetry.extras]
docs = ['sphinx', 'sphinx-autodoc-typehints', 'sphinx-rtd-theme']
Expand Down
1 change: 1 addition & 0 deletions tests/goth_tests/___test_resubscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ async def worker(work_ctx, tasks):
async with Golem(
budget=10.0,
event_consumer=monitor.add_event_sync,
payment_network="rinkeby",
) as golem:
task: Task # mypy needs this for some reason
async for task in golem.execute_tasks(
Expand Down
1 change: 1 addition & 0 deletions tests/goth_tests/test_agreement_termination/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ async def worker(ctx: WorkContext, tasks):
async with Golem(
budget=10.0,
subnet_tag="goth",
payment_network="rinkeby",
) as golem:
tasks = [Task(data=n) for n in range(6)]
async for task in golem.execute_tasks(
Expand Down
1 change: 1 addition & 0 deletions tests/goth_tests/test_async_task_generation/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async def worker(work_ctx, tasks):
budget=10.0,
subnet_tag="goth",
event_consumer=log_event_repr,
payment_network="rinkeby",
) as golem:
# We use an async task generator that yields tasks removed from
# an async queue. Each computed task will potentially spawn
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_concurrent_executors/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def duplicator(work_ctx, tasks):
output = result.stdout.strip()
task.accept_result(output)

async with Golem(budget=1.0, subnet_tag="goth") as golem:
async with Golem(budget=1.0, subnet_tag="goth", payment_network="rinkeby") as golem:
# Construct a pipeline:
#
# input_tasks
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_instance_restart/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def shutdown(self):


async def main():
async with Golem(budget=1.0, subnet_tag="goth") as golem:
async with Golem(budget=1.0, subnet_tag="goth", payment_network="rinkeby") as golem:
# Start a cluster with a single service.
# The first instance will fail before reaching the `running` state
# due to an error. Another instance should be spawned in its place.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async def main():
strategy=ShortDebitNoteIntervalAndPaymentTimeout(),
subnet_tag="goth",
event_consumer=log_event_repr,
payment_network="rinkeby",
) as golem:
logger = logging.getLogger("yapapi")
logger.handlers[0].setLevel(logging.DEBUG)
Expand Down
1 change: 1 addition & 0 deletions tests/goth_tests/test_multiactivity_agreement/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async def worker(work_ctx, tasks):
budget=10.0,
subnet_tag="goth",
event_consumer=log_event_repr,
payment_network="rinkeby",
) as golem:
tasks = [Task(data=n) for n in range(3)]
async for task in golem.execute_tasks(
Expand Down
3 changes: 2 additions & 1 deletion tests/goth_tests/test_power_outage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ async def test_power_outage(
provider_1 = runner.get_probes(probe_type=ProviderProbe)[0]

async with requestor.run_command_on_host(
"{} --subnet-tag goth --min-cpu-threads 1 --log-file {}".format(
"{} --subnet-tag goth --min-cpu-threads 1 "
"--payment-network rinkeby --log-file {}".format(
blender_path, log_dir / "test_power_outage.log"
),
env=os.environ,
Expand Down
1 change: 1 addition & 0 deletions tests/goth_tests/test_recycle_ip/ssh_recycle_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ async def main():
async with Golem(
budget=1.0,
subnet_tag="goth",
payment_network="rinkeby",
) as golem:
network = await golem.create_network("192.168.0.1/24")
proxy = SocketProxy(ports=[2222])
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_run_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def test_run_blender(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{blender_path} --subnet-tag goth --min-cpu-threads 1",
f"{blender_path} --subnet-tag goth --min-cpu-threads 1 --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, _process_monitor):
# Add assertions to the command output monitor `cmd_monitor`:
Expand Down
3 changes: 2 additions & 1 deletion tests/goth_tests/test_run_custom_usage_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ async def test_run_custom_usage_counter(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --running-time {RUNNING_TIME} --subnet-tag {SUBNET_TAG}",
f"{requestor_path} --running-time {RUNNING_TIME} "
f"--subnet-tag {SUBNET_TAG} --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, _process_monitor):
cmd_monitor.add_assertion(assert_no_errors)
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_run_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def test_run_scan(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --subnet-tag {SUBNET_TAG} --scan-size 3",
f"{requestor_path} --subnet-tag {SUBNET_TAG} --scan-size 3 --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, process_monitor):
cmd_monitor.add_assertion(assert_no_errors)
Expand Down
3 changes: 2 additions & 1 deletion tests/goth_tests/test_run_simple_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ async def test_run_simple_service(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --running-time {RUNNING_TIME} --subnet-tag {SUBNET_TAG}",
f"{requestor_path} --running-time {RUNNING_TIME} "
f"--subnet-tag {SUBNET_TAG} --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, _process_monitor):
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_run_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def test_run_ssh(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --subnet-tag {SUBNET_TAG}",
f"{requestor_path} --subnet-tag {SUBNET_TAG} --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, process_monitor):
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_run_webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def test_run_webapp(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --subnet-tag {SUBNET_TAG} --port {port}",
f"{requestor_path} --subnet-tag {SUBNET_TAG} --port {port} --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, process_monitor):
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion tests/goth_tests/test_run_yacat.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def test_run_yacat(
async with requestor.run_command_on_host(
f"{yacat_path} --mask ?a?a --hash $P$5ZDzPE45CigTC6EY4cXbyJSLj/pGee0 "
f"--subnet-tag goth --chunk-size {CHUNK_SIZE} --max-workers {PROVIDER_COUNT} "
f"--log-file {(log_dir / logfile).resolve()}",
f"--log-file {(log_dir / logfile).resolve()} --payment-network rinkeby",
env=os.environ,
) as (_cmd_task, cmd_monitor, _process_monitor):
# Add assertions to the command output monitor `cmd_monitor`:
Expand Down
Loading

0 comments on commit 43f0d79

Please sign in to comment.