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

Update docker config to use docker networking instead of host networking #312

Closed
wants to merge 7 commits into from

Conversation

mainnet-pat
Copy link
Contributor

This allows us to update the docker version to latest and have no issues on macOS.

@woodser
Copy link
Contributor

woodser commented Sep 1, 2024

The CI tests are failing with errors: Error: Http response at 400 or 500 level, http status code: 0 https://github.com/haveno-dex/haveno-ts/pull/312/checks

@woodser
Copy link
Contributor

woodser commented Sep 1, 2024

I'm still getting errors on macOS with the latest docker:

  ● Can get the version (CI)

    Error: Http response at 400 or 500 level, http status code: 503

      528 |     for (const settledPromise of await Promise.allSettled(promises)) {
      529 |       if (settledPromise.status === "fulfilled") startupHavenods.push((settledPromise as PromiseFulfilledResult<HavenoClient>).value);
    > 530 |       else if (!err) err = new Error((settledPromise as PromiseRejectedResult).reason);
          |                            ^
      531 |     }
      532 |     if (err) throw err;
      533 |

      at Object.<anonymous> (src/HavenoClient.test.ts:530:28)

I'm only using docker to start the envoy service. I start the other services manually (monerod1, monerod2, funding-wallet-local, and the seed node).

But the only changes in the PR are for docker files, so I suppose something needs updated for macOS too.

@woodser
Copy link
Contributor

woodser commented Sep 1, 2024

Also the logs for the arbitrator, user1, and user2 are no longer collected with this PR as they are on master:

image

Suspecting that's because those were commented out in docker/docker-compose.yml.

@mainnet-pat
Copy link
Contributor Author

mainnet-pat commented Sep 2, 2024

That's the idea of this PR, to ditch starting all services manually with make in 4 terminals, now they are started with docker. Spawning of other processes is not scoped in this PR so the haveno compilation is still needed

@mainnet-pat
Copy link
Contributor Author

What is the rationale for starting only envoy with docker. Why other services are needed there?

@woodser
Copy link
Contributor

woodser commented Sep 2, 2024

It’s helpful to have manual control to start, stop, modify, build, and delete the services individually throughout the development process, instead of using docker to start all services together, which can’t be easily managed individually. I found there was too much overhead for making small changes and rapidly iterating, so I do want to preserve the ability to run the services manually.

@mainnet-pat
Copy link
Contributor Author

mainnet-pat commented Sep 2, 2024

So you want to keep it as is? So I struggle to see what is actually needed?

I see pure docker setup is used for CI, but make scripts for localdev. What is the desired outcome of docker update?

@mainnet-pat
Copy link
Contributor Author

I can introduce two docker files, for localdev and for CI

@woodser
Copy link
Contributor

woodser commented Sep 2, 2024

Updating docker makes the tests fail at least when the services are started manually (I didn't test when started with docker). So the goal is to make the tests work after updating docker, with the services started manually and with docker.

@mainnet-pat mainnet-pat requested a review from a team as a code owner September 5, 2024 10:23
@@ -0,0 +1,4109 @@
"use strict";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove dist files from PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

network_mode: "host"
depends_on:
- seed1
# arbitrator:
Copy link
Contributor

@woodser woodser Sep 5, 2024

Choose a reason for hiding this comment

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

I saw that the log files were not collected in the CI tests for the arbitrator, user1, and user2. Guessing because these were commented out. Should be uncommented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because these containers are currently unused. Tests are invoking arbitrator, user1 and user2 from haveno directory. To fully dockerize the project we'd need to invoke monerod and haveno processes with docker run.

If I'd uncomment these containers, there would be binding errors since docker and local haveno will be racing to bind to the same port. If I remove the port exposure from docker, then logs will be essentially empty (as in current master).

Copy link
Contributor

Choose a reason for hiding this comment

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

How can we get the logging for arbitrator, user1, and user2 to remain collected in the CI tests then? Those logs are sometimes needed for debugging.

Copy link
Contributor

Choose a reason for hiding this comment

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

On master, these logs are populated:

image

"--rpc-access-control-origins=http://localhost:8080",
"--wallet-dir=./.localnet",
"--rpc-access-control-origins='*'",
"--wallet-dir=./.localnet/funding_wallet",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move the funding wallet to this folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for docker to place the artifacts into proper local persistent directory

@@ -1,591 +0,0 @@
import type * as grpcWeb from "grpc-web";
Copy link
Contributor

Choose a reason for hiding this comment

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

No changes to dist files should be included with the PR.

"--add-exclusive-node=127.0.0.1:48080",
"--rpc-access-control-origins=http://localhost:8080",
"--add-exclusive-node=node1:48080",
"--rpc-access-control-origins='*'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to open up the access control origins from http://localhost:8080? Thinking to keep it as is to be more representative of production.

depends_on:
- seed1
# ports:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these comments be removed, or they're documenting something?

@mainnet-pat
Copy link
Contributor Author

Closing as incompleted.

@mainnet-pat mainnet-pat closed this Sep 6, 2024
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.

2 participants