-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Clarify gid used by docker image process and bind-mount method #49529
Clarify gid used by docker image process and bind-mount method #49529
Conversation
Pinging @elastic/es-docs (>docs) |
Pinging @elastic/es-core-infra (:Core/Infra/Packaging) |
Note: not assigning reviewers yet, until packaging CI turns green. |
Packaging-matrix job is now green, assigned reviewers. |
// Restart the container | ||
final Map<Path, Path> volumes = Map.of(tempEsDataDir.toAbsolutePath(), Path.of("/usr/share/elasticsearch/data")); | ||
|
||
runContainer(distribution(), volumes, Map.of("ES_JAVA_OPTS", "-Xms512m -Xmx512m")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the extra env vars here? I don't see any assertions that the values are in effect. You can pass null
otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only because I wanted to keep the memory usage to a minimum for this type of test. Default is 1GB which I thought is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the Docker tests do anything exciting right now, or spin up multiple nodes, so we could make this the default. I think the tests should all work the same way though, unless they need to change a setting for the sake of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for not setting the heap in this test: 289f776
We can reduce the footprint for all tests, by default, in a future PR.
qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java
Outdated
Show resolved
Hide resolved
qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java
Outdated
Show resolved
Hide resolved
qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java
Outdated
Show resolved
Hide resolved
qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java
Outdated
Show resolved
Hide resolved
qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java
Outdated
Show resolved
Hide resolved
qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java
Outdated
Show resolved
Hide resolved
and use of installation.data instead of hardcoded values.
* Switch to int in signature * Address PR comment about redundant .toString()
@pugnascotia Thanks for the comments! I think I addressed them with the exception of #49529 (comment) for the reason suggested there. Could you take another pass when there's time? |
qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…47929-test-docker-uid-gid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix reference about the uid:gid that Elasticsearch runs as inside the Docker container and add a packaging test to ensure that bind mounting a data dir with a random uid and gid:0 works as expected. Relates elastic#49529 Closes elastic#47929
Elasticsearch runs as uid:gid
1000:0
inside the Docker image:Clarify docs to reflect this and add required packaging test.
Finally, remove unnecessary trailing whitespace characters from the
Docker docs page.
Closes #47929