pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[improve][pip] PIP-324: Alpine image

Open merlimat opened this issue 1 year ago • 1 comments

PIP: PIP-324

Modifications

Changed the base Docker image from Ubuntu to Alpine.

Example Docker image: merlimat/pulsar:3.3.0-SNAPSHOT-f2a91a1

https://hub.docker.com/layers/merlimat/pulsar/3.3.0-SNAPSHOT-f2a91a1/images/sha256-723cda334135f93b366bd51920795b911e5412a55b0f4436fb81762a747dd6ec?context=explore

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • [ ] Dependencies (add or upgrade a dependency)
  • [ ] The public API
  • [ ] The schema
  • [ ] The default values of configurations
  • [ ] The threading model
  • [ ] The binary protocol
  • [ ] The REST endpoints
  • [ ] The admin CLI options
  • [ ] The metrics
  • [x] Anything that affects deployment

Documentation

  • [ ] doc
  • [ ] doc-required
  • [X] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: https://github.com/merlimat/pulsar/pull/7

merlimat avatar Feb 14 '24 18:02 merlimat

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (beed0cf) 73.64% compared to head (f2a91a1) 73.60%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22054      +/-   ##
============================================
- Coverage     73.64%   73.60%   -0.04%     
- Complexity    32077    32568     +491     
============================================
  Files          1874     1874              
  Lines        139220   139220              
  Branches      15260    15260              
============================================
- Hits         102523   102477      -46     
- Misses        28776    28834      +58     
+ Partials       7921     7909      -12     
Flag Coverage Δ
inttests 24.70% <ø> (-0.07%) :arrow_down:
systests 24.32% <ø> (-0.12%) :arrow_down:
unittests 72.88% <ø> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

see 65 files with indirect coverage changes

codecov-commenter avatar Feb 14 '24 20:02 codecov-commenter

@lhotari PTAL again. I've updated the build to rely on pre-built glibc packages. The packages are going to be included in Docker image for which the Dockerfile is included here and that will be published to the apachepulsar org.

merlimat avatar Mar 04 '24 20:03 merlimat

@merlimat the pulsar image based on the alpine image is unable to start normally, this issue blocks 3.3.0 release, can you take a look?

It seems that the directory cannot be created using file.mkdirs()

docker run -it \
-p 6650:6650 \
-p 8080:8080 \
merlimat/pulsar:3.3.0-SNAPSHOT-f2a91a1 \
bin/pulsar standalone
2024-05-17T03:13:58,328+0000 [main] INFO  org.apache.pulsar.broker.PulsarService - Function worker service started
2024-05-17T03:13:58,330+0000 [main] ERROR org.apache.pulsar.broker.PulsarService - Failed to start Pulsar service: Failed to create base storage directory at packages-storage
java.lang.RuntimeException: Failed to create base storage directory at packages-storage
	at org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorage.initialize(FileSystemPackagesStorage.java:75) ~[org.apache.pulsar-pulsar-package-filesystem-storage-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.broker.PulsarService.startPackagesManagementService(PulsarService.java:1788) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:922) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:349) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:149) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
2024-05-17T03:13:58,336+0000 [main] ERROR org.apache.pulsar.PulsarStandaloneStarter - Failed to start pulsar service.
org.apache.pulsar.broker.PulsarServerException: java.lang.RuntimeException: Failed to create base storage directory at packages-storage
	at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:955) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:349) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:149) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
Caused by: java.lang.RuntimeException: Failed to create base storage directory at packages-storage
	at org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorage.initialize(FileSystemPackagesStorage.java:75) ~[org.apache.pulsar-pulsar-package-filesystem-storage-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.broker.PulsarService.startPackagesManagementService(PulsarService.java:1788) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:922) ~[org.apache.pulsar-pulsar-broker-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	... 2 more

coderzc avatar May 17 '24 03:05 coderzc

I found that there is no permission to create files or directory under '/pulsar'

/pulsar $ mkdir test
mkdir: can't create directory 'test': Permission denied

/pulsar $ touch test
touch: test: Permission denied

coderzc avatar May 17 '24 03:05 coderzc

I found that there is no permission to create files or directory under '/pulsar'

/pulsar $ mkdir test
mkdir: can't create directory 'test': Permission denied

/pulsar $ touch test
touch: test: Permission denied

This is intentional so that the image can be run with restricted permissions (read only rootfs). The writable directories should be created while building the image (for read only rootfs restricted deployments, those would have to be volumes).

lhotari avatar May 17 '24 05:05 lhotari