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

Docker image does not work for ARM chips #464

Open
alysivji opened this issue Apr 22, 2022 · 3 comments
Open

Docker image does not work for ARM chips #464

alysivji opened this issue Apr 22, 2022 · 3 comments

Comments

@alysivji
Copy link

Describe the bug

The R4 Docker image, sparkfhir/spark:r4-latest, does not work for ARM chips. (I would assume the same is true for STU3 and DSTU2, but I have not tested it)

To Reproduce
Steps to reproduce the behavior:

  1. Use an Apple Silicon mac and try to bring up a container using the latest R4 image
curl 'https://raw.githubusercontent.com/FirelyTeam/spark/r4/master/.docker/docker-compose.example.yml' > docker-compose.yml
docker-compose up

Container starts, but logs show that qemu has an error. qemu is the Arm system emulator.

spark_1    | Unhandled exception. System.IO.IOException: Function not implemented
spark_1    |    at System.IO.FileSystemWatcher.StartRaisingEvents()
spark_1    |    at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
spark_1    |    at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
spark_1    |    at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
spark_1    |    at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
spark_1    |    at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
spark_1    |    at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0()
spark_1    |    at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
spark_1    |    at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
spark_1    |    at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
spark_1    |    at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
spark_1    |    at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
spark_1    |    at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
spark_1    |    at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
spark_1    |    at Spark.Web.Program.Main(String[] args) in /src/Spark.Web/Program.cs:line 17
spark_1    | qemu: uncaught target signal 6 (Aborted) - core dumped

Expected behavior

Server should start without an error.

Screenshots

n/a

Spark version

  • Version: 1.5.11

Operating system + Database

  • OS: MacOS on Apple Silicon
  • Database: MongoDB

Container service / Cloud infrastructure:
n/a

Additional context

I was able to build a working image using the following Dockerfile:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.24-buster-slim-arm64v8 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1.418-buster-arm64v8 AS build
WORKDIR /src
COPY ["./src/Spark.Web/Spark.Web.csproj", "Spark.Web/Spark.Web.csproj"]
COPY ["./src/Spark.Engine/Spark.Engine.csproj", "Spark.Engine/Spark.Engine.csproj"]
COPY ["./src/Spark.Mongo/Spark.Mongo.csproj", "Spark.Mongo/Spark.Mongo.csproj"]
RUN dotnet restore "/src/Spark.Web/Spark.Web.csproj"
COPY ./src .
RUN dotnet build "/src/Spark.Web/Spark.Web.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "/src/Spark.Web/Spark.Web.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .

ENTRYPOINT ["dotnet", "Spark.Web.dll"]

I am temporarily hosting this image on DockerHub (while I work to get a PR in to fix the issue): https://hub.docker.com/repository/docker/alysivji0jasper/sparkfhir-arm

@alysivji
Copy link
Author

I would like to help out and fix this issue. Looks like I will have to make the following changes:

Would I need to make this change 3 times, i.e. once for each of the supported FHIR versions?

@kennethmyhra
Copy link
Collaborator

Hey @alysivji you can make the change one time for the R4 version, then I will forward your changes and do the necessary amendments for the respective FHIR versions.

@alysivji
Copy link
Author

alysivji commented Apr 23, 2022

Awesome. Thanks! I will work on this next week and create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants