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

docker: fixes native library config #3738

Merged
merged 2 commits into from
Feb 26, 2024
Merged

docker: fixes native library config #3738

merged 2 commits into from
Feb 26, 2024

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Feb 26, 2024

This pares down the native libraries on our docker zipkin images to only those needed by linux and the target architecture.

This also improves the zipkin-slim image by correcting its accidental inclusion of cassandra dependencies, and enabling netty tcnative

Current zipkin arm64: note: unrelated os and archs

$ docker run --rm --entrypoint=/bin/sh ghcr.io/openzipkin/zipkin:master -c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*'
20	netty-resolver-dns-native-macos-4.1.106.Final-osx-aarch_64.jar
1100	netty-tcnative-boringssl-static-2.0.63.Final-linux-aarch_64.jar
976	netty-tcnative-boringssl-static-2.0.63.Final-osx-aarch_64.jar
44	netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
28	netty-transport-native-kqueue-4.1.106.Final-osx-aarch_64.jar
76	netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-osx-aarch_64.jar
216	jnr-x86asm-1.0.2.jar
420	native-linux-x86_64-1.15.0.jar
20	netty-resolver-dns-native-macos-4.1.106.Final-osx-x86_64.jar
1188	netty-tcnative-boringssl-static-2.0.63.Final-linux-x86_64.jar
1088	netty-tcnative-boringssl-static-2.0.63.Final-osx-x86_64.jar
976	netty-tcnative-boringssl-static-2.0.63.Final-windows-x86_64.jar
40	netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
28	netty-transport-native-kqueue-4.1.106.Final-osx-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-osx-x86_64.jar
88	jnr-a64asm-1.0.0.jar

New zipkin arm64:

$ docker run --rm --entrypoint=/bin/sh openzipkin/zipkin:test -c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*'
1100	netty-tcnative-boringssl-static-2.0.63.Final-linux-aarch_64.jar
44	netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
76	netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
88	jnr-a64asm-1.0.0.jar
du: *x86*: No such file or directory

New zipkin amd64:

du: *aarch*: No such file or directory
du: *a64*: No such file or directory
216	jnr-x86asm-1.0.2.jar
420	native-linux-x86_64-1.15.0.jar
1188	netty-tcnative-boringssl-static-2.0.63.Final-linux-x86_64.jar
40	netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar

Current zipkin-slim (note: no boringssl, also extra junk from cassandra)

$ docker run --rm --entrypoint=/bin/sh ghcr.io/openzipkin/zipkin-slim:master -c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*'
20	netty-resolver-dns-native-macos-4.1.106.Final-osx-aarch_64.jar
44	netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
28	netty-transport-native-kqueue-4.1.106.Final-osx-aarch_64.jar
76	netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-osx-aarch_64.jar
420	native-linux-x86_64-1.15.0.jar
20	netty-resolver-dns-native-macos-4.1.106.Final-osx-x86_64.jar
40	netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
28	netty-transport-native-kqueue-4.1.106.Final-osx-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-osx-x86_64.jar
du: *a64*: No such file or directory

New zipkin-slim arm64:

$ docker run --rm --entrypoint=/bin/sh openzipkin/zipkin-slim:test -c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*'
1100	netty-tcnative-boringssl-static-2.0.63.Final-linux-aarch_64.jar
44	netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
76	netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
88	jnr-a64asm-1.0.0.jar

New zipkin-slim amd64:

du: *aarch*: No such file or directory
420	native-linux-x86_64-1.15.0.jar
1188	netty-tcnative-boringssl-static-2.0.63.Final-linux-x86_64.jar
40	netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
72	netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar

Adrian Cole added 2 commits February 26, 2024 17:20
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
@codefromthecrypt codefromthecrypt marked this pull request as ready for review February 26, 2024 09:36
@codefromthecrypt
Copy link
Member Author

s390x and ppcle aren't built on PR, but I think my logic is sound (delete unless). The easiest way to test this is for me to inspect the images (I use car) post merge for the master tag and post back or do a PR if it didn't work out. My machine is arm64 so I can't build for another arch locally.

@codefromthecrypt
Copy link
Member Author

like this is not terrible, but not ideal. post-merge this should be fixed as in nothing returns

$ ~/oss/car/build/car_darwin_arm64/car --platform linux/s390x -tvf ghcr.io/openzipkin/zipkin-slim:master 'zipkin/BOOT-INF/lib/*aarch*' 'zipkin/BOOT-INF/lib/*x86*' 'zipkin/BOOT-INF/lib/*a64*'
-rw-r--r--	426917	Dec 29 13:42:54	zipkin/BOOT-INF/lib/native-linux-x86_64-1.15.0.jar
-rw-r--r--	19577	Jan 19 20:17:42	zipkin/BOOT-INF/lib/netty-resolver-dns-native-macos-4.1.106.Final-osx-aarch_64.jar
-rw-r--r--	19310	Jan 19 20:27:40	zipkin/BOOT-INF/lib/netty-resolver-dns-native-macos-4.1.106.Final-osx-x86_64.jar
-rw-r--r--	41240	Jan 19 19:02:14	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
-rw-r--r--	39722	Jan 19 19:03:06	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
-rw-r--r--	25617	Jan 19 20:18:00	zipkin/BOOT-INF/lib/netty-transport-native-kqueue-4.1.106.Final-osx-aarch_64.jar
-rw-r--r--	25057	Jan 19 20:28:08	zipkin/BOOT-INF/lib/netty-transport-native-kqueue-4.1.106.Final-osx-x86_64.jar
-rw-r--r--	74633	Jan 19 19:01:28	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
-rw-r--r--	73403	Jan 19 19:01:12	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar
-rw-r--r--	72539	Jan 19 20:16:54	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-osx-aarch_64.jar
-rw-r--r--	71019	Jan 19 20:26:30	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-osx-x86_64.jar
error: zipkin/BOOT-INF/lib/*a64* not found in layer

@codefromthecrypt
Copy link
Member Author

I'm going to merge and then post back each of the image dimension results post push of the docker master tags

@codefromthecrypt codefromthecrypt merged commit 09c523d into master Feb 26, 2024
13 checks passed
@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Feb 26, 2024

verified

$ for image in zipkin zipkin-slim; do for arch in amd64 arm64 s390x ppc64le;do echo $image $arch; ~/oss/car/build/car_darwin_arm64/car --platform linux/$arch -tvf ghcr.io/openzipkin/$image:master 'zipkin/BOOT-INF/lib/*aarch*' 'zipkin/BOOT-INF/lib/*x86*' 'zipkin/BOOT-INF/lib/*a64*';done;done
zipkin amd64
-rw-r--r--	219943	Apr  7 20:49:22	zipkin/BOOT-INF/lib/jnr-x86asm-1.0.2.jar
-rw-r--r--	426917	Dec 29 13:42:54	zipkin/BOOT-INF/lib/native-linux-x86_64-1.15.0.jar
-rw-r--r--	1214744	Feb 20 18:50:36	zipkin/BOOT-INF/lib/netty-tcnative-boringssl-static-2.0.63.Final-linux-x86_64.jar
-rw-r--r--	39722	Jan 19 19:03:06	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
-rw-r--r--	73403	Jan 19 19:01:12	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar
error: zipkin/BOOT-INF/lib/*aarch*, zipkin/BOOT-INF/lib/*a64* not found in layer
zipkin arm64
-rw-r--r--	86270	Sep  6 13:05:36	zipkin/BOOT-INF/lib/jnr-a64asm-1.0.0.jar
-rw-r--r--	1123785	Feb 20 18:48:02	zipkin/BOOT-INF/lib/netty-tcnative-boringssl-static-2.0.63.Final-linux-aarch_64.jar
-rw-r--r--	41240	Jan 19 19:02:14	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
-rw-r--r--	74633	Jan 19 19:01:28	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
error: zipkin/BOOT-INF/lib/*x86* not found in layer
zipkin s390x
error: zipkin/BOOT-INF/lib/*aarch*, zipkin/BOOT-INF/lib/*x86*, zipkin/BOOT-INF/lib/*a64* not found in layer
zipkin ppc64le
error: zipkin/BOOT-INF/lib/*aarch*, zipkin/BOOT-INF/lib/*x86*, zipkin/BOOT-INF/lib/*a64* not found in layer
zipkin-slim amd64
-rw-r--r--	426917	Dec 29 13:42:54	zipkin/BOOT-INF/lib/native-linux-x86_64-1.15.0.jar
-rw-r--r--	1214744	Feb 26 19:21:55	zipkin/BOOT-INF/lib/netty-tcnative-boringssl-static-2.0.63.Final-linux-x86_64.jar
-rw-r--r--	39722	Jan 19 19:03:06	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-x86_64.jar
-rw-r--r--	73403	Jan 19 19:01:12	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-x86_64.jar
error: zipkin/BOOT-INF/lib/*a64*, zipkin/BOOT-INF/lib/*aarch* not found in layer
zipkin-slim arm64
-rw-r--r--	1123785	Feb 26 19:22:08	zipkin/BOOT-INF/lib/netty-tcnative-boringssl-static-2.0.63.Final-linux-aarch_64.jar
-rw-r--r--	41240	Jan 19 19:02:14	zipkin/BOOT-INF/lib/netty-transport-native-epoll-4.1.106.Final-linux-aarch_64.jar
-rw-r--r--	74633	Jan 19 19:01:28	zipkin/BOOT-INF/lib/netty-transport-native-unix-common-4.1.106.Final-linux-aarch_64.jar
error: zipkin/BOOT-INF/lib/*x86*, zipkin/BOOT-INF/lib/*a64* not found in layer
zipkin-slim s390x
error: zipkin/BOOT-INF/lib/*aarch*, zipkin/BOOT-INF/lib/*x86*, zipkin/BOOT-INF/lib/*a64* not found in layer
zipkin-slim ppc64le
error: zipkin/BOOT-INF/lib/*aarch*, zipkin/BOOT-INF/lib/*x86*, zipkin/BOOT-INF/lib/*a64* not found in layer
$ TAG=master docker-compose -f docker-compose-cassandra.yml -f docker-compose-example.yml up
WARN[0000] Found orphan containers ([eureka]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 6/2
 ✔ Network examples_default  Created                                                                                                                               0.0s 
 ✔ Container cassandra       Created                                                                                                                               0.1s 
 ✔ Container dependencies    Created                                                                                                                               0.0s 
 ✔ Container zipkin          Created                                                                                                                               0.0s 
 ✔ Container backend         Created                                                                                                                               0.0s 
 ✔ Container frontend        Created                                                                                                                               0.0s 
Attaching to backend, cassandra, dependencies, frontend, zipkin
cassandra     | Starting Cassandra
cassandra     | WARNING: package jdk.internal.util.jar not in java.base
cassandra     | [2024-02-26 11:44:22,479] WARN [commitlog_sync_period_in_ms, enable_sasi_indexes] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt (org.apache.cassandra.config.YamlConfigurationLoader)
cassandra     | [2024-02-26 11:44:22,817] WARN [commitlog_sync_period_in_ms, enable_sasi_indexes] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt (org.apache.cassandra.config.YamlConfigurationLoader)
cassandra     | WARNING: A terminally deprecated method in java.lang.System has been called
cassandra     | WARNING: System::setSecurityManager has been called by org.apache.cassandra.security.ThreadAwareSecurityManager (file:/cassandra/lib/cassandra-all-4.1.4.jar)
cassandra     | WARNING: Please consider reporting this to the maintainers of org.apache.cassandra.security.ThreadAwareSecurityManager
cassandra     | WARNING: System::setSecurityManager will be removed in a future release
cassandra     | [2024-02-26 11:44:24,493] WARN [commitlog_sync_period_in_ms, enable_sasi_indexes] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt (org.apache.cassandra.config.YamlConfigurationLoader)
cassandra     | [2024-02-26 11:44:24,498] WARN [commitlog_sync_period_in_ms, enable_sasi_indexes] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt (org.apache.cassandra.config.YamlConfigurationLoader)
cassandra     | [2024-02-26 11:44:24,528] WARN [commitlog_sync_period_in_ms, enable_sasi_indexes] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt (org.apache.cassandra.config.YamlConfigurationLoader)
backend       | 11:44:34.369 [main] [] [/] INFO  brave.example.HttpTracingFactory - Using zipkin URI: http://zipkin:9411//api/v2/spans
zipkin        | 
zipkin        |                   oo
zipkin        |                  oooo
zipkin        |                 oooooo
zipkin        |                oooooooo
zipkin        |               oooooooooo
zipkin        |              oooooooooooo
zipkin        |            ooooooo  ooooooo
zipkin        |           oooooo     ooooooo
zipkin        |          oooooo       ooooooo
zipkin        |         oooooo   o  o   oooooo
zipkin        |        oooooo   oo  oo   oooooo
zipkin        |      ooooooo  oooo  oooo  ooooooo
zipkin        |     oooooo   ooooo  ooooo  ooooooo
zipkin        |    oooooo   oooooo  oooooo  ooooooo
zipkin        |   oooooooo      oo  oo      oooooooo
zipkin        |   ooooooooooooo oo  oo ooooooooooooo
zipkin        |       oooooooooooo  oooooooooooo
zipkin        |           oooooooo  oooooooo
zipkin        |               oooo  oooo
zipkin        | 
zipkin        |      ________ ____  _  _____ _   _
zipkin        |     |__  /_ _|  _ \| |/ /_ _| \ | |
zipkin        |       / / | || |_) | ' / | ||  \| |
zipkin        |      / /_ | ||  __/| . \ | || |\  |
zipkin        |     |____|___|_|   |_|\_\___|_| \_|
zipkin        | 
zipkin        | :: version 3.1.0-SNAPSHOT :: commit 09c523d ::
zipkin        | 
backend       | 11:44:35.410 [armeria-boss-http-*:9000] [] [/] INFO  com.linecorp.armeria.server.Server - Serving HTTP at /0.0.0.0:9000 - http://127.0.0.1:9000/
zipkin        | 2024-02-26T11:44:36.372Z  INFO [/] 1 --- [oss-http-*:9411] c.l.a.s.Server                           : Serving HTTP at /0.0.0.0:9411 - http://127.0.0.1:9411/
frontend      | 11:44:37.019 [main] [] [/] INFO  brave.example.HttpTracingFactory - Using zipkin URI: http://zipkin:9411//api/v2/spans
frontend      | 11:44:37.490 [main] [] [/] INFO  brave.example.Frontend - Using backend endpoint: http://backend:9000/api
frontend      | 11:44:37.584 [armeria-boss-http-*:8081] [] [/] INFO  com.linecorp.armeria.server.Server - Serving HTTP at /0.0.0.0:8081 - http://127.0.0.1:8081/
zipkin        | 2024-02-26T11:44:39.124Z  INFO [/] 1 --- [cking-tasks-2-1] c.d.o.d.i.c.c.CqlPrepareAsyncProcessor   : Adding handler to invalidate cached prepared statements on type changes
backend       | [cb5b799770a7dafb/d9f1bf9de62d7d66] 192.168.160.6 - - 26/Feb/2024:11:44:45 +0000 "GET /api#Backend$$Lambda/0x00000001003323c0 h2c" 200 28
frontend      | [cb5b799770a7dafb/cb5b799770a7dafb] 192.168.160.1 - - 26/Feb/2024:11:44:45 +0000 "GET /#Frontend$$Lambda/0x00000001003355e8 h1c" 200 28

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.

1 participant