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

Add support for existing and new docker compose syntax #171

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

WadeBarnes
Copy link
Member

Signed-off-by: Wade Barnes wade@neoterictech.ca

- Dynamically detect the version of docker compose and adjust the calling syntax appropriately.
- resolves bcgov#170

Signed-off-by: Wade Barnes <wade@neoterictech.ca>
@WadeBarnes
Copy link
Member Author

@Moopli, here is the fix for the issue you reported. Could you try this out and see if it resolves the issue for you?

@ianco
Copy link
Contributor

ianco commented Sep 10, 2021

When I run ./manage start ... it doesn't seem to start the nodes ...

$ ./manage start --logs
Creating von_webserver_1 ... done
Creating von_node4_1     ... done
Creating von_node2_1     ... done
Creating von_node3_1     ... done
Creating von_node1_1     ... done
Attaching to von_node4_1, von_node2_1, von_node1_1, von_webserver_1, von_node3_1
webserver_1  | Ledger does not exist - Creating genesis data...
webserver_1  | von_generate_transactions
... etc

I get the logs for the webserver but not the nodes. If I open http://localhost:9000 in a browser I get Error initializing pool ledger

@ianco
Copy link
Contributor

ianco commented Sep 10, 2021

The nodes seem to be sleeping:

$ docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED         STATUS         PORTS                                                           NAMES
69fea24637f5   von-network-base   "/bin/bash -c 'sleep…"   2 minutes ago   Up 2 minutes   0.0.0.0:9707-9708->9707-9708/tcp, :::9707-9708->9707-9708/tcp   von_node4_1
281493fb5759   von-network-base   "/bin/bash -c 'sleep…"   2 minutes ago   Up 2 minutes   0.0.0.0:9703-9704->9703-9704/tcp, :::9703-9704->9703-9704/tcp   von_node2_1
7c8a144b154e   von-network-base   "/bin/bash -c 'sleep…"   2 minutes ago   Up 2 minutes   0.0.0.0:9701-9702->9701-9702/tcp, :::9701-9702->9701-9702/tcp   von_node1_1
1f0e7da389dd   von-network-base   "bash -c 'sleep 10; …"   2 minutes ago   Up 2 minutes   0.0.0.0:9000->8000/tcp, :::9000->8000/tcp                       von_webserver_1
ad98d3dcecbf   von-network-base   "/bin/bash -c 'sleep…"   2 minutes ago   Up 2 minutes   0.0.0.0:9705-9706->9705-9706/tcp, :::9705-9706->9705-9706/tcp   von_node3_1

@Moopli
Copy link

Moopli commented Sep 10, 2021

It starts cleanly for me, and aries agent test harness tests using the local von pass, thanks!

@WadeBarnes
Copy link
Member Author

WadeBarnes commented Sep 10, 2021

@ianco, They shouldn't be sleeping. I didn't change any of the startup commands in the docker-compose file.

@ianco
Copy link
Contributor

ianco commented Sep 10, 2021

Not sure what's going on, I tried deleting & rebuilding the images (cleaned out the docker cache), re-started, and the nodes never seem to start.

@WadeBarnes
Copy link
Member Author

@ianco, What does your docker-compose file look like?

@ianco
Copy link
Contributor

ianco commented Sep 10, 2021

@ianco, What does your docker-compose file look like?

docker-compose.yml.txt

... also:

$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c

@WadeBarnes
Copy link
Member Author

WadeBarnes commented Sep 10, 2021

@ianco, you have them sleeping for 4h:

    entrypoint: /bin/bash
    command:
      [
        "-c",
        "sleep 4h"
      ]

It looks like you still have remnants of the configuration from when we were debugging the ledger issues.

Copy link
Contributor

@swcurran swcurran left a comment

Choose a reason for hiding this comment

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

Tested on Docker version 20.10.8, build 3967b7d and all good.

@swcurran swcurran merged commit f041c11 into bcgov:master Sep 10, 2021
@swcurran
Copy link
Contributor

Nice work!

@ianco
Copy link
Contributor

ianco commented Sep 10, 2021

@ianco, you have them sleeping for 4h:

    entrypoint: /bin/bash
    command:
      [
        "-c",
        "sleep 4h"
      ]

It looks like you still have remnants of the configuration from when we were debugging the ledger issues.

Aha thanks @WadeBarnes good catch, you're right that is a local change, my local von-network is checked out on a branch :-( oops

@swcurran
Copy link
Contributor

I’m having trouble with ./manage down. I thought it was I tried to run it too soon, but it seems consistent:

~/repos/von-network [docker-compose-fixes] 08:13 $ ./manage down

Stopping and removing any running containers ...
Docker version 20.10.8, build 3967b7d
Removing project volumes ...
Error response from daemon: remove von_node1-data: volume is in use - [6d2746ac9d16ce2eee0414b51521e3ee269307e18258f32f31824aa6fd3c0a84]
Error response from daemon: remove von_node2-data: volume is in use - [e78547b9fccae345322091ea5cf76c75d13aca6a00b44405aa1380075aaf856d]
Error response from daemon: remove von_node3-data: volume is in use - [a234e41be056e9f1506894a889b971489f0562863f480c7cf6c319e63bffcdfa]
Error response from daemon: remove von_node4-data: volume is in use - [bdedc51f5b8b882f9467505175ab94b76c601ee0a3d624bd2d94a5c7f0e5d197]
Error response from daemon: remove von_webserver-cli: volume is in use - [4246f4da90a79093c3150d133e68ed27e87cb6a833daec1f8213636453fe4342]
Error response from daemon: remove von_webserver-ledger: volume is in use - [4246f4da90a79093c3150d133e68ed27e87cb6a833daec1f8213636453fe4342]

./manage stop seems fine:

~/repos/von-network [docker-compose-fixes] 08:13 $ ./manage stop
Stopping von_node2_1     ... done
Stopping von_webserver_1 ... done
Stopping von_node1_1     ... done
Stopping von_node3_1     ... done
Stopping von_node4_1     ... done
~/repos/von-network [docker-compose-fixes] 08:14 $ 

@WadeBarnes
Copy link
Member Author

@swcurran, I see a couple things I missed. Another PR is coming shortly, just testing.

WadeBarnes pushed a commit to WadeBarnes/von-network that referenced this pull request Aug 28, 2024
Add support for existing and new docker compose syntax
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.

undocumented docker compose V2 requirement
4 participants