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

push-publish docker compose example is broken #25595

Closed
fabrizzio-dotCMS opened this issue Jul 21, 2023 · 3 comments · Fixed by #29508
Closed

push-publish docker compose example is broken #25595

fabrizzio-dotCMS opened this issue Jul 21, 2023 · 3 comments · Fixed by #29508

Comments

@fabrizzio-dotCMS
Copy link
Contributor

fabrizzio-dotCMS commented Jul 21, 2023

Parent Issue

No response

Problem Statement

These two files are meant to facilitate push-publishing testing

  • docker/docker-compose-examples/push-publish/docker-compose-receiver.yml
  • docker/docker-compose-examples/push-publish/docker-compose-sender.yml

They should be used to start up two individual nodes. Typically one would end up running in port 8081 and the second in port 8082. Therefore they can be accessed from the browser typically by typing
http://localhost:8081/c and http://localhost:8082/c

As the user consuming this pp-environment one is supposed to set up a remote endpoint so the sender node can talk to it by entering the IP address of the remote node.
Typically a remote configuration should look like this:

Screenshot 2023-07-21 at 12 17 42

Now Let's suppose you introduce a pp conflict between both nodes (sender and receiver) following the instructions outlined here
#25229 (comment)

When you hit the check integrity button within this setup one would expect the report of the conflict. But in reality, nothing happens. No conflicts are shown here.

And the reason is that the docker container doesn't resolve localhost As our localhost. It thinks that localhost is the same container itself. Regardless of the port number. It sees itself as localhost. Therefore these two instances can NOT see each other.

In reality, when you hit check integrity the dotCMS sender instance connects to itself. And the CSV file that gets downloaded contains the exact same image of the sender's database. Therefore no conflict arises when comparing.
Because basically, it is comparing the instance against itself.

I was able to corroborate this. Setting up a remote debugger against the sender node comparing that every time I added a new file or folder. The changes would make it into the file coming from the "remote" receiver.

On the other hand, if the same exercise is carried out against a true remote node with an "absolute" address that can be resolved by the container to an external IP. e.g. using demo. dotcms.com The remote endpoint this time shows conflicts as expected. Because the container internally was capable of resolving the address.

in short, localhost is ambiguous for the docker container. And we should try to use an absolute "real" IP address here for testing.

Potential solution:
We could include both nodes (sender and receiver) in the same docker-compose and include in the networks an alias pointing to each one of the instances. And use that instance when configuring the PP Environments.

Steps to Reproduce

start up the two containers

These two files are meant to facilitate push-publishing testing

  • docker/docker-compose-examples/push-publish/docker-compose-receiver.yml
  • docker/docker-compose-examples/push-publish/docker-compose-sender.yml

configure sender and make it point http://localhost:8081

now create a conflict following these instructions
#25229 (comment)

Hit check integrity. You'll see no conflicts are found

Now repeat the same steps but this time using another endpoint pointing to demo.dotcms.com
Now see how this time we have conflicts as we expected.

Acceptance Criteria

We should be able to use these files

  • docker/docker-compose-examples/push-publish/docker-compose-receiver.yml
  • docker/docker-compose-examples/push-publish/docker-compose-sender.yml

To simulate PP and they should be able to see each other.

dotCMS Version

current master

Proposed Objective

Quality Assurance

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@fabrizzio-dotCMS fabrizzio-dotCMS changed the title push-publish docker compose examples are broken push-publish docker compose example is broken Jul 21, 2023
@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Oct 20, 2023
@nollymar nollymar removed the stale label Nov 14, 2023
@dcolina dcolina self-assigned this Jul 18, 2024
@dcolina dcolina removed their assignment Jul 31, 2024
dcolina added a commit that referenced this issue Aug 8, 2024
dcolina added a commit that referenced this issue Aug 8, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 9, 2024
…5595) (#29508)

### Proposed Changes

* This pull request includes the following updates and enhancements to
the Docker Compose setup and documentation for the Dotcms Push Publish
environment:

  - `docker-compose.yml`: Unified and configured service aliases.
- `readme.md`: Updated with new deployment instructions, endpoint
configuration guidance, and environment setup details.

### Details

- Unified Docker Compose Manifest: Combined the previously separate
Docker Compose manifests for sender and receiver into a single
`docker-compose.yml` file for simplified management.
- Service Aliases Configuration: Configured service aliases for
`dotcms-sender` and `dotcms-receiver` to facilitate easy referencing
between services. Added the alias `dotcms-receiver.local` and
`dotcms-sender.local`.
- Endpoint Configuration: Provided instructions on using local IP
addresses instead of `localhost` or `127.0.0.1` for endpoint
configuration, including commands to find the local IP address
(`ifconfig` for Linux/macOS and `ipconfig` for Windows).

### Additional Info
Related to #25595 (pushpublish docker compose example is broken).
@dcolina dcolina removed their assignment Aug 12, 2024
@nollymar nollymar reopened this Aug 12, 2024
@KevinDavilaDotCMS
Copy link
Contributor

KevinDavilaDotCMS commented Aug 12, 2024

Passed IQA

Tested in master

The conflicts appears as expected

Screen.Recording.2024-08-12.at.4.34.42.PM.mov

But when i try to "Resolve conflicts" i see this:

Screen.Recording.2024-08-12.at.4.36.09.PM.mov

-First the conflicst cant be resolved
-The second intent appears resolved
-and when a new check integrity, the conflicts still appears

I think this ticket is only to see if the conflicts appears running in the same docker-compose, and maybe this is an error from my enviroment, but i report it anyway

NOTES FOR QA:

Follow the detailed instructions in README (It is necessary to configure the IP correctly or you will have problems connecting both instances)
https://github.com/dotCMS/core/tree/master/docker/docker-compose-examples/push-publish

@bryanboza bryanboza added Release : 24.08.27 Custom templates and loggin fixes and removed Release : 24.08.20 AI Fixed labels Aug 20, 2024
@josemejias11
Copy link
Contributor

Approved: Tested on trunk_7ad6b2a, Docker, macOS 14.5, FF v126.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment