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

.Net 9 support, multi-platform images #27

Merged
merged 7 commits into from
Feb 10, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/argo-ris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflows: ['Publish on GitHub Container Registry']
types: [completed]
branches:
- main
- main-disabled

jobs:
restart_deployment:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- '**.cs'
- '**.csproj'

env:
DOTNET_VERSION: '8' # The .NET SDK version to use
# env:
# DOTNET_VERSION: '9' # The .NET SDK version to use

jobs:
build-and-test:
Expand All @@ -23,6 +23,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0
8.0

- name: Install dependencies
run: dotnet restore

Expand Down
208 changes: 106 additions & 102 deletions .github/workflows/ghcr-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,106 +12,110 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
labels: |
org.opencontainers.image.title=fhir-candle
org.opencontainers.image.description=A small in-memory FHIR server that can be used for testing and development - NOT for production workloads.
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

## Working, but single platform
# jobs:
# build-and-push-image:
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}

# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write

# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Checkout repository
# uses: actions/checkout@v4

# - name: Log in to the Container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# labels: |
# org.opencontainers.image.title=fhir-candle
# org.opencontainers.image.description=A small in-memory FHIR server that can be used for testing and development - NOT for production workloads.
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=latest,enable={{is_default_branch}}

# - name: Build and push Docker image
# id: push
# uses: docker/build-push-action@v6
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
# build-and-push-image:
# runs-on: ubuntu-latest

# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write

# steps:
# - name: Checkout repository
# uses: actions/checkout@v4

# - name: Log in to the Container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# labels: |
# org.opencontainers.image.title=fhir-candle
# org.opencontainers.image.description=A small in-memory FHIR server that can be used for testing and development - NOT for production workloads.
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=latest,enable={{is_default_branch}}

# - name: Build and push Docker image
# id: push
# uses: docker/build-push-action@v6
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true



## multi-platform
jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
labels: |
org.opencontainers.image.title=fhir-candle
org.opencontainers.image.description=A small in-memory FHIR server that can be used for testing and development - NOT for production workloads.
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: false
14 changes: 9 additions & 5 deletions .github/workflows/nuget-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@ on:
workflows: ['Tests']
types: [completed]
branches:
- main
- main-disabled

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8'
dotnet-version: |
9.0
8.0

- name: Build and Publish
run: |
dotnet restore
dotnet restore src/fhir-candle/fhir-candle.csproj
dotnet pack -c Release ./src/fhir-candle/fhir-candle.csproj
mv ./src/fhir-candle/bin/Release/net8.0/publish/wwwroot ./src/fhir-candle/bin/Release/net8.0/publish/staticwebassets
mv ./src/fhir-candle/bin/Release/net9.0/publish/wwwroot ./src/fhir-candle/bin/Release/net9.0/publish/staticwebassets
7z a ./nupkg/*.nupkg ./src/fhir-candle/bin/Release/net8.0/publish/staticwebassets/
7z a ./nupkg/*.nupkg ./src/fhir-candle/bin/Release/net9.0/publish/staticwebassets/
dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.GINOC_NUGET }} --source https://api.nuget.org/v3/index.json
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
Expand All @@ -8,11 +8,11 @@ WORKDIR /app
# Copy everything else and build
COPY . ./

RUN dotnet restore -a $TARGETARCH src/fhir-candle/fhir-candle.csproj
RUN dotnet publish -a $TARGETARCH src/fhir-candle/fhir-candle.csproj -c Release -o out --no-restore
RUN dotnet restore --ucr -a $TARGETARCH src/fhir-candle/fhir-candle.csproj
RUN dotnet publish --ucr --framework net9.0 -a $TARGETARCH src/fhir-candle/fhir-candle.csproj -c Release -o out --no-restore

# Build runtime image
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "fhir-candle.dll"]
Expand Down
33 changes: 32 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
* Work in Progress
* Updated NuGet dependencies:
* `� fhir-candle`
* ` MailKit 4.9.0 -> 4.10.0`
* ` OpenTelemetry 1.11.0 -> 1.11.1`
* ` OpenTelemetry.Exporter.Console 1.11.0 -> 1.11.1`
* ` OpenTelemetry.Exporter.OpenTelemetryProtocol 1.11.0 -> 1.11.1`
* ` OpenTelemetry.Extensions.Hosting 1.11.0 -> 1.11.1`
* ` OpenTelemetry.Instrumentation.AspNetCore 1.10.1 -> 1.11.0`
* ` System.IdentityModel.Tokens.Jwt 8.3.1 -> 8.4.0`
* `� fhir-candle.Tests`
* ` Hl7.Fhir.R4 5.11.2 -> 5.11.3`
* ` Hl7.Fhir.R4B 5.11.2 -> 5.11.3`
* ` Hl7.Fhir.R5 5.11.2 -> 5.11.3`
* ` Microsoft.NET.Test.Sdk 17.12.0 -> 17.13.0`
* ` xunit.runner.visualstudio 3.0.1 -> 3.0.2`
* `� FhirCandle.Common`
* ` Microsoft.IdentityModel.Tokens 8.3.1 -> 8.4.0`
* `� FhirCandle.R4`
* ` Hl7.Fhir.R4 5.11.2 -> 5.11.3`
* `� FhirCandle.R4B`
* ` Hl7.Fhir.R4B 5.11.2 -> 5.11.3`
* `� FhirCandle.R5`
* ` Hl7.Fhir.R5 5.11.2 -> 5.11.3`
* Updated Language version to 13.
* Updated projects to multi-target .Net 8.0 and .Net 9.0.
* Updated references specific to .Net 9.0:
* ` Microsoft.AspNetCore.Components.Web 8.0.12 -> 9.0.1`
* Updated docker image for multi-platform support (`linux/arm64` and `linux/amd64`).

* v2025.206
* Added support for compartment-based searching.
* Default listeners automatically support compartments defined in core.
* Clients can store `CompartmentDefinition` resources, which update or add to existing compartments.
* Fixed issue with `FhirRequestContext` incorrectly allowing some `HEAD` requests that are not cacheable.
* First pass of SMART scope-based filtering for search.
* Limited to testing of `match` results.
* Does not test granular scopes yet.
* Does **not** filter inclusions yet.
* Does **not** test granular scopes yet.

* v2025.129
* Added commit log
Expand Down
25 changes: 25 additions & 0 deletions fhir-candle-ui.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Solution-wide properties for NuGet packaging -->

<ItemGroup>
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.11.3" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.11.3" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.11.3" />
<PackageReference Include="BlazorMonaco" Version="3.3.0" IncludeAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.12" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.1" />
</ItemGroup>

<!--
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
-->
</Project>
6 changes: 4 additions & 2 deletions fhir-candle.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<!-- Solution-wide properties for NuGet packaging -->
<PropertyGroup>
<LangVersion>12.0</LangVersion>
<LangVersion>13.0</LangVersion>
<!--<TargetFramework>net8.0</TargetFramework>-->
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<VersionPrefix>$([System.DateTime]::Now.ToString("yyyy.MMdd.HHmm"))</VersionPrefix>
Expand All @@ -12,7 +14,7 @@
<FileVersion>$([System.DateTime]::Now.ToString("0.yyyy.MMdd.HHmm"))</FileVersion>
<Authors>GinoCanessa</Authors>
<Company>FHIR Foundation Project</Company>
<Copyright>Copyright 2022-2024</Copyright>
<Copyright>Copyright 2022-2025</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/FHIR/fhir-candle</RepositoryUrl>
<NeutralLanguage>en</NeutralLanguage>
Expand Down
1 change: 1 addition & 0 deletions fhir-candle.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
changelog.md = changelog.md
CONTRIBUTING.MD = CONTRIBUTING.MD
Dockerfile = Dockerfile
fhir-candle-ui.props = fhir-candle-ui.props
fhir-candle.props = fhir-candle.props
LICENSE = LICENSE
README.md = README.md
Expand Down
Loading