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

feat: Update docker image to Apache Pulsar 4.0 LTS #1294

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Testcontainers.Pulsar/PulsarBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Testcontainers.Pulsar;
[PublicAPI]
public sealed class PulsarBuilder : ContainerBuilder<PulsarBuilder, PulsarContainer, PulsarConfiguration>
{
public const string PulsarImage = "apachepulsar/pulsar:3.0.6";
public const string PulsarImage = "apachepulsar/pulsar:4.0.0";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public const string PulsarImage = "apachepulsar/pulsar:4.0.0";
public const string PulsarImage = "apachepulsar/pulsar:3.0.6";

As mentioned in the issue, we don't update the image version unless it is absolutely necessary. We try to maintain backward compatibility.


public const ushort PulsarBrokerDataPort = 6650;

Expand Down Expand Up @@ -87,6 +87,7 @@ protected override PulsarBuilder Init()
.WithPortBinding(PulsarBrokerDataPort, true)
.WithPortBinding(PulsarWebServicePort, true)
.WithFunctionsWorker(false)
.WithCreateParameterModifier(parameterModifier => parameterModifier.User = "root")
Copy link
Collaborator

@HofmeisterAn HofmeisterAn Nov 13, 2024

Choose a reason for hiding this comment

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

If this issue is just about permission changes, can't we store the key somewhere else? For example, SecretKeyFilePath = "/pulsar/data/.pulsar/secret.key" should work. This makes the change in PulsarContainer unnecessary too.

.WithEntrypoint("/bin/sh", "-c")
.WithCommand("while [ ! -f " + StartupScriptFilePath + " ]; do sleep 0.1; done; " + StartupScriptFilePath)
.WithStartupCallback((container, ct) => container.CopyStartupScriptAsync(ct));
Expand Down
3 changes: 1 addition & 2 deletions src/Testcontainers.Pulsar/PulsarContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ internal Task CopyStartupScriptAsync(CancellationToken ct = default)

if (_configuration.AuthenticationEnabled.HasValue && _configuration.AuthenticationEnabled.Value)
{
startupScript.WriteLine("bin/pulsar tokens create-secret-key --output " + PulsarBuilder.SecretKeyFilePath);
startupScript.WriteLine("bin/pulsar tokens create-secret-key --output secret.key");
startupScript.WriteLine("export brokerClientAuthenticationParameters=token:$(bin/pulsar tokens create --secret-key $PULSAR_PREFIX_tokenSecretKey --subject $superUserRoles)");
startupScript.WriteLine("export CLIENT_PREFIX_authParams=$brokerClientAuthenticationParameters");
startupScript.WriteLine("bin/apply-config-from-env.py conf/standalone.conf");
startupScript.WriteLine("bin/apply-config-from-env-with-prefix.py CLIENT_PREFIX_ conf/client.conf");
}

startupScript.Write("bin/pulsar standalone");
Expand Down