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

Release v0.5.1 #1493

Merged
merged 126 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d69bef6
Most of modules switched to click native CliRunner.
panasevychol Jul 3, 2020
e8c2d18
Relative imports from 1+ level up refactored (conftest, docs.helper)
panasevychol Jul 3, 2020
5a3bb51
experimental dialogue api
5A11 Jul 6, 2020
bb53620
experimental: adding dialogues.create and dialogue.reply; applying th…
5A11 Jul 6, 2020
f06fb77
refactoring
5A11 Jul 6, 2020
ccc5484
change role order
5A11 Jul 6, 2020
95d7737
fix deploy and check scripts; enable disabled tests
DavidMinarsch Jul 6, 2020
5add1d2
Merge pull request #1474 from fetchai/feature/misc_updates
DavidMinarsch Jul 6, 2020
6834531
add script to check package dependencies
marcofavorito Jul 6, 2020
1011e5d
add docstring in script
marcofavorito Jul 6, 2020
0131470
add tests for aea/components/loader.py
marcofavorito Jul 6, 2020
a917790
add package depdendencies checks to workflow
marcofavorito Jul 6, 2020
a498b25
reenable tests and update marks
DavidMinarsch Jul 7, 2020
2f8b0a6
gym connection async and tests.
solarw Jul 7, 2020
95ccab3
fix erc1155 tests
DavidMinarsch Jul 7, 2020
d4a0d1c
fix tests timeout and erc1155 client skill description
DavidMinarsch Jul 7, 2020
09b1f00
update test_loader
marcofavorito Jul 7, 2020
70482e2
Merge pull request #1478 from fetchai/feature/tests_marks
DavidMinarsch Jul 7, 2020
a5eadb8
Merge pull request #1476 from fetchai/fix/1213
DavidMinarsch Jul 7, 2020
533f3cf
merge latest develop
DavidMinarsch Jul 7, 2020
d8a35e2
gym connection version bump. fixes
solarw Jul 7, 2020
2ac253b
add absolute import paths, remove unused files
DavidMinarsch Jul 7, 2020
97092d8
add tests for 'aea/components/base.py
marcofavorito Jul 7, 2020
8702c44
Add logging to libp2p aea cli tests cases
lrahmani Jul 7, 2020
039117a
Add address lookup retries for DHTPeer
lrahmani Jul 7, 2020
d148ca7
Make timeouts constants for DHTPeer and DHTClient
lrahmani Jul 7, 2020
54da3c7
Merge pull request #1449 from fetchai/feature/cli-runner-native
DavidMinarsch Jul 7, 2020
9e195bb
add 'only_windows' test decorator
marcofavorito Jul 7, 2020
db5cfff
Merge pull request #1477 from fetchai/fix/1467
DavidMinarsch Jul 7, 2020
7facbd8
AEATestCase print process output if not running
lrahmani Jul 7, 2020
aa1e2ab
Merge branch 'develop' into fix/libp2p-aea-testcase-tests
lrahmani Jul 7, 2020
24ba0de
Increase AEATestCase libp2p timeout
lrahmani Jul 7, 2020
79601d8
gym_aea version bump
solarw Jul 7, 2020
fc24dde
AEATestCase print process std output if string missing
lrahmani Jul 7, 2020
4e96c97
increase aea/configuration/base.py coverage
marcofavorito Jul 7, 2020
53f65be
fix doctest
marcofavorito Jul 7, 2020
8f9352b
refactor previous tests, add prot specs
marcofavorito Jul 7, 2020
0676cf1
increase coverage for module aea/configurations/loader.py
marcofavorito Jul 7, 2020
e3b00ee
add missing packages in conftest lists
marcofavorito Jul 7, 2020
bf2d46f
skip some tests on windows
marcofavorito Jul 7, 2020
0ee2ca0
add tests for contracts and protocols modules
DavidMinarsch Jul 8, 2020
94028f8
Merge pull request #1482 from fetchai/fix/1467-configurations
DavidMinarsch Jul 8, 2020
7a5fa38
fix crypto registries tests
DavidMinarsch Jul 8, 2020
23aa8d6
Merge pull request #1479 from fetchai/feature/gym_async_and_tests
DavidMinarsch Jul 8, 2020
bf49645
Fix hashes
DavidMinarsch Jul 8, 2020
a8576f7
fix test generic flaky rerun number
DavidMinarsch Jul 8, 2020
38b800f
Merge pull request #1484 from fetchai/feature/tests_mics
DavidMinarsch Jul 8, 2020
fce8bac
Use adaptive timeout for libp2p download deps: at leaset 250Kb/s requ…
lrahmani Jul 8, 2020
11f13eb
Increase golang checks envelopes delivery timeouts
lrahmani Jul 8, 2020
bc5119c
New gui design layout in progress.
panasevychol Jul 9, 2020
80804ff
Merge branch 'develop' of https://github.com/fetchai/agents-aea into …
5A11 Jul 9, 2020
217bd0f
addressing PR comments
5A11 Jul 9, 2020
1042473
formatting
5A11 Jul 9, 2020
5931bd4
reverting skill usage changes back
5A11 Jul 9, 2020
1da9fa8
Make libp2p connection fully async
lrahmani Jul 9, 2020
589587c
Address security checker comments
lrahmani Jul 9, 2020
94753df
Address pyling comments
lrahmani Jul 9, 2020
0038817
Merge branch 'develop' into fix/libp2p-aea-testcase-tests
lrahmani Jul 9, 2020
e9a38b8
New design layout - almost done.
panasevychol Jul 9, 2020
b22cbf5
New design implementation in progress.
panasevychol Jul 9, 2020
ac2e93d
oef connection async refactoring and tests coverage
solarw Jul 7, 2020
e9736e3
small fixes
solarw Jul 10, 2020
35fdc04
JS func connected to a new html.
panasevychol Jul 10, 2020
605f33d
Merge pull request #1486 from fetchai/feature/oef_async_and_tests
DavidMinarsch Jul 10, 2020
bbcca99
connections test coverage
solarw Jul 13, 2020
c4ad62c
Keeping backwards compatibility
5A11 Jul 13, 2020
df6146f
Reverting skill changes
5A11 Jul 13, 2020
2156b89
cleanup
5A11 Jul 13, 2020
8113da7
add test on envelope properties skill_id and message_bytes
marcofavorito Jul 13, 2020
845e737
updating hashes
5A11 Jul 13, 2020
4892b95
Merge branch 'develop' of https://github.com/fetchai/agents-aea into …
5A11 Jul 13, 2020
25ba5ef
update hashes
5A11 Jul 13, 2020
092511b
change logging level locally in test
marcofavorito Jul 13, 2020
af8f6f1
raise exception in create method
5A11 Jul 13, 2020
cadcd35
updating generator with latest dialogue api
5A11 Jul 13, 2020
542e262
refine envelope context check in ProtobufEnvelopeSerializer.encode
marcofavorito Jul 13, 2020
2b5dbf4
Upgrade golangci-lint
lrahmani Jul 13, 2020
697704a
Merge pull request #1489 from fetchai/test/aea-mail
DavidMinarsch Jul 13, 2020
82eea87
Upgrade golangci-lint
lrahmani Jul 13, 2020
5a86614
Merge pull request #1488 from fetchai/feature/connections-coverage
DavidMinarsch Jul 13, 2020
ddb614b
Merge pull request #1490 from fetchai/hotfix/golangci-lint-unknown-ar…
DavidMinarsch Jul 13, 2020
75c9bcb
rolling back fipa dialogue
5A11 Jul 13, 2020
c35677f
cleaning up
5A11 Jul 13, 2020
ebce140
hashes
5A11 Jul 13, 2020
9e6b9de
add agent logger adapter and use it in Skill.from_config
marcofavorito Jul 13, 2020
e327f46
fix static typing
marcofavorito Jul 13, 2020
4670ad5
Merge branch 'develop' into feature/agent-name-log
marcofavorito Jul 13, 2020
589b543
attach agent logger to every component
marcofavorito Jul 13, 2020
331d562
remove check in Component.logger setter
marcofavorito Jul 13, 2020
9f5672b
add loggers to multiplexer, task manager, registries and loop
marcofavorito Jul 13, 2020
8dbfc17
update connection to use self.logger
marcofavorito Jul 13, 2020
b54a260
soef ping command. +small fixes
solarw Jul 14, 2020
f33afe6
Merge pull request #1471 from fetchai/experimental/dialogue
DavidMinarsch Jul 14, 2020
c68aae1
soef connection: stop periodic ping task on unregister
solarw Jul 14, 2020
8597bfb
Merge pull request #1481 from fetchai/fix/libp2p-aea-testcase-tests
DavidMinarsch Jul 14, 2020
0134052
Merge pull request #1492 from fetchai/feature/soef_ping_command
DavidMinarsch Jul 14, 2020
4246e29
normalize the string format to be f-string
marcofavorito Jul 14, 2020
03bb8bf
fix connection package test due to bad log capturing
marcofavorito Jul 14, 2020
1233f3b
merge with develop
marcofavorito Jul 14, 2020
e875bb7
remove default logger in Component.__init__
marcofavorito Jul 14, 2020
91f74ee
bump version to 0.5.1 and align all package versions
DavidMinarsch Jul 14, 2020
34e4ae1
Merge pull request #1494 from fetchai/feature/release_v0.5.1
DavidMinarsch Jul 14, 2020
fcd453f
Increase p2p_libp2p connection code coverage to 100%: with 29/351 sta…
lrahmani Jul 14, 2020
e0ffe62
merge with develop
marcofavorito Jul 14, 2020
2cd8e4a
fix for ping task cancel
solarw Jul 14, 2020
1b0ed9a
Merge branch 'develop' into feature/libp2p-improve-coverage
lrahmani Jul 14, 2020
80af502
Address ci comments
lrahmani Jul 14, 2020
19eefd6
Update fingerprints
lrahmani Jul 14, 2020
76226ef
Merge pull request #1496 from fetchai/feature/soef_ping_command
DavidMinarsch Jul 14, 2020
ceb059e
merge latest develop and bump outdated packages
DavidMinarsch Jul 14, 2020
ebcc69e
address PR comments
marcofavorito Jul 14, 2020
20f9016
ignore pylint issue
marcofavorito Jul 14, 2020
6fc63c7
Increase p2p_libp2p_client connection code coverage to 100%: with 18/…
lrahmani Jul 14, 2020
0975c53
Address reviewers comments
lrahmani Jul 14, 2020
37072d3
Some styling bugs fixed, run from GUI executed with install-deps flag…
panasevychol Jul 14, 2020
15b7ecf
Update fingerprints
lrahmani Jul 14, 2020
22367ab
Accidentally commited AEA folder removed.
panasevychol Jul 14, 2020
a5f915b
Merge pull request #1497 from fetchai/feature/libp2p-improve-coverage
DavidMinarsch Jul 14, 2020
a57dfc4
Test fixed.
panasevychol Jul 14, 2020
bb9847a
merge with develop
marcofavorito Jul 14, 2020
69f5933
Merge pull request #1487 from fetchai/feature/new-gui-design
DavidMinarsch Jul 14, 2020
f7235b9
Merge pull request #1491 from fetchai/feature/agent-name-log
DavidMinarsch Jul 14, 2020
244a866
Add missing file
lrahmani Jul 14, 2020
8dae395
Merge pull request #1499 from fetchai/feature/libp2p-improve-coverage
DavidMinarsch Jul 15, 2020
7538466
update api docs
DavidMinarsch Jul 15, 2020
ef7177c
Merge pull request #1500 from fetchai/feature/docs
DavidMinarsch Jul 15, 2020
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
12 changes: 7 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
sudo apt-get install -y protobuf-compiler
- name: Integrational tests and coverage
run: |
tox -e py3.8 -- --aea-loop sync -m 'integration and not unstable and not ethereum'
tox -e py3.8 -- --aea-loop sync -m 'integration and not unstable and not ledger'

common_checks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -102,10 +102,12 @@ jobs:
- name: Golang code style check
uses: golangci/golangci-lint-action@v1
with:
version: v1.26
version: v1.28
working-directory: packages/fetchai/connections/p2p_libp2p/
- name: Check package versions in documentation
run: tox -e package_version_checks
- name: Check package dependencies
run: tox -e package_dependencies_checks
- name: Generate Documentation
run: tox -e docs

Expand All @@ -128,9 +130,9 @@ jobs:
pip install pipenv
pip install tox
- name: Integration tests
run: tox -e py3.7 -- -m 'integration and not unstable and not ethereum'
run: tox -e py3.7 -- -m 'integration and not unstable and not ledger'

integration_checks_eth:
integration_checks_ledger:
continue-on-error: True
runs-on: ubuntu-latest

Expand All @@ -149,7 +151,7 @@ jobs:
pip install pipenv
pip install tox
- name: Integration tests
run: tox -e py3.7 -- -m 'integration and not unstable and ethereum'
run: tox -e py3.7 -- -m 'integration and not unstable and ledger'
continue-on-error: true
- name: Force green exit
run: exit 0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ output_file
!packages/fetchai/contracts/erc1155/build
packages/fetchai/connections/p2p_libp2p/libp2p_node

!tests/data/dummy_contract/build
12 changes: 12 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release History

## 0.5.1 (2020-07-14)

- Adds support for agent name being appended to all log statements
- Adds redesigned GUI
- Extends dialogue api for easier dialogue maintenance
- Resolves blocking logic in oef and gym connections
- Adds full test coverage on aea modules configurations, components and mail
- Adds ping background task for soef connection
- Adds full test coverage for all connection packages
- Multiple docs updates
- Multiple additional tests and test stability fixes

## 0.5.0 (2020-07-06)

- Refactors all connections to be fully async friendly
Expand Down
2 changes: 1 addition & 1 deletion aea/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__title__ = "aea"
__description__ = "Autonomous Economic Agent framework"
__url__ = "https://github.com/fetchai/agents-aea.git"
__version__ = "0.5.0"
__version__ = "0.5.1"
__author__ = "Fetch.AI Limited"
__license__ = "Apache-2.0"
__copyright__ = "2019 Fetch.AI Limited"
18 changes: 18 additions & 0 deletions aea/aea.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from aea.exceptions import AEAException
from aea.helpers.exception_policy import ExceptionPolicyEnum
from aea.helpers.exec_timeout import ExecTimeoutThreadGuard, TimeoutException
from aea.helpers.logging import AgentLoggerAdapter
from aea.identity.base import Identity
from aea.mail.base import Envelope
from aea.protocols.base import Message
Expand Down Expand Up @@ -135,6 +136,8 @@ def __init__(

self._skills_exception_policy = skill_exception_policy

self._setup_loggers()

@property
def decision_maker(self) -> DecisionMaker:
"""Get decision maker."""
Expand Down Expand Up @@ -383,3 +386,18 @@ def teardown(self) -> None:
self.task_manager.stop()
self.resources.teardown()
ExecTimeoutThreadGuard.stop()

def _setup_loggers(self):
"""Setup logger with agent name. """
for element in [
self.main_loop,
self.multiplexer,
self.task_manager,
self.resources.component_registry,
self.resources.behaviour_registry,
self.resources.handler_registry,
self.resources.model_registry,
]:
element.logger = AgentLoggerAdapter(
element.logger, agent_name=self._identity.name
)
45 changes: 37 additions & 8 deletions aea/aea_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
from aea.exceptions import AEAException
from aea.helpers.base import load_aea_package, load_module
from aea.helpers.exception_policy import ExceptionPolicyEnum
from aea.helpers.logging import AgentLoggerAdapter
from aea.helpers.pypi import is_satisfiable
from aea.helpers.pypi import merge_dependencies
from aea.identity.base import Identity
Expand Down Expand Up @@ -879,11 +880,12 @@ def build(self, connection_ids: Optional[Collection[PublicId]] = None,) -> AEA:
copy(self.private_key_paths), copy(self.connection_private_key_paths)
)
identity = self._build_identity_from_wallet(wallet)
self._load_and_add_components(ComponentType.PROTOCOL, resources)
self._load_and_add_components(ComponentType.CONTRACT, resources)
self._load_and_add_components(ComponentType.PROTOCOL, resources, identity.name)
self._load_and_add_components(ComponentType.CONTRACT, resources, identity.name)
self._load_and_add_components(
ComponentType.CONNECTION,
resources,
identity.name,
identity=identity,
crypto_store=wallet.connection_cryptos,
)
Expand All @@ -908,7 +910,7 @@ def build(self, connection_ids: Optional[Collection[PublicId]] = None,) -> AEA:
**deepcopy(self._context_namespace),
)
self._load_and_add_components(
ComponentType.SKILL, resources, agent_context=aea.context
ComponentType.SKILL, resources, identity.name, agent_context=aea.context
)
self._build_called = True
self._populate_contract_registry()
Expand Down Expand Up @@ -1346,28 +1348,36 @@ def from_aea_project(
return builder

def _load_and_add_components(
self, component_type: ComponentType, resources: Resources, **kwargs
self,
component_type: ComponentType,
resources: Resources,
agent_name: str,
**kwargs,
) -> None:
"""
Load and add components added to the builder to a Resources instance.

:param component_type: the component type for which
:param resources: the resources object to populate.
:param agent_name: the AEA name for logging purposes.
:param kwargs: keyword argument to forward to the component loader.
:return: None
"""
for configuration in self._package_dependency_manager.get_components_by_type(
component_type
).values():
if configuration.is_abstract_component:
load_aea_package(configuration)
continue

if configuration in self._component_instances[component_type].keys():
component = self._component_instances[component_type][configuration]
resources.add_component(component)
elif configuration.is_abstract_component:
load_aea_package(configuration)
else:
configuration = deepcopy(configuration)
component = load_component_from_config(configuration, **kwargs)
resources.add_component(component)

_set_logger_to_component(component, configuration, agent_name)
resources.add_component(component)

def _populate_contract_registry(self):
"""Populate contract registry."""
Expand Down Expand Up @@ -1413,6 +1423,25 @@ def _check_we_can_build(self):
)


def _set_logger_to_component(
component: Component, configuration: ComponentConfiguration, agent_name: str,
) -> None:
"""
Set the logger to the component.

:param component: the component instance.
:param configuration: the component configuration
:param agent_name: the agent name
:return: None
"""
if configuration.component_type == ComponentType.SKILL:
# skip because skill object already have their own logger from the skill context.
return
logger_name = f"aea.packages.{configuration.author}.{configuration.component_type.to_plural()}.{configuration.name}"
logger = AgentLoggerAdapter(logging.getLogger(logger_name), agent_name)
component.logger = logger


# TODO this function is repeated in 'aea.cli.utils.package_utils.py'
def _verify_or_create_private_keys(aea_project_path: Path) -> None:
"""Verify or create private keys."""
Expand Down
16 changes: 10 additions & 6 deletions aea/agent_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
PeriodicCaller,
ensure_loop,
)
from aea.helpers.logging import WithLogger
from aea.multiplexer import InBox
from aea.skills.base import Behaviour

Expand All @@ -50,7 +51,7 @@
from aea.agent import Agent # pragma: no cover


class BaseAgentLoop(ABC):
class BaseAgentLoop(WithLogger, ABC):
"""Base abstract agent loop class."""

def __init__(
Expand All @@ -61,6 +62,7 @@ def __init__(
:params agent: Agent or AEA to run.
:params loop: optional asyncio event loop. if not specified a new loop will be created.
"""
WithLogger.__init__(self, logger)
self._agent: "Agent" = agent
self.set_loop(ensure_loop(loop))
self._tasks: List[asyncio.Task] = []
Expand All @@ -77,7 +79,7 @@ def start(self) -> None:

async def run_loop(self) -> None:
"""Run agent loop."""
logger.debug("agent loop started")
self.logger.debug("agent loop started")
self._state.set(AgentLoopStates.started)
self._set_tasks()
try:
Expand Down Expand Up @@ -171,7 +173,9 @@ def _behaviour_exception_callback(self, fn: Callable, exc: Exception) -> None:

:return: None
"""
logger.exception(f"Loop: Exception: `{exc}` occured during `{fn}` processing")
self.logger.exception(
f"Loop: Exception: `{exc}` occured during `{fn}` processing"
)
self._exceptions.append(exc)
self._state.set(AgentLoopStates.error)

Expand Down Expand Up @@ -200,7 +204,7 @@ def _register_behaviour(self, behaviour: Behaviour) -> None:
)
self._behaviours_registry[behaviour] = periodic_caller
periodic_caller.start()
logger.debug(f"Behaviour {behaviour} registered.")
self.logger.debug(f"Behaviour {behaviour} registered.")

def _register_all_behaviours(self) -> None:
"""Register all AEA behaviours to run periodically."""
Expand Down Expand Up @@ -237,7 +241,7 @@ def _stop_tasks(self):
def _set_tasks(self):
"""Set run loop tasks."""
self._tasks = self._create_tasks()
logger.debug("tasks created!")
self.logger.debug("tasks created!")

def _create_tasks(self) -> List[Task]:
"""
Expand All @@ -256,7 +260,7 @@ def _create_tasks(self) -> List[Task]:
async def _task_process_inbox(self) -> None:
"""Process incoming messages."""
inbox: InBox = self._agent.inbox
logger.info("[{}]: Start processing messages...".format(self._agent.name))
self.logger.info("[{}]: Start processing messages...".format(self._agent.name))
while self.is_running:
await inbox.async_wait()

Expand Down
2 changes: 1 addition & 1 deletion aea/cli_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def start_agent(agent_id: str, connection_id: PublicId):
) # 400 Bad request
else:
agent_process = call_aea_async(
[sys.executable, "-m", "aea.cli", "run"], agent_dir
[sys.executable, "-m", "aea.cli", "run", "--install-deps"], agent_dir
)

if agent_process is None:
Expand Down
Loading