Conversation
This draft PR aims to fix linkerd#3063 by building a chocolatey package for linkerd2's Windows CLI The package currently exists in the folder `windowspkg` To build (on windows system): - Install chocolatey - cd into `windowspkg/linkerd2-cli` - Run `choco pack` - Run `choco install linkerd-cli -s . `, make sure cmd is running as administrator - Run `refreshenv` to add linkerd2-cli path to system - To unistall run `choco uninstall linkerd2-cli` The following is further work to be done: - Fill `linkerd2-cli.nuspec` appropriately - Fill `LICENSE.txt` and `VERIFICATION.txt` appropriately Future work: - After approval future commits will add auto update feature for the package Signed-off-by: Animesh Narayan Dangwal <animesh.leo@gmail.com>
|
Hi @drholmie! I'm not familiar with Chocolatey or windows package management in general so I'm hoping you can help answer some fairly basic questions. Is the goal here simply to help with installation of the Linkerd CLI on windows (as opposed to solving distribution of the package)? In other words, the workflow would be to clone this repository and then run the above Chocolatey commands to install the CLI? Pushing a Linkerd package to some online repository is out of scope here, I assume? It looks like this package works by simply downloading the Linkerd CLI binary from the github releases page. This is a bit unintuitive for me because if I'm installing a tool from within a git repository, my default expectation is that it would be built from the current source. Is this standard practice for Chocolatey packages? |
This is part of the draft PR to fix linkerd#3063 adds the `update.ps1` file to showcase maintaining a chocolatey package for linkerd2's Windows CLI The package currently exists in the folder `windowspkg` To run auto update (on windows system): - Install chocolatey - Install auto update by running `cinst au` - cd into `windowspkg/linkerd2-cli` To showcase its working change the `linkerd2-cli.nuspec` file's `version` tag to lower than `2.6.1` (Linkerd2's current latest stable release) - Run `update` The following is further work to be done: - Fill `linkerd2-cli.nuspec` appropriately - Fill `LICENSE.txt` and `VERIFICATION.txt` appropriately - Add correct information to `update.ps1` to fill `LICENSE.txt` and `VERIFICATION.txt` appropriately Future work: - If approved will start working towards maintaining it as an official package Signed-off-by: Animesh Narayan Dangwal <animesh.leo@gmail.com>
|
Added the To run auto update (on windows system):
The following is further work to be done:
Future work:
|
|
Thanks, @drholmie. I'm still unclear on a lot of the details here, perhaps because I'm so unfamiliar with package management on windows. I've skimmed the AU docs, but there's a lot of detail there that I don't have context for so it would really help me if you could spell this out in as much detail as possible. What are the exact steps (including the specific commands) that we need to perform to create the package? What exactly will happen when we run those commands? What are the exact steps (including specific commends) that we would need to run during a Linkerd release in order to update the package? And I'm still unclear how the hardcoded version numbers that are checked into this git repository get updated. I know AU is involved somehow but, who actually updates these files and how? |
|
Thank you for reviewing this again!
There isn't that much of a change, just that on top of Linkerd's regular release process (where the cli is added on the release page), we just need to run The script then makes the appropriate changes to the
If this is added we just need to run
the To know more about AU in general you can also check out a tutorial here here and example here |
|
Hey there! @adleong just wanted to say one can test this out properly now since a new stable version of Linkerd was recently released. Just run the |
|
Awesome! Thanks for the help and the update @adleong :) |
|
@drholmie I will reach out to you next week with some questions around incorporating this into our GH Actions workflow, and publishing the bits on the official Chocolatey repository. |
|
Looking forward to it and will prepare accordingly. Thanks @ihcsim ! |
|
@drholmie I read up a bit on Chocolatey. The first thing that stood out to me is the rigorous moderation process around distributing packages in the community repo. My understanding is that everytime we want to publish a new release, we have to go through the same vetting process. Do you have experience working with the community repo maintainers? Is it a time-consuming process? Regarding the Automatic Package Updater module, it hinges on being able to run the As for your other earlier questions:
|
Ah! that's a good catch @ihcsim . Thank you for bringing it up :) I unfortunately don't have experience working with the maintainers (this would be my first choco package), however Linkerd can maintain an external repo for the package, although that comes with its own advantages and disadvantages as explained here. I'll try getting in contact though on chocolatey's gitter channel for more detailed information on the moderation process (if that's alright).
Yup, the An interesting thing to note is that even a
Awesome! Thank you for the links, will incorporate them if/ when its time to move forward with this PR. |
Yeah, at this point, I prefer not to maintain a server just to hold one package. Looking at the non-commercial server options, it doesn't look like we can just store it on a S3 or GCS bucket like Helm.
Yeah, I was hopeful when I saw this action the other day. I'm afraid this will be a blocker, if we can't add this to our CI workflow. Any chance that you can try this out on your fork? |
|
Thanks for the quick response @ihcsim! Yup will poke around with the action in the fork, although will take time on that unfortunately, hope that's okay. |
| } | ||
|
|
||
| Get-ChocolateyWebFile @packageArgs | ||
| Install-ChocolateyPath $packageArgs.fileFullPath 'Machine' No newline at end of file |
There was a problem hiding this comment.
IIUC, this adds the tools\linkerd.exe path to the global $PATH, right? Can we use the User path type so that the script doesn't require UAC/admin privileges on the machine?
There was a problem hiding this comment.
Ah! that's a good catch. Thanks for pointing that out :) Will look into and modify the script to allow for use without admin privileges.
There was a problem hiding this comment.
I believe if you use the Install-Chocolatey* family of commands, ShimGen should make a shim in the ProgramData/chocolatey/bin folder automatically, hence not requiring a modification of the path variable. It's for example how Helm does it:
$packageName = 'kubernetes-helm'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$tempDir = "$toolsDir\temp"
$packageArgs = @{
PackageName = $packageName
Url64bit = 'https://get.helm.sh/helm-v3.1.1-windows-amd64.zip'
Checksum64 = '5efc1c7bdea42a17a1ea197a3a2e47c8f1b0a5464894b98ae73a4c0620163040'
ChecksumType64 = 'sha256'
UnzipLocation = $toolsDir
}
# Download and unzip into a temp folder
Install-ChocolateyZipPackage @packageArgs
That zip is a file with an windows-amd64 folder in it with helm.exe, LICENCE and README.md in it. Rather straightforward.
There was a problem hiding this comment.
Ah! That's a interesting way to do it. Although currently Linkerd doesn't make a zip folder for the windows package. Will look into this to find analogous ways for how it currently is (if any). Thank you for suggesting this :)
| $packageArgs = @{ | ||
|
|
||
| packageName = 'linkerd' | ||
| fileFullPath = "$toolsPath\linkerd.exe" |
There was a problem hiding this comment.
Is there a way to set this value from an env var so that user can decide where to download the .exe to?
There was a problem hiding this comment.
Yup, if required the script can also accept command line arguments for the path. Should I accommodate for that as well?
|
@drholmie I managed to get the Chocolatey GitHub Actions to run on a separate repository at https://github.com/ihcsim/linkerd-chocolatey/actions/runs/48648586. The workflow generates and uploads the Regarding uninstallation, what does As for upgrade, I think there are two aspects to it. IIUC, the AU is meant to be run on the user's local machine to faciliate auto-upgrade of the Linkerd CLI. The other part lies in the Linkerd CI workflow, where we should be able to write some scripts to |
Awesome! Thank you for the help on this @ihcsim :) The
Chocolatey's uninstall is actually automatic now, one needn't make a separate script for it as before. It only uninstalls the cli from my experience of using it.
Ah so the AU is actually meant for the maintainers of the package to automate the process of making the updated package. So it is the maintainer(s) or organisation that runs the Also regarding the moderation process, before getting an answer from the gitter channel, did a little digging with a few packages release pages and their choco release history. The time taken is very varied, and could even extend to a little less than two months, which might be a problem since Linkerd releases stable versions fairly quickly. Would this be a blocking issue? |
|
We might not need the Also, I feel like we should just not bother with publishing the .nupkg file to the Chocolatey community repo. If we attach the file to Linkerd's GitHub releases, Windows users can just download it and run Meanwhile, there are 3 items that I am hoping you can help me with:
Feel free to add to this PR, or start a new one. Thanks a lot! |
|
I feel like having the package in the community repo would be very useful as a user, it stops us from having to do all kinds of manual things for specific packages. (Very much like how it's very neat to have most packages in main debian/ubuntu repos for example). If you pass the first automatic checks AND you don't change your package around too much, the process is similar to other moderated/opinionated package repositories and can be mostly automatic, although you might not want to release versions every day, so only stable ones, otherwise moderators might get fed up with you. Most of the requirements are about stating license, authors and copyright attributions and they are fairly picky on those. And stuff like are all fields filled and is the package id sane. Plus not flagging VirusTotal. Self contained executables are very straightforward to package. I ran the install for the nupkg: This does not result in linkerd in the path. It also does not prompt to run the install script. It does not find the chocoInstall.ps1 script according to the logs and thus does not run it nor install linkerd. Helm as example: (https://github.com/synax/chocolatey-packages/tree/master/automatic/kubernetes-helm) vs |
Ah that's cool! Thank you for the help :)
I'm a little reluctant with this though, not just for the reasons @EraYaN mentioned, but also because its not really the way chocolatey is meant to be used (so to speak). Albeit if the waiting time is bad this is a good workaround it. @EraYaN do you have experience with publishing chocolatey packages? Could you elaborate on the usual amount of time taken with each release vs when a package becomes trusted?
Awesome! Will work on this and add it to the current one, when approved will move along to a proper PR. Thanks for the help everyone! |
|
I have no time frames, it's all human work. So "it varies" is probably close enough, it also does not really matter, it's expected as a repo user that there is some release lag. The nuspec will need to include the EDIT: if the exe is 64 bit the |
|
@drholmie @EraYaN What I really like to see is folks like yourselves work with us to interface with the Chocolatey Windows community, on behalf of the rest of the Linkerd community, in all future releases. The Linkerd team can help you sort out Chocolatey's requirements around license, authors and copyright attributions etc. In my imaginary world, I picture it as the Linkerd team packages and uploads the As an incentive 😉, I am sure @grampelberg and @wmorgan will be happy to send you folks some awesome Linkerd swags, share shoutouts and announcements on social media and maybe even get you to share about the Linkerd Windows release process in an upcoming Linkerd monthly community meeting (where I will nominate you as the next Linkerd heroes!). |
|
I mean it might be easier to do the push automatically in your release pipeline. Otherwise it'd just be a webhook to some other repo with some GitHub actions in it, which is fine but might be suboptimal (having the repo outside the main org that is). Although me or @drholmie can set it up I suppose and if you want to move it in-org at some point the repo can be transferred. |
|
@EraYaN I believe it will be added to the release process itself, as discussed previously in the conversations above and since @ihcsim has made an action for it already here. Also thanks for pointing out the install script issue! My apologies for not clarifying @ihcsim we'll need all the files in the Thanks @ihcsim for the offers and incentive approach! |
|
I don't have any contacts, I just have submitted packages to similar community package repositories before and it's all not such a big deal. Everyone wants more (good) packages in the repo, especially since there is no support obligation for this one. |
@drholmie I think the value Can you try again? https://github.com/ihcsim/linkerd-chocolatey/actions/runs/55697932 Here's my proposal for this PR:
WDYT?
@EraYaN Automating the push is easy. That will happen in the Linkerd CI pipeline. I don't want to deal with the human works every couple weeks. |
|
If you don't mess with the moderators too much and steadily release good packages (eg. don't change the stuff and metadata around every submit) it's only human work on their end. Although you do need an email contact point for when shit goes wrong (for example the package no longer installs correctly) and they want you to resubmit. |
Ah! I see, yup it works now. Thanks @ihcsim for clarifying :)
Awesome! Sounds like a plan. Will work on this with that in mind. |
|
Per conversation with @drholmie, we are closing this issue, since it's has accumulated a number of research and testing related comments over the past 2 months and have drifted from @drholmie will open up a new PR to address these items:
The scope of the next PR will be limited to just introducing the new scripts to build the |
This PR partially fixes linkerd#3063 by building a chocolatey package for Linkerd2's Windows CLI It adds the build scripts for the Linkerd chocolatey package and based on discussions in linkerd#3921 The package currently exists in the `bin/win` folder The `.nuspec` script has been modified for easy integration with the workflow done by @ihcsim here: https://github.com/ihcsim/linkerd-chocolatey To build outside of workflow environment (on windows system): - Modify `linkerd.nuspec` version tag to an available stable version of Linkerd2's cli eg: stable-2.7.0 - Install chocolatey - cd into `bin/win/` - Run `choco pack` - Run `choco install linkerd -s .` (make sure cmd/ powershell is running as administrator) - Run refreshenv to add `linkerd.exe` path to system - To unistall run `choco uninstall linkerd` Tackling requirements discussed in linkerd#3921 (specifically: linkerd#3921 (comment)) - Followed folder structure as described here: https://github.com/ihcsim/linkerd-chocolatey - Modified package to accept version through the metadata available in `.nuspec` file - Modified package to override install path with command line arg/ env variable To run with command line argument: - Run `choco install linkerd -s . --params="/path:<YOUR_PATH_HERE>"` To run with environment variable: - Run `$env:linkerdPath = "<YOUR_PATH_HERE>"` in powershell Uses default chocolatey install path if none of the above provided. - Modified package to accept command line args/ env variable for checksum To run with command line argument: - Run `choco install linkerd -s . --params="/checksum:<VERSION_CHECKSUM>"` (Keep params space seperated when specifying multiple) To run with environment variable: - Run `$env:linkerdCheckSum = "<VERSION_CHECKSUM>"` If no checksum provided, default null value assigned and package ignores verification step - This package is compatible in a non-administrative environment but one must install chocolatey in a non-administrative path. (Steps explained here: https://chocolatey.org/docs/installation#non-administrative-install) Further plans: This PR is part of a set of planned PRs based on the discussions in linkerd#3921 (specifically: linkerd#3921 (comment))
This PR partially fixes linkerd#3063 by building a chocolatey package for Linkerd2's Windows CLI It adds the build scripts for the Linkerd chocolatey package and based on discussions in linkerd#3921 The package currently exists in the `bin/win` folder The `.nuspec` script has been modified for easy integration with the workflow done by @ihcsim here: https://github.com/ihcsim/linkerd-chocolatey To build outside of workflow environment (on windows system): - Modify `linkerd.nuspec` version tag to an available stable version of Linkerd2's cli eg: stable-2.7.0 - Install chocolatey - cd into `bin/win/` - Run `choco pack` - Run `choco install linkerd -s .` (make sure cmd/ powershell is running as administrator) - Run refreshenv to add `linkerd.exe` path to system - To unistall run `choco uninstall linkerd` Tackling requirements discussed in linkerd#3921 (specifically: linkerd#3921 (comment)) - Followed folder structure as described here: https://github.com/ihcsim/linkerd-chocolatey - Modified package to accept version through the metadata available in `.nuspec` file - Modified package to override install path with command line arg/ env variable To run with command line argument: - Run `choco install linkerd -s . --params="/path:<YOUR_PATH_HERE>"` To run with environment variable: - Run `$env:linkerdPath = "<YOUR_PATH_HERE>"` in powershell Uses default chocolatey install path if none of the above provided. - Modified package to accept command line args/ env variable for checksum To run with command line argument: - Run `choco install linkerd -s . --params="/checksum:<VERSION_CHECKSUM>"` (Keep params space seperated when specifying multiple) To run with environment variable: - Run `$env:linkerdCheckSum = "<VERSION_CHECKSUM>"` If no checksum provided, default null value assigned and package ignores verification step - This package is compatible in a non-administrative environment but one must install chocolatey in a non-administrative path. (Steps explained here: https://chocolatey.org/docs/installation#non-administrative-install) Further plans: This PR is part of a set of planned PRs based on the discussions in linkerd#3921 (specifically: linkerd#3921 (comment)) Signed-off-by: Animesh Narayan Dangwal animesh.leo@gmail.com
This PR partially fixes linkerd#3063 by building a chocolatey package for Linkerd2's Windows CLI It adds the build scripts for the Linkerd chocolatey package and based on discussions in linkerd#3921 The package currently exists in the `bin/win` folder The `.nuspec` script has been modified for easy integration with the workflow done by @ihcsim here: https://github.com/ihcsim/linkerd-chocolatey To build outside of workflow environment (on windows system): - Modify `linkerd.nuspec` version tag to an available stable version of Linkerd2's cli eg: stable-2.7.0 - Install chocolatey - cd into `bin/win/` - Run `choco pack` - Run `choco install linkerd -s .` (make sure cmd/ powershell is running as administrator) - Run refreshenv to add `linkerd.exe` path to system - To unistall run `choco uninstall linkerd` Tackling requirements discussed in linkerd#3921 (specifically: linkerd#3921 (comment)) - Followed folder structure as described here: https://github.com/ihcsim/linkerd-chocolatey - Modified package to accept version through the metadata available in `.nuspec` file - Modified package to override install path with command line arg/ env variable To run with command line argument: - Run `choco install linkerd -s . --params="/path:<YOUR_PATH_HERE>"` To run with environment variable: - Run `$env:linkerdPath = "<YOUR_PATH_HERE>"` in powershell Uses default chocolatey install path if none of the above provided. - Modified package to accept command line args/ env variable for checksum To run with command line argument: - Run `choco install linkerd -s . --params="/checksum:<VERSION_CHECKSUM>"` (Keep params space seperated when specifying multiple) To run with environment variable: - Run `$env:linkerdCheckSum = "<VERSION_CHECKSUM>"` If no checksum provided, default null value assigned and package ignores verification step - This package is compatible in a non-administrative environment but one must install chocolatey in a non-administrative path. (Steps explained here: https://chocolatey.org/docs/installation#non-administrative-install) Further plans: This PR is part of a set of planned PRs based on the discussions in linkerd#3921 (specifically: linkerd#3921 (comment)) Signed-off-by: Animesh Narayan Dangwal <animesh.leo@gmail.com>
This draft PR aims to fix #3063 by building a chocolatey package for linkerd2's Windows CLI
The package currently exists in the folder
windowspkgTo build (on windows system):
windowspkg/linkerd2-clichoco packchoco install linkerd2-cli -s ., make sure cmd is running as administratorrefreshenvto add linkerd2-cli path to systemchoco uninstall linkerd2-cliThe following is further work to be done:
linkerd2-cli.nuspecappropriatelyLICENSE.txtandVERIFICATION.txtappropriatelyFuture work:
Signed-off-by: Animesh Narayan Dangwal animesh.leo@gmail.com