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 load balancer, and quick start documentation. #3

Merged
merged 11 commits into from
Jan 13, 2023
Merged

Conversation

4141done
Copy link
Contributor

@4141done 4141done commented Jan 12, 2023

What

Adds:

  • An NGINX load balancer that simply routes to the messenger application
  • A docker-compose file that starts up all the services and the infrastructure

I also moved the setup guides to a docs folder since I couldn't get github to handle markdown in expands - and I also don't want the platform README to be all about setting up the whole demo.

@4141done 4141done changed the title Je add lb Add load balancer, and quick start documentation. Jan 12, 2023
@4141done 4141done requested a review from alessfg January 12, 2023 19:22
@4141done 4141done marked this pull request as ready for review January 12, 2023 19:22
Copy link

@ciroque ciroque left a comment

Choose a reason for hiding this comment

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

Look good, a couple of clarifying questions is all

# `microservices_demo_1`. Because of this, all services
# are able to communicate by their `container_name`.

# Only the load balancer ports are mapped out. However, we
Copy link

Choose a reason for hiding this comment

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

"Only the load balancer ports need to be mapped out" ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say "only the load balancer ports are exposed to the host"

Copy link

@ciroque ciroque Jan 12, 2023

Choose a reason for hiding this comment

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

it's the "However, we also leave the ports for the databases and the rabbit queue mapped out" that confused me for a second. Those don't need to be exposed but they are. The LB ports do need to be exposed for the deployment to be accessible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's much better wording. "exposed" didn't pop into my head. Changing...

Copy link
Contributor

@alessfg alessfg left a comment

Choose a reason for hiding this comment

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

# This docker-compose file sets up the services
# and shared infrastructure on a common network called
# `microservices_demo_1`. Because of this, all services
# are able to communicate by their `container_name`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# are able to communicate by their `container_name`.
# are able to communicate by their respective <container_name>.

container_name is not actual code so it'd be better if we tag it as something that is not code. The above is a suggestion, but not necessarily the best solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd argue that this fits the bill - it's a key we provide which will be read in the docker compose file. I'm going with this rubric to determine when I use backticks:

If you would use it in the terminal or modify it in a code or text editor, use a monospaced font.

Copy link
Contributor

@alessfg alessfg Jan 13, 2023

Choose a reason for hiding this comment

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

Fair enough. I like to put placeholder code in <> (I have no clue how it's called) but as long as we stay consistent both work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ohhhh I see what you mean . I was thinking of the key and I think you were thinking of the value. Maybe.. "... are able to communicate by using the value of their container_name key as the hostname"? I just wanted to make it clear which key in the docker compose file we are referencing

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds perfect!

README.md Outdated
Comment on lines 7 to 8
## Running just shared infrastructure
If you are running some subset of the services manually, just run `docker-compose up` from this repository to start up the message queue. This does not set up the NGINX load balancer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Running just shared infrastructure
If you are running some subset of the services manually, just run `docker-compose up` from this repository to start up the message queue. This does not set up the NGINX load balancer.

You will already cover the manual setup in L15

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 one is a bit different but maybe I've worded it poorly. There's three things you can do:

  1. Manual setup (prebuilt containers everywhere, started with mostly docker run commands and some docker-compose up commands).
  2. Quick setup (one big docker compose file)
  3. Running a subset of services locally on your machine (how most devs work in my experience). So for example I might be running messenger with just node on my mac, and need to have the rabbit queue available for that.

How does this alternative wording sound?

If you are working on one of the services, such as messenger, that depends on a piece of shared infrastructure to function, you can run docker-compose up from this repository to provide that infrastructure. This does not set up the NGINX load balancer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Your suggestion should work! The original wording was indeed unclear/missing some info.

@alessfg alessfg added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 13, 2023
4141done and others added 2 commits January 13, 2023 08:55
Co-authored-by: Alessandro Fael Garcia <[email protected]>
Co-authored-by: Alessandro Fael Garcia <[email protected]>
@4141done
Copy link
Contributor Author

@alessfg it got lost when I committed your suggestion, but here's what this change would look like with prettier formatting applied #5

What do you think?

@alessfg alessfg self-requested a review January 13, 2023 22:24
Copy link
Contributor

@alessfg alessfg left a comment

Choose a reason for hiding this comment

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

LGTM!

@4141done 4141done merged commit e845b30 into main Jan 13, 2023
@alessfg alessfg deleted the je-add-lb branch January 24, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants