Add Linux RPM packaging to the official pipeline - #201
Add Linux RPM packaging to the official pipeline#201Mike Krüger (mkrueger) wants to merge 8 commits into
Conversation
Build framework-dependent x86_64 and aarch64 RPMs that require the .NET 10 runtime, validate their payload and Cloud Shell size limit, and document installation.
There was a problem hiding this comment.
Pull request overview
Adds first-class RPM packaging support to the official OneBranch pipeline so the CosmosDBShell CLI can be installed on RPM-based Linux distributions (including Azure Linux) via a framework-dependent RPM that depends on the preinstalled .NET 10 runtime.
Changes:
- Adds a governed Linux pipeline job that publishes
x86_64andaarch64framework-dependent builds and packages them as compressed RPMs, with size/dependency/path validation. - Introduces an RPM spec (
cosmosdbshell.spec) that installs the binary under/usr/libexecand exposes/usr/bin/cosmosdbshellvia a symlink. - Documents RPM installation and records the packaging change in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents installing CosmosDBShell via the pipeline-produced RPM artifacts. |
| packaging/rpm/cosmosdbshell.spec | Defines the RPM layout, runtime dependency, and installed file list. |
| CHANGELOG.md | Notes the new official RPM outputs and Cloud Shell size-limit validation. |
| .pipelines/CosmosDB-Shell-Official.yml | Adds a new governed Linux job to build, validate, and publish RPM artifacts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall line coverage in commit 9858e0e in the Show a line coverage summary of the most impacted files.
Updated |
The build containers cannot reach the public Ubuntu archives, so installing the RPM tooling with apt-get failed. Azure Linux is RPM-native and resolves packages from packages.microsoft.com, which is reachable. Also disable RPM debuginfo extraction and binary stripping, which would corrupt the appended .NET single-file bundle.
Ship the ordinary framework-dependent publish output instead of a single-file bundle, so the package relies on the preinstalled .NET 10 runtime and does not extract itself at startup. Drop libmsalruntime.so, which ships only for linux-x64 and accounted for the entire size difference against linux-arm64.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
README.md:80
- The install example uses
dnf, but Azure Linux (called out in the text) typically usestdnf(and the official pipeline installs RPM tooling viatdnf). As written, the command is likely to fail on the primary target distro; consider documenting bothtdnf(Azure Linux / Cloud Shell) anddnf(other RPM distros).
sudo dnf install ./cosmosdbshell-<version>-<release>.<architecture>.rpm
cosmosdbshell
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
README.md:77
- The README implies these RPM artifacts can be installed on “other RPM-based distributions” with
dnf, but the package has a hard dependency ondotnet-runtime-10.0(from Microsoft’s RPM feeds / packages.microsoft.com). On distros without that repo configured,dnf installwill fail even if the .NET runtime was installed by other means. Consider clarifying the prerequisite (Microsoft .NET RPM repo enabled) so the installation steps are actionable.
The official pipeline produces framework-dependent RPMs for Azure Linux and
other RPM-based distributions:
- `cosmosdbshell-<version>-<release>.x86_64.rpm`
- `cosmosdbshell-<version>-<release>.aarch64.rpm`
Conditionally omit MCP, LSP, and unavailable broker dependencies from RPM builds while retaining the interactive shell, ARM support, direct/gateway connectivity, and OpenTelemetry. Document and validate the reduced RPM feature set.
| #endif | ||
|
|
||
| IHost? host = null; | ||
| IDisposable? host = null; |
Conditionally omit the embedded programming and NoSQL query guides together with the other MCP resources when MCP and LSP are excluded.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
README.md:70
- This section reads like a general installation pathway for RPM-based distros, but the PR description explicitly scopes RPMs to internal Azure Cloud Shell deployment / controlled CI and says they are not a general-purpose distribution channel. Adding that caveat here would avoid misleading readers.
The official pipeline produces framework-dependent RPMs for Azure Linux and
other RPM-based distributions:
| ShellInterpreter.WriteLine(MessageService.GetString("error-lsp-not-included")); | ||
| Environment.ExitCode = ShellExitCode.UsageError; | ||
| return; |
| <PackageReference Include="Fluent.Net" /> | ||
| <PackageReference Include="Microsoft.Azure.Cosmos" /> | ||
| <PackageReference Include="Microsoft.Extensions.Hosting" /> | ||
| <PackageReference Include="ModelContextProtocol" /> | ||
| <PackageReference Include="ModelContextProtocol.AspNetCore" /> | ||
| <PackageReference Include="OmniSharp.Extensions.LanguageServer" /> | ||
| <PackageReference Include="Newtonsoft.Json" Condition="'$(CosmosDBShellExcludeMcpAndLsp)' == 'true'" /> | ||
| <PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(CosmosDBShellExcludeMcpAndLsp)' != 'true'" /> | ||
| <PackageReference Include="ModelContextProtocol" Condition="'$(CosmosDBShellExcludeMcpAndLsp)' != 'true'" /> |
| <PackageVersion Include="Fluent.Net" Version="1.0.63" /> | ||
| <PackageVersion Include="Jil" Version="2.17.0" /> | ||
| <PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.59.0-preview.0" /> | ||
| <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> | ||
| <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" /> | ||
| <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" /> |
Purpose This PR adds small, framework-dependent RPM packages for internal Azure Cloud Shell deployment. They may also be useful in controlled CI environments that already provide the required runtime. These RPMs are not intended as a general-purpose Linux distribution channel. Public/general installation should continue to use the supported distribution mechanisms documented by the project. ## Packaging - builds
x86_64andaarch64RPMs in the official pipeline - requires the preinstalled .NET 10 runtime (dotnet-runtime-10.0) - installs the launcher as/usr/bin/cosmosdbshell- publishes the RPMs in the dedicatedcosmos_shell_rpmartifact - validates architecture, runtime dependency, payload layout, excluded assemblies, and the Azure Cloud Shell 25 MB package limit ## Lightweight RPM feature set The RPM is compiled withCosmosDBShellExcludeMcpAndLsp=true. This definesCOSMOSDBSHELL_NO_MCP_LSP, removes the MCP and LSP implementation sources, and omits their package dependencies and embedded MCP server instructions. The RPM retains: - the interactive shell and command-line editor - scripting and structured output - ARM management support - direct and gateway Cosmos DB connectivity - OpenTelemetry tracing and OTLP export through--otel- account-key, static-token, managed-identity, Azure CLI, browser/device-code, and remainingDefaultAzureCredentialauthentication paths The RPM excludes: - the HTTP MCP server and Model Context Protocol dependencies - the LSP server and OmniSharp/JSON-RPC dependencies - native and managed MSAL broker components used by Visual Studio Code credential authentication Invoking--mcp,--lsp, or--stdioreports that the feature is unavailable and exits with usage code2rather than silently doing nothing. ### Measured size impact Like-for-like locallinux-x64framework-dependent publishes were measured after removinglibmsalruntime.so, exactly as the RPM pipeline does: | Payload | Original PR #201 build | Reduced build | Savings | | --- | ---: | ---: | ---: | | Uncompressed publish payload | 34.94 MiB | 26.64 MiB | 8.30 MiB (23.8%) | | Compressed payload archive | 11.52 MiB | 8.60 MiB | 2.91 MiB (25.3%) | These are measured publish-payload andtar.gzsizes. Final RPM sizes can differ slightly because of RPM metadata and outer package compression. ## Native MSAL runtime tradeoff The RPM publish intentionally removeslibmsalruntime.so. That native library is available only forlinux-x64, would roughly double that package's size, and has nolinux-arm64equivalent. Because the native runtime is absent, the RPM also conditionally excludesAzure.Identity.Brokerand its managed broker dependencies.VisualStudioCodeCredentialdoes not work in these RPM builds. The shell reports that limitation and continues through the existing fallback chain. Use--azure-clito select the signed-in Azure CLI identity explicitly in Azure Cloud Shell. The implementation makes this limitation explicit rather than relying on a runtime failure: - the RPM build setsCosmosDBShellExcludeMsalRuntime=true- that definesCOSMOSDBSHELL_NO_MSAL_RUNTIMEat compile time - the shell reports that VS Code credential authentication is unavailable - authentication continues through the existing fallback chain - tests verify that VS Code credential capability matches the build configuration - pipeline validation fails if native MSAL, managed broker, MCP, or LSP assemblies are accidentally included ## Validation - full test suite: 2,119 passed - normal full-feature application build succeeds - reducedlinux-x64publish succeeds - reduced-build smoke tests verify--versionand interactive command execution ---mcp,--lsp, and--stdioreturn exit code2with explicit messages ---otelremains recognized and its endpoint validation remains active - the reduced payload contains four OpenTelemetry assemblies - the reduced payload contains no ModelContextProtocol, OmniSharp, Azure Identity Broker, or Microsoft Identity Client Broker assemblies - localization and connection-capability tests pass