-
Notifications
You must be signed in to change notification settings - Fork 657
[CI] Publish binaries for Aspire.Cli #9695
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
Conversation
How big is it |
eng/clipack/Common.projitems
Outdated
@@ -0,0 +1,40 @@ | |||
<Project> | |||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected using the NoBuild targets sdk instead. Is there a reason why we need this one? Without it we can probably avoid having to set a target Framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm exploring that.
eng/clipack/Common.projitems
Outdated
<AdditionalProperties Include="RuntimeIdentifier=$(CliRuntime)" /> | ||
<AdditionalProperties Include="PublishSingleFile=true" /> | ||
<AdditionalProperties Include="SelfContained=true" /> | ||
<!-- <AdditionalProperties Include="GenerateDocumenationFile=false" /> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
eng/clipack/Common.projitems
Outdated
Text="No files were found to pack. Ensure that the project $(MSBuildProjectFullPath) has a publish target defined." /> | ||
|
||
<MakeDir Directories="$(CliPublishedArtifactsOutputDir)/$(CliRuntime)" /> | ||
<ZipDirectory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is how we do it for the dashboard, but since this will be customer facing we should change it such that only Windows builds use .zip files, but Linux artifacts should generate .tar files instead. Most Linux distros come with utilities to extract tars, but not zips so we should avoid having this as a requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I can't reference System.IO.Compression and System.Formats.Tar from the inline task to make this work. I'll create a new tasks project for this, and use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check what does dotnet sdk/installer team do here? If possible, I'd try to avoid adding a lot of complexity to the repo so let's see if there is anything we could reuse
eng/dashboardpack/Common.projitems
Outdated
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo newline :)
- This generates zip files for non-linux platforms. And `.tar.gz` for linux. - And uses Arcade blob publishing to publish the generated archives
@@ -54,6 +56,11 @@ | |||
<PublishFlatContainer>true</PublishFlatContainer> | |||
<RelativeBlobPath>$(_UploadPathRoot)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath> | |||
</ItemsToPushToBlobFeed> | |||
<ItemsToPushToBlobFeed Include="@(_CliFilesToPublish)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we figure out how to control the aka.ms link version so that we get a "latest" link for each of the branches we build from? For instance, we should have one that points always to latest build from main, and one that points to latest build of release/9.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally ok if you prefer to do that as a follow-up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would have to be in a follow-up.
@@ -0,0 +1,9 @@ | |||
<Project> | |||
<PropertyGroup> | |||
<CliRuntime>linux-arm64</CliRuntime> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to block your PR for this, but we may need to add a linux-musl build as well. Thoughts @mitchdenny @DamianEdwards @davidfowl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that @danegsta was adding in/has added in the musl support on the DCP side too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new project though, so he wouldn't have done it for this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but I understand your comment now lol, yeah, because of his PR is why I made this comment 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well there is no point shipping musl if the whole stack doesn't support it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitchdenny I've got this PR to add the new DCP musl build into Aspire. I'm only doing linux-musl-x64 support for now, as setting up a linux-musl-arm64 DCP build is going to be a lot more painful.
eng/clipack/Common.projitems
Outdated
|
||
<Exec | ||
Condition="$(CliRuntime.StartsWith('linux-'))" | ||
Command="pwsh "$(_CreateTarGzScriptPath)" @(_CreateTarGzArguments, ' ')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now means there is a new prereq in the build as I don't believe pwsh was required before, correct?
Was there nothing in the SDK that does this naitvely? Might also be worth checking with dotnet monitor CLI tool as they produce tars as part of their build so we should also see what they do. TL:DR is that if we can simplify and get to the same results without having to introduce new pre-reqs and custom scripts, it'd be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re:pwsh, we use that in multiple places for running tests on github actions.
re:sdk, there is a https://github.com/dotnet/sdk/blob/ad24473f7f2ae16eaee4cbd28eb6897d00df32f3/src/Tasks/sdk-tasks/TarGzFileCreateFromDirectory.cs#L8 which isn't being surfaced in a nuget. But Eric suggested https://github.com/dotnet/arcade/tree/main/src/Microsoft.DotNet.Tar which I will be trying. Still in draft :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option to look into: https://github.com/dotnet/dotnet-monitor/blob/5d4c1ec2da76c832119c85cb63cb724e2c9ffa1e/eng/Publishing.props#L25-L30
dotnet-monitor does this already so perhaps we can check with folks like @wiktork on how they build their tarballs that are then published?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent find! There seems to be [Microsoft.DotNet.Build.Tasks.Archives](https://github.com/dotnet/arcade/tree/d9d02d858b71562509f72ea84409853e4deffc8f/src/Microsoft.DotNet.Build.Tasks.Archives)
nuget which IIUC supports this. I will try it out.
WIP, not ready for review yet. |
next:
|
31576a5
to
42e8009
Compare
That's compressed. It's actually ~74 MB on disk. This is still WIP right? I thought I saw we got this much smaller than that? |
We should merge this infra, aot will make it smaller. |
This PR is ready to go. |
@@ -125,6 +125,7 @@ | |||
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Workloads" Version="8.0.0-beta.23564.4" /> | |||
<PackageVersion Include="Microsoft.Signed.Wix" Version="$(MicrosoftSignedWixVersion)" /> | |||
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.23564.4" /> | |||
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Archives" Version="8.0.0-beta.23564.4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: no need to block you PR on this, but we should probably setup dependency flow for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<PropertyGroup> | ||
<TargetFramework>$(DefaultTargetFramework)</TargetFramework> | ||
|
||
<ArchiveName>aspire-cli-$(CliRuntime)</ArchiveName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like how this file ended up looking like :)
Would be great to, in a separate PR, do the same for the dashboardpack project as that one is doing a whole bunch of complex stuff.
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" /> | ||
</ItemGroup> | ||
|
||
<Target Name="PublishToDisk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: don't change this now, but might be good to include in your next PR a small comment here saying that the Microsoft.DotNet.Build.Tasks.Archives targets will automatically invoke this target when the project is published so that others in the future understand how this is plugged in.
Generate self contained single file binaries for Aspire.Cli for the following platforms:
Produces archives named like
aspire-cli-linux-x64-9.4.0-preview.1.25316.11.tar.gz
inartifacts/packages/$(CONFIG)/Shipping
.Contributes to #9638