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

DEVX-2039: Microservices Orders demo fails on Ubuntu 18.04 #774

Open
wants to merge 2 commits into
base: 5.5.1-post
Choose a base branch
from

Conversation

russau
Copy link

@russau russau commented Sep 3, 2020

Problem 1: elasticsearch container exits with a bootstrap check failure. Easy fix: set discovery.type: "single-node".

Problem 2: getting a permission denied writing to the logs folder in run-services.sh. This one comes down to different permissions for bind mounts in Docker on Linux and macOS. More on the way macOS docker works here.

On MacOS the streams user is the owner:

$ docker-compose exec microservices bash
streams@ac2c18b87e83:/build$ ls -la /opt/docker/
total 12
drwxr-xr-x  5 root    root    4096 Sep  3 03:04 .
drwxr-xr-x  1 root    root    4096 Sep  3 03:04 ..
drwxr-xr-x  2 root    root    4096 Sep  3 03:04 config
drwxr-xr-x 11 streams streams  352 Sep  1 03:38 logs
drwxr-xr-x  7 streams streams  224 Aug 31 04:08 scripts

On Linux the host user's id is the owner:

$ docker-compose exec microservices bash
streams@c07c5d12fa0b:/build$ ls -la /opt/docker/
total 20
drwxr-xr-x 5 root root 4096 Sep  3 02:53 .
drwxr-xr-x 1 root root 4096 Sep  3 02:53 ..
drwxr-xr-x 2 root root 4096 Sep  3 02:53 config
drwxrwxr-x 2 1001 1001 4096 Sep  3 02:46 logs
drwxrwxr-x 2 1001 1001 4096 Sep  3 00:43 scripts

Including a step to change the ownership of the logs folder on the host would fix it i.e.

cd examples/microservices-orders
git checkout 5.5.1-post
# If you are working on a Linux host change the ownership of the logs folder to allow the user in the microservices container
chown 999 logs 

I've also added a test to the run-services.sh to check permissions and send logs to /tmp if needed. These two commits will get the demo working on Linux. The chown 999 logs change to the instructions is up for debate.

Was an interesting thing to dig into! This will happen anywhere we have a non-root user container trying to write to a bind mount. We hit the same issue in training with the UBI containers.

@russau
Copy link
Author

russau commented Sep 4, 2020

Tested on mac and linux

image

image

@ybyzek
Copy link
Contributor

ybyzek commented Dec 1, 2020

@russau @rspurgeon ping on this PR to refresh a review or close?

@ybyzek ybyzek changed the title Devx 2039 DEVX-2039: Microservices Orders demo fails on Ubuntu 18.04 Dec 1, 2020
@rspurgeon
Copy link
Contributor

@russau @rspurgeon ping on this PR to refresh a review or close?

I've verified this PR works on macOS and CP 5.5.1 & 6.0.0

Copy link
Contributor

@rspurgeon rspurgeon left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

cla-assistant bot commented Apr 28, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants