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

Initial commitment of documentation for clickhouse official image #2397

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

Felixoid
Copy link
Contributor

@Felixoid Felixoid commented Dec 6, 2023

Hello, dear official library team. Here's our attempt to create an official image clickhouse in the scope of docker-library/official-images#14136 and ClickHouse/ClickHouse#31473

Both the docs and official images PRs are created simultaneously.

docker-library/official-images#15846

@Felixoid
Copy link
Contributor Author

The content.md + license.md are the same as docker/server/README.md in ClickHouse/ClickHouse#63400

@tianon
Copy link
Member

tianon commented Nov 7, 2024

Close/reopen to retrigger fresh GHA checks 👍

@tianon tianon closed this Nov 7, 2024
@tianon tianon reopened this Nov 7, 2024
@Felixoid
Copy link
Contributor Author

Felixoid commented Nov 7, 2024

It looks like I missed some metadata.json there. I'll read what it is.

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

CI is complaining about metadata.json, which is new since you opened this -- I think something like the following is probably the contents you'll want, but if you'd rather just leave that I'm happy to ignore the failing CI and take care of that myself out-of-band (your choice):

{
  "hub": {
    "categories": [
      "databases-and-storage"
    ]
  }
}

clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
### connect to it from a native client

```bash
docker run -it --rm --link some-clickhouse-server:clickhouse-server --entrypoint clickhouse-client clickhouse/clickhouse-server --host clickhouse-server
Copy link
Member

Choose a reason for hiding this comment

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

I would not recommend adding new documentation referencing --link (it is deprecated; see https://docs.docker.com/engine/network/links/ and #1441), but it's up to you -- the image reference needs to be correct though:

Suggested change
docker run -it --rm --link some-clickhouse-server:clickhouse-server --entrypoint clickhouse-client clickhouse/clickhouse-server --host clickhouse-server
docker run -it --rm --link some-clickhouse-server:clickhouse-server --entrypoint clickhouse-client %%IMAGE%% --host clickhouse-server

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Getting rid of --link would require some good replacement, and off the top of my head, the docker network juggling doesn't give an easy-to-use alternative.

Can you suggest something here?

Copy link
Member

Choose a reason for hiding this comment

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

#1441 was the best I could come up with (without having a common blurb for every image trying to explain Docker Networks), but it's very "go read the manual" so I'm not super happy about it either (I really like the --link feature, fwiw 😭)

If you'd rather keep --link that is OK 👍

Comment on lines +23 to +24
- The amd64 image requires support for [SSE3 instructions](https://en.wikipedia.org/wiki/SSE3). Virtually all x86 CPUs after 2005 support SSE3.
- The arm64 image requires support for the [ARMv8.2-A architecture](https://en.wikipedia.org/wiki/AArch64#ARMv8.2-A) and additionally the Load-Acquire RCpc register. The register is optional in version ARMv8.2-A and mandatory in [ARMv8.3-A](https://en.wikipedia.org/wiki/AArch64#ARMv8.3-A). Supported in Graviton >=2, Azure and GCP instances. Examples for unsupported devices are Raspberry Pi 4 (ARMv8.0-A) and Jetson AGX Xavier/Orin (ARMv8.2-A).
Copy link
Member

Choose a reason for hiding this comment

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

As the author of opencontainers/image-spec@2d95dde, I love this -- I wish we had a way to specify that the amd64 image variant should be v2 (corresponding to the lowest level with SSE3) and the arm64 variant could be v8.2, but we don't currently have a way to specify either in our system and the latter would break folks (until containerd/platforms#8 and similar trickle down to popular runtimes), so for now I'm just happy to see it documented explicitly (hopefully ClickHouse also reports a clear error when these are missing). 😄 ❤️

clickhouse/content.md Outdated Show resolved Hide resolved
Comment on lines +107 to +111
They are optional and can be enabled using the following [docker command-line arguments](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities):

```bash
docker run -d \
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
Copy link
Member

Choose a reason for hiding this comment

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

Given that they're optional, you don't happen to have any documentation about what each of these are used for and when/why users might want to set them (specific to ClickHouse behavior), do you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, is this URL worth adding here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The line is added below:

Read more in [knowledge base](https://clickhouse.com/docs/knowledgebase/configure_cap_ipc_lock_and_cap_sys_nice_in_docker).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, for sure! I wonder if it could be improved to explain why, but that's not a blocker at all, just something I think would be useful. 😄 ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a part of the ClickHouse logs related to the capabilities on the KB page:

2023.04.19 08:04:10.022720 [ 1 ] {} <Information> Application: It looks like the process has no CAP_IPC_LOCK capability, binary mlock will be disabled. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_ipc_lock=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.

2023.04.19 08:04:10.065860 [ 1 ] {} <Information> Application: It looks like the process has no CAP_SYS_NICE capability, the setting 'os_thread_priority' will have no effect. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_sys_nice=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.

Should I add it as well explicitly?

Copy link
Member

Choose a reason for hiding this comment

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

Naw, I think what you've got now is fine. 👍

clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Felixoid Felixoid left a comment

Choose a reason for hiding this comment

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

For the rest, I'll try to build a limited version of your update.sh in our repo to have compatibility between repos. Will be back in a moment

clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
Comment on lines +107 to +111
They are optional and can be enabled using the following [docker command-line arguments](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities):

```bash
docker run -d \
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, is this URL worth adding here?

clickhouse/content.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Felixoid Felixoid left a comment

Choose a reason for hiding this comment

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

The --link is only question, I think

clickhouse/content.md Outdated Show resolved Hide resolved
### connect to it from a native client

```bash
docker run -it --rm --link some-clickhouse-server:clickhouse-server --entrypoint clickhouse-client clickhouse/clickhouse-server --host clickhouse-server
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Getting rid of --link would require some good replacement, and off the top of my head, the docker network juggling doesn't give an easy-to-use alternative.

Can you suggest something here?

Comment on lines +107 to +111
They are optional and can be enabled using the following [docker command-line arguments](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities):

```bash
docker run -d \
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The line is added below:

Read more in [knowledge base](https://clickhouse.com/docs/knowledgebase/configure_cap_ipc_lock_and_cap_sys_nice_in_docker).

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

Only a couple really minor things 👀

clickhouse/content.md Outdated Show resolved Hide resolved
clickhouse/content.md Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
https://github.com/ClickHouse/docker-library
Copy link
Member

Choose a reason for hiding this comment

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

Mostly an FYI, this will get used for things like links in the "Quick Reference" section to GitHub issues -- is this where you want users to file issues related to the image, or would you rather they go to ClickHouse/ClickHouse? (do you plan to keep issues enabled on the docker-library repository?)

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 misinterpret the readme, it should be the ClickHouse/ClickHouse for sure

@Felixoid
Copy link
Contributor Author

Felixoid commented Nov 8, 2024

Oh, my chaos, my chaos, my chaos! Did we finish it? What's next?

I am so excited ^_^

@tianon
Copy link
Member

tianon commented Nov 8, 2024

(as noted in docker-library/official-images#15846 (comment), just waiting for @yosifkit to give me another set of eyes 🤞)

@yosifkit yosifkit merged commit 007e320 into docker-library:master Nov 8, 2024
6 checks passed
@Felixoid
Copy link
Contributor Author

Felixoid commented Nov 9, 2024

@tianon "funny" aftermath. I haven't found that the 24.10 is built on top of jammy, AKA 22.04, so the https://github.com/docker-library/docs/pull/2397/files#diff-6a2321fc3b812fb166b7184bef1475db0c18919ad2612b02e06429f4cc986fc4R17 is not valid. I'll fix it in the follow-up PR to the library, where I will make this version FROM ubuntu:20.04.

update: addressed the issue with 24.10's base in docker-library/official-images#17876

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