-
Notifications
You must be signed in to change notification settings - Fork 575
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
[release/9.1] Ensure EH and SB emulator files can be used from non-root containers #7765
base: release/9.1
Are you sure you want to change the base?
Conversation
We decided to punt this for now until we hear more feedback |
cherrypicked in 0cc7553 also we want to build a 9.1.1 of this. it crosses several packages, I assume we only update the changed ones. |
|
Pushed a commit to update branding to 9.1.1-servicing |
Blocked on ack from 1P team. |
tests/Aspire.Hosting.Azure.Tests/AzureServiceBusExtensionsTests.cs
Outdated
Show resolved
Hide resolved
Please don't merge yet, looking into a regression on windows after the change in Sql Server. @danmoseley @wtgodbe |
I pushed a fix that will work on windows and linux until I get an official guidance from the SQL team. This also makes the code behave the same way it was on 9.1 with Windows. |
public static IResourceBuilder<SqlServerServerResource> WithDataBindMount(this IResourceBuilder<SqlServerServerResource> builder, string source, bool isReadOnly = false) | ||
{ | ||
ArgumentNullException.ThrowIfNull(builder); | ||
ArgumentException.ThrowIfNullOrEmpty(source); | ||
|
||
// c.f. https://learn.microsoft.com/sql/linux/sql-server-linux-docker-container-configure?view=sql-server-ver15&pivots=cs1-bash#mount-a-host-directory-as-data-volume |
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.
@sebastienros - What do you think about not porting this change at all for release/9.1?
I think the risk here isn't worth it. Sql emulator in 9.1 currently "works" as it did in 9.0 right? So we are only adding risk here. I think we should keep this change targeted to the broken scenarios.
I'm sorry if this is the wrong place to comment for a user, but I'm waiting eagerly for a fix for #7764 The error I get is:
|
You can mitigate the issue with this code: public static IResourceBuilder<AzureEventHubsResource> FixUnixFilePermissions(this IResourceBuilder<AzureEventHubsResource> builder)
{
builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, ct) =>
{
const string EmulatorConfigJsonPath = "/Eventhubs_Emulator/ConfigFiles/Config.json";
var mountAnnotation = builder.Resource.Annotations.OfType<ContainerMountAnnotation>().FirstOrDefault(v => v.Target == EmulatorConfigJsonPath);
if (mountAnnotation is null)
{
return Task.CompletedTask;
}
const UnixFileMode fileMode644 = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead | UnixFileMode.OtherRead;
if (!OperatingSystem.IsWindows())
{
File.SetUnixFileMode(mountAnnotation.Source!, fileMode644);
}
return Task.CompletedTask;
});
return builder;
} And invoke it "after" calling |
Backport of #7764 to release/9.1
/cc @sebastienros
Customer Impact
Event Hubs emulator (and potentially Service Bus emulator) will fail on Linux if the default Aspire Store location is not patched.
This PR sets the configuration file mode with the correct permissions so that the non-root container can access the file.
Testing
Risk
Regression?