asynkron / TraceLens

140 stars 2 forks source link

How to run the docker image? (getting .NET framework mistmatch) #2

Closed gjermystreeva closed 4 months ago

gjermystreeva commented 10 months ago

Hi @rogeralsing - I'd like to trial using the tracelens project.

Unfortunately I've tried running up the amd64 docker image and currently am getting error below.

Am I missing something / using the wrong version? Is there a different image I should be referencing.

Note currently I'm using docker.io/rogeralsing/tracelens:amd64

2023-09-21 18:01:37 You must install or update .NET to run this application.
2023-09-21 18:01:37 
2023-09-21 18:01:37 App: /app/TraceLens.Server.dll
2023-09-21 18:01:37 Architecture: x64
2023-09-21 18:01:37 Framework: 'Microsoft.NETCore.App', version '8.0.0-preview.4.23259.5' (x64)
2023-09-21 18:01:37 .NET location: /usr/share/dotnet/
2023-09-21 18:01:37 
2023-09-21 18:01:37 The following frameworks were found:
2023-09-21 18:01:37   7.0.5 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
2023-09-21 18:01:37 
2023-09-21 18:01:37 Learn about framework resolution:
2023-09-21 18:01:37 https://aka.ms/dotnet/app-launch-failed
2023-09-21 18:01:37 
2023-09-21 18:01:37 To install missing framework, download:
2023-09-21 18:01:37 https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0-preview.4.23259.5&arch=x64&rid=debian.11-x64

Thanks for any assistance.

rogeralsing commented 10 months ago

Hey @gjermystreeva . let me get back to you on this tomorrow. I've been fiddling with multi-target builds so I think that should start working soon. e.g. you don't have to choose a platform.

gjermystreeva commented 10 months ago

Hey @gjermystreeva . let me get back to you on this tomorrow. I've been fiddling with multi-target builds so I think that should start working soon. e.g. you don't have to choose a platform.

Ok thanks, but just to confirm all I'm initially trying to do is run up the docker image docker.io/rogeralsing/tracelens:amd64. I did try installing missing .net within it but then on running seemed to be looking for a localhost postgres endpoint. If there is a different image to try I will give better feedback.

bjorkstromm commented 9 months ago

Image seems to be using ASP.NET 7 as base, although 8.0 Preview 4 seems to be required. As a workaround I built my own image using 8.0 Preview 4 as base and just copied the app from tracelens image

Here's the Dockerfile if anyone's interested.

FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-preview.4 AS base
WORKDIR /app
EXPOSE 5001
EXPOSE 4317

FROM docker.io/rogeralsing/tracelens:amd64 AS build
WORKDIR /app

FROM base AS final
ENV ASPNETCORE_URLS=http://*:5001;http://*:4317
WORKDIR /app
COPY --from=build /app/ .
ENTRYPOINT ["dotnet", "TraceLens.Server.dll"]

I'm however now also stuck on the same Postgres stage as @gjermystreeva. Any documentation on how to set this up?

fail: TraceLens.Data.ModelRepo[0]
      Failed to write spans
      Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
       ---> System.Net.Sockets.SocketException (111): Connection refused
         at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
         at Npgsql.TaskTimeoutAndCancellation.ExecuteAsync(Func`2 getTaskFunc, NpgsqlTimeout timeout, CancellationToken cancellationToken)
         at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
         at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
         at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
         at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|215_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
         at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
         at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
         at Npgsql.PoolingDataSource.<Get>g__RentAsync|28_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
         at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
         at TraceLens.Data.ModelRepo.SaveTrace(SpanWithService[] chunk) in /Users/rogerjohansson/git/traceview/TraceLens.Server/Data/ModelRepo.cs:line 250
rogeralsing commented 9 months ago

I'm a bit stuck upgrading everything here. I have managed to get a cross platform build, so you will be able to just run :latest tag instead of picking a platform.

But while upgrading, there are some code issues I need to resolve first. stay tuned

rogeralsing commented 7 months ago

I´ve published a new docker compose file and fresh builds for the cross platform support.

https://github.com/asynkron/TraceLens/blob/main/docker-compose.yml