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

Use parametrized os value in workflow #1394

Merged
merged 10 commits into from
Sep 30, 2022
Merged

Conversation

Adamantios
Copy link
Collaborator

Proposed changes

Uses the parametrized os value introduced in #1389.

Fixes

n/a

Types of changes

What types of changes does your code introduce? (A breaking change is a fix or feature that would cause existing functionality and APIs to not work as expected.)
Put an x in the box that applies

  • Non-breaking fix (non-breaking change which fixes an issue)
  • Breaking fix (breaking change which fixes an issue)
  • Non-breaking feature (non-breaking change which adds functionality)
  • Breaking feature (breaking change which adds functionality)
  • Refactor (non-breaking change which changes implementation)
  • Messy (mixture of the above - requires explanation!)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have locally run services that could be impacted and they do not present failures derived from my changes

Further comments

n/a

@Adamantios
Copy link
Collaborator Author

Adamantios commented Sep 26, 2022

We had forgotten to use the parametrized os' value. Now CI fails because we are using ubuntu-specific installation commands.

We temporarily mark this PR as a draft and will tackle this later.

@Adamantios Adamantios marked this pull request as draft September 26, 2022 10:16
@Adamantios Adamantios force-pushed the chore/parametrize-lock-os branch 5 times, most recently from 620398b to f9dad99 Compare September 29, 2022 13:06
Comment on lines -29 to -31
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These were not necessary for the job.

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that occassionally an outdated dependency can lead to issues with them not being present.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Though why would we add this in the workflow if this does not affect the CI?

Comment on lines -21 to +20
docker = "==5.0.2"
docker = "==6.0.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update docker to avoid conflict with pywin32 on Windows.

@@ -11,14 +11,13 @@ open-aea-cli-ipfs = "==1.20.0"

[dev-packages]
asn1crypto = "==1.4.0"
atheris = "==2.0.11"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove the atheris dependency because it is not supported on Windows.

The options would be to:

  1. Add atheris in the setup.py with a condition to install only if not on Windows. This however would add an unnecessary dependency to our framework.
  2. Replace pipenv with poetry which supports "environment markers" and install dev dependency only if not on Windows. We could do this if we reopen [WIP] Chore/poetry #93.
  3. Remove the dependency and let the dev install it if needed. This does not cause any issues since we already have the following logic in the fuzzy tests:
try:
    import atheris  # type: ignore
except (ImportError, ModuleNotFoundError):
    pytestmark = pytest.mark.skip

The best option, for now, would be (3.).

Comment on lines +93 to +96
> :information_source: Note: we are using [atheris](https://github.com/google/atheris) in order to perform fuzzy testing.
> The dependency is not listed in the `Pipfile` because it is not supported on Windows.
> If you need to run or implement a fuzzy test, please manually install the dependency.
> If you are developing on Mac, please follow the extra steps described [here](https://github.com/google/atheris#mac).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added clarification re the atheris dependency.

setup.py Outdated
Comment on lines 52 to 68
def _get_docker_dependency() -> str:
"""
Get the `docker-py` dependency, according to the underlying platform.

If on Windows, we need to install the cutting-edge package version of `docker` directly from the GitHub repository;
as the PyPI distribution of `docker` causes the following conflict:

docker 5.0.3 depends on pywin32==227; sys_platform == "win32"
open-aea[all] 1.20.0 depends on pywin32==304

Instead, at commit docker/docker-py@3f0095a, `setup.py` has an extra that forces pywin32>=304.
"""
return (
"docker==5.0.3"
if platform.system() != "Windows"
else "docker @ git+https://github.com/docker/docker-py.git@3f0095a7c1966c521652314e524ff362c24ff58c"
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not necessary since we updated docker.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above

We do this in order to avoid a conflict with `pywin32` on Windows.
It is not supported on Windows, and we also have this logic in our fuzzy tests:

```python
try:
    import atheris  # type: ignore
except (ImportError, ModuleNotFoundError):
    pytestmark = pytest.mark.skip
```

Therefore, the best option for now would be to manually install `atheris` if needed.
No need to manually install python on Windows anymore (5172f47) since we are using `actions/setup-python@master`.
@codecov
Copy link

codecov bot commented Sep 30, 2022

Codecov Report

Base: 92.73% // Head: 92.73% // No change to project coverage 👍

Coverage data is based on head (38e9505) compared to base (218df30).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1394   +/-   ##
=======================================
  Coverage   92.73%   92.73%           
=======================================
  Files          55       55           
  Lines        2146     2146           
=======================================
  Hits         1990     1990           
  Misses        156      156           
Flag Coverage Δ
unittests 92.73% <ø> (ø)

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

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Adamantios
Copy link
Collaborator Author

Adamantios commented Sep 30, 2022

Failing test on macos reports:

Unreliable test timings! On an initial run, this test took 4940.30ms, which exceeded the deadline of 2000.00ms, but on a subsequent run it took 6.89 ms, which did not. If you expect this sort of variability in your test timings, consider turning deadlines off for this test by setting deadline=None.

I think this variability is expected @Karrenbelt. Let's increase the deadline for hypothesis.

Failing TestABCIAPYEstimationSingleAgent e2e caused by #1168.

Comment on lines -29 to -31
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that occassionally an outdated dependency can lead to issues with them not being present.

base_deps = [
"open-aea[all]>=1.20.0,<2.0.0",
"pytest==7.0.0",
"open-aea-ledger-ethereum==1.20.0",
_get_docker_dependency(),
"docker==6.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

@angrybayblade is that compatible with the rest of the plugins etc?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, it would be nice if we can use a range instead of a strict version specifier

Copy link
Collaborator Author

@Adamantios Adamantios Sep 30, 2022

Choose a reason for hiding this comment

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

Please update this as well

I have:

"docker==6.0.0",

Also, it would be nice if we can use a range instead of a strict version specifier

We can't:
#1394 (comment)

setup.py Outdated
Comment on lines 52 to 68
def _get_docker_dependency() -> str:
"""
Get the `docker-py` dependency, according to the underlying platform.

If on Windows, we need to install the cutting-edge package version of `docker` directly from the GitHub repository;
as the PyPI distribution of `docker` causes the following conflict:

docker 5.0.3 depends on pywin32==227; sys_platform == "win32"
open-aea[all] 1.20.0 depends on pywin32==304

Instead, at commit docker/docker-py@3f0095a, `setup.py` has an extra that forces pywin32>=304.
"""
return (
"docker==5.0.3"
if platform.system() != "Windows"
else "docker @ git+https://github.com/docker/docker-py.git@3f0095a7c1966c521652314e524ff362c24ff58c"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above

# Conflicts:
#	autonomy/constants.py
#	docs/autonomy.md
#	docs/counter_example.md
#	docs/guides/quick_start.md
#	docs/package_list.md
#	docs/price_oracle_intro.md
#	docs/simple_abci.md
#	packages/packages.json
#	packages/valory/agents/abstract_abci/aea-config.yaml
#	packages/valory/agents/apy_estimation/aea-config.yaml
#	packages/valory/agents/counter/aea-config.yaml
#	packages/valory/agents/hello_world/aea-config.yaml
#	packages/valory/agents/oracle/aea-config.yaml
#	packages/valory/agents/register_reset/aea-config.yaml
#	packages/valory/agents/registration_start_up/aea-config.yaml
#	packages/valory/agents/simple_abci/aea-config.yaml
#	packages/valory/agents/test_abci/aea-config.yaml
#	packages/valory/services/apy_estimation/service.yaml
#	packages/valory/services/apy_estimation_hardhat/service.yaml
#	packages/valory/services/counter/service.yaml
#	packages/valory/services/hello_world/service.yaml
#	packages/valory/services/oracle_goerli/service.yaml
#	packages/valory/services/oracle_hardhat/service.yaml
#	packages/valory/services/oracle_polygon/service.yaml
#	packages/valory/services/oracle_ropsten/service.yaml
#	packages/valory/services/oracle_ropsten_cluster/service.yaml
#	packages/valory/services/register_reset/service.yaml
#	packages/valory/services/simple_abci/service.yaml
#	packages/valory/skills/abstract_round_abci/skill.yaml
#	packages/valory/skills/apy_estimation_abci/skill.yaml
#	packages/valory/skills/apy_estimation_chained_abci/skill.yaml
#	packages/valory/skills/hello_world_abci/skill.yaml
#	packages/valory/skills/liquidity_provision_abci/skill.yaml
#	packages/valory/skills/liquidity_rebalancing_abci/skill.yaml
#	packages/valory/skills/oracle_abci/skill.yaml
#	packages/valory/skills/oracle_deployment_abci/skill.yaml
#	packages/valory/skills/price_estimation_abci/skill.yaml
#	packages/valory/skills/register_reset_abci/skill.yaml
#	packages/valory/skills/registration_abci/skill.yaml
#	packages/valory/skills/reset_pause_abci/skill.yaml
#	packages/valory/skills/safe_deployment_abci/skill.yaml
#	packages/valory/skills/simple_abci/skill.yaml
#	packages/valory/skills/test_abci/skill.yaml
#	packages/valory/skills/transaction_settlement_abci/skill.yaml
#	plugins/aea-test-autonomy/setup.py
#	setup.py
@settings(deadline=2000, suppress_health_check=[HealthCheck.too_slow])
@settings(deadline=5000, suppress_health_check=[HealthCheck.too_slow])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@settings(deadline=2000, suppress_health_check=[HealthCheck.too_slow])
@settings(deadline=5000, suppress_health_check=[HealthCheck.too_slow])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Adamantios Adamantios marked this pull request as ready for review September 30, 2022 12:55
@DavidMinarsch DavidMinarsch merged commit 8f71c3f into main Sep 30, 2022
@DavidMinarsch DavidMinarsch deleted the chore/parametrize-lock-os branch October 1, 2022 11:37
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.

None yet

3 participants