bcgov / von-network

A portable development level Indy Node network.
Apache License 2.0
163 stars 188 forks source link

[#239] Migrate to docker compose V2 #240

Closed tdiesler closed 2 years ago

tdiesler commented 2 years ago

Signed-off-by: Thomas Diesler tdiesler@redhat.com

tdiesler commented 2 years ago

dockerCompose=${DOCKER_COMPOSE:-docker --log-level error compose}

ok, done

WadeBarnes commented 2 years ago

You can remove the echo as well:

echo
echo "Using: ${dockerCompose}"
echo
swcurran commented 2 years ago

Hmmm...Is there anything I need to do in my local install to get this to work? I ran a build and test that worked just before updating my fork to this. Now getting the following error - connection errors between containers?

~/repos/aries-agent-test-harness [main] 07:46 $ ./manage test -d acapy -b acapy -t T001-RFC0025
Tags:  --tags=T001-RFC0025

@RFC0025 @UsesCustomParameters @AIP10 @AIP20
Feature: RFC 0025 DIDComm Transports # features/0025-didcomm-transports.feature:2
  In order to communicate with other agents,
  As an Agent
  I want to create connections using different transport protocols.
  @T001-RFC0025 @AcceptanceTest @DIDExchangeConnection @Transport_Http @critical
  Scenario Outline: Create DIDExchange connection between two agents with overlapping transports -- @1.1 DIDExchange connection with both agents using HTTP for inbound and outbound transport  # features/0025-didcomm-transports.feature:23
    Given we have "2" agents                                                                                                                                                                    # features/steps/0160-connection.py:22 0.000s
      | name | role      |
      | Acme | responder |
      | Bob  | requester |
    And "Acme" is running with parameters "{"inbound_transports": ["http"], "outbound_transports": ["http"] }"                                                                                  # features/steps/0044-mime-types.py:12 0.003s
      Traceback (most recent call last):
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
          return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
        File "/usr/local/lib/python3.7/asyncio/base_events.py", line 962, in create_connection
          raise exceptions[0]
        File "/usr/local/lib/python3.7/asyncio/base_events.py", line 949, in create_connection
          await self.sock_connect(sock, address)
        File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 473, in sock_connect
          return await fut
        File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 503, in _sock_connect_cb
          raise OSError(err, f'Connect call failed {address}')
      ConnectionRefusedError: [Errno 111] Connect call failed ('0.0.0.0', 9020)

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "/usr/local/lib/python3.7/site-packages/behave/model.py", line 1329, in run
          match.run(runner.context)
        File "/usr/local/lib/python3.7/site-packages/behave/matchers.py", line 98, in run
          self.func(context, *args, **kwargs)
        File "features/steps/0044-mime-types.py", line 21, in step_impl
          agent_url + "/agent/command/", "agent", operation="start", data=data
        File "/aries-test-harness/agent_backchannel_client.py", line 103, in agent_backchannel_POST
          make_agent_backchannel_request, "POST", agent_url, data=payload
        File "/aries-test-harness/agent_backchannel_client.py", line 41, in run_coroutine_with_kwargs
          return loop.run_until_complete(coroutine(*args, **kwargs))
        File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
          return future.result()
        File "/aries-test-harness/agent_backchannel_client.py", line 51, in make_agent_backchannel_request
          async with client_session.request(method, path, json=data, params=params) as resp:
        File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1141, in __aenter__
          self._resp = await self._coro
        File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 537, in _request
          req, traces=traces, timeout=real_timeout
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 540, in connect
          proto = await self._create_connection(req, traces, timeout)
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 901, in _create_connection
          _, proto = await self._create_direct_connection(req, traces, timeout)
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
          raise last_exc
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1187, in _create_direct_connection
          client_error=client_error,
        File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
          raise client_error(req.connection_key, exc) from exc
      aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 0.0.0.0:9020 ssl:default [Connect call failed ('0.0.0.0', 9020)]
swcurran commented 2 years ago

Nevermind -- still getting an issue, but it is not that. I just realize that I was using the "test" sub-command and not "run". Doh...

swcurran commented 2 years ago

OK -- I think this issue is real :-). I'm getting an error starting the services -- unknown option. I'm looking into it, but if you know anything offhand...

Thanks!

~/repos/aries-agent-test-harness [main] 07:55 $  ./manage service start von-network;
unknown shorthand flag: 'd' in -d
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/swcur/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context
WadeBarnes commented 2 years ago

@swcurran, I think you need to delete the existing instance (download) of von-network from you're von-network/.build folder.

swcurran commented 2 years ago

Still getting the same error. The error is in the ./manage start command for von-network.

I'm using Docker version 20.10.21, build baeda1f

Is that the issue?

WadeBarnes commented 2 years ago

Try getting the latest of von-network on it's own and try a ./manage start.

WadeBarnes commented 2 years ago

Further testing on Linux, Ubuntu 20.04, has reveled the docker compose changes have not made it to the Linux platform yet. Changes being revered; https://github.com/bcgov/von-network/pull/241

tdiesler commented 2 years ago

How about this on Ubuntu ...

sudo apt-get update
sudo apt-get install docker-compose-plugin

Anyway, I'll fix it - there are perhaps other distros that are not ready yet.

swcurran commented 2 years ago

Weird. That did work!

I had previously run these commands:

 1663  sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
 1664  docker --version
 1665  docker --help
 1666  sudo apt-get update
 1667  sudo apt-get install docker-compose-plugin
 1668  docker

I can't see the output of command 1665, but I swear that "compose" wasn't there. But it was in 1668, so I probably missed it.

Sorry for the confusion...

swcurran commented 2 years ago

@WadeBarnes -- I was able to use the V2 style of docker compose (no hyphen).