Xabaril / Esquio

Esquio is a Feature Toggle Library for .NET Developers.
Apache License 2.0
428 stars 49 forks source link

Esquio UI Deployment Issue #186

Closed luisflsmarques closed 3 years ago

luisflsmarques commented 3 years ago

Hi, I have tried to deploy the Esquio UI following instructions on https://esquio.readthedocs.io/en/latest/ui/deployment.html Unfortunately I am unable to deploy it on Kubernetes. When I run the apply command on the proposed yaml file, the pod gives me the error message below. Any idea how to fix this? Unhandled exception. System.IO.DirectoryNotFoundException: /root/.nuget/packages/blazorinputfile/0.2.0/staticwebassets/ at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsFileProvider..ctor(String pathPrefix, String contentRoot) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.b2_0(ContentRootMapping cr) at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) at Microsoft.AspNetCore.WebHost.<>c.b__9_0(WebHostBuilderContext ctx, IConfigurationBuilder cb) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>cDisplayClass9_0.b__0(HostBuilderContext context, IConfigurationBuilder builder) at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Esquio.UI.Host.Program.Main(String[] args) in /src/src/Esquio.UI.Host/Program.cs:line 13

luisflsmarques commented 3 years ago

if I run it with the xabarilcoding/esquioui:3.0.0 image the error is the same - just the reference to the missing file changes: Unhandled exception. System.IO.DirectoryNotFoundException: /root/.nuget/packages/microsoft.aspnetcore.components.webassembly.authentication/3.2.0/staticwebassets/ at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsFileProvider..ctor(String pathPrefix, String contentRoot) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.b2_0(ContentRootMapping cr) at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) at Microsoft.AspNetCore.WebHost.<>c.b__9_0(WebHostBuilderContext ctx, IConfigurationBuilder cb) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>cDisplayClass8_0.b__0(HostBuilderContext context, IConfigurationBuilder builder) at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Esquio.UI.Host.Program.Main(String[] args) in /src/src/Esquio.UI.Host/Program.cs:line 13

unaizorrilla commented 3 years ago

Hi @luisflsmarques

Can you check if this compose works for you?

https://github.com/Xabaril/Esquio/blob/master/build/docker-compose-demo-with-ui-sqlserver.yml

This is the compose we use to tests esquio ui with different db providers.

luisflsmarques commented 3 years ago

Hi there - I was able to run it with that docker-compose docker-compose-demo-with-ui-sqlserver.yml file. So the key differences are that I am trying to run it on my local kubernetes cluster which connects to a MySql instance. For your information, I was able to also successfully run the Esquio.UI.Host web app from within Visual Studio, and changing the appsettings.json file to connect to MySql instance and it created the Esquio.UI schema just fine on the MySql server instance. So, in summary, I am only failing to actually deploy the yml file based on the image you recommend on your documentation (wondering if the right way to do it is to refer to 3.0 specifically or should I just run it as image: "xabarilcoding/esquioui" in the yaml file). In any case, I tried 3.0, 4.0 and latest and no difference, the pod in Kubernetes always shows that error of the missing file. Somehow the image may be missing a file which is present when I run it from Visual studio - perhaps some restore is not being run?

unaizorrilla commented 3 years ago

Hi @luisflsmarques

Here is the compose with mysql

https://github.com/Xabaril/Esquio/blob/master/build/docker-compose-demo-with-ui-mysql.yml

However, let me some time ( at the end of my day ) to check this

luisflsmarques commented 3 years ago

this https://github.com/Xabaril/Esquio/blob/master/build/docker-compose-demo-with-ui-mysql.yml works as well. It is just the problem with deployment on Kubernetes... I am trying a few other things in my attempt to isolate the problem.

luisflsmarques commented 3 years ago

Hi there - just to give you a bit of context - I am helping one of my clients to adopt a good feature flag framework / library. I am evaluating whether to go with Esquio (currently my preference given what I have seen) and Microsoft Feature Flag. I believe Esquio to be superior but I need to make it work in a more enterprise like environment in a scalable robust way. The deployment of the UI / HTTP store to Kubernetes is part of that strategy. I have enjoyed using Esquio so far during my evaluation, so hope i can make this work. If it would help to do a quick screen share so i can show you where I'm hitting a wall, I can easily show you (in case you can't reproduce) or I can share my K8s yaml file if that helps.

unaizorrilla commented 3 years ago

Can you send us a Yaml sample of your Configuration?

luisflsmarques commented 3 years ago

here is the yaml file: esquio-ui-shared.txt

unaizorrilla commented 3 years ago

We are working on this, it is really bizarre! :-( and non sense

JorTurFer commented 3 years ago

Hi @luisflsmarques , I will check this ASAP. This afternoon I think that I can do it.

luisflsmarques commented 3 years ago

Thank you guys - much appreciated. Hope you managed to reproduce the same error as I did :-)

unaizorrilla commented 3 years ago

I just discover the issue, related with docker file, a bit tricky to explain here but build and publish were located on the same folder and this cause the issues related with this static files paths.

we changed the docker file to avoid this problem

RUN dotnet publish -c Release -o /app/publish

A release executing right now and we are changing/updating 5.0.0 and latest tags for esquio ui, please ensure to download the new images on your pull strategy!

https://kubernetes.io/docs/concepts/containers/images/#updating-images

unaizorrilla commented 3 years ago

Please close the issue if this is resolved!

luisflsmarques commented 3 years ago

Fantastic speed resolving this - thank you guys - much appreciated! IT now works flawlessly on my local kubernetes cluster. I will continue evaluating the rest of the feature management features :-).

luisflsmarques commented 3 years ago

just ensure you update your docs to ensure people dont pull 3.0 but pull instead the latest image.

unaizorrilla commented 3 years ago

Yeap, a PR is welcome also :-)

unaizorrilla commented 3 years ago

Fantastic speed resolving this - thank you guys - much appreciated! IT now works flawlessly on my local kubernetes cluster. I will continue evaluating the rest of the feature management features :-).

Any feedback is welcome!