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

feat: create powershell toolbox #91

Merged
merged 3 commits into from
May 13, 2024

Conversation

lambdaclan
Copy link
Contributor

@lambdaclan lambdaclan commented May 13, 2024

Add PowerShell toolbox

Resolves #11

Description

Add a new toolbox for Microsoft related tooling.

Proposed Changes

  • Add initial package list
  • Add PowerShell
  • Add dotnet core and .NET sdk (LTS)
  • Add Azure Command-Line Interface (azure-cli)
  • Disable telemetry

References

Remarks

I am aware the COPY command is wrong for the final release, but I am still testing things locally so I will adjust it after the PR review.

@lambdaclan lambdaclan requested a review from castrojo as a code owner May 13, 2024 06:43
@lambdaclan lambdaclan changed the title Create powershell toolbox feat: create powershell toolbox May 13, 2024
@lambdaclan
Copy link
Contributor Author

I was originally using the Microsoft provided scripts to install dotnet and Python to install Azure CLI etc but seems like that Wolfi has native packages. I have updated the Containerfile accordingly. If anyone knows of a way to search for Wolfi packages something akin to https://pkgs.alpinelinux.org/packages?branch=edge please let me know. After some research I located https://packages.wolfi.dev/ but not sure if that is the correct list, it does not seem to include all available packages.

@lambdaclan
Copy link
Contributor Author

I tried experimenting a bit with custom PowerShell profiles (pwsh bashrc) to add some niceties like a theme, fzf integration, autocomplete for PowerShell, dotnet CLI and Azure CLI but unfortunately many of these things are currently not possible due to missing PowerShell modules on Alpine based distros. Please see PowerShell/PowerShell#20143 for more information.

It is a bit of a shame because this really limits how much we can extend the PowerShell toolbox. At this point we can either wait for the issue to be resolved (seems like some work is being done) or switch the base of the container to a different distro or just ignore everything and use whatever PowerShell is available in vanilla form.

@m2Giles
Copy link
Member

m2Giles commented May 13, 2024

While it is alpine like, this is a glibc based container/install.

@castrojo castrojo enabled auto-merge May 13, 2024 13:06
@castrojo castrojo added this pull request to the merge queue May 13, 2024
Merged via the queue into ublue-os:main with commit 93e2c22 May 13, 2024
10 checks passed
@lambdaclan
Copy link
Contributor Author

Hello @castrojo thank you very much for reviewing and merging my first PR 🎉 I was a bit surprised since I was expecting some requests for changes haha. Anyway, I will be happy to keep on iterating on this to make the experience better. On the original issue you mentioned that

Since no one's really claimed it, then feel free to provide whatever UX you feel people would like!

Does this mean I am free to use a different base for this container? Maybe Fedora or Ubuntu for example. Now that I know that Wolfi is using glibc and not musl as kindly pointed out by @m2Giles there might be alternative ways of accessing the missing modules I mention above. I am not too optimistic though since it seems the Wolfi package is still using the Alpine package as a base, so the modules are still missing.

I could try installing the PowerShell binary provided we can get all the necessary dependencies on Wolfi but not sure if it will work, I will look into it. Furthermore, I guess we also need to update the README to include the new toolbox.

If you feel the current toolbox is OK as is, I will be happy to work on something else. I do not really use Discord, so I cannot ask directly what you guys need help with so feel free to point me to the right direction when you get a chance ;)

@castrojo
Copy link
Member

If there's things you need in wolfi then let us know, @EyeCantCU can take a look, we'd prefer to share base images on wolfi where possible for efficiency reasons. And if things are missing we'll just work with the wolfi community to get them added. Thanks!

@lambdaclan
Copy link
Contributor Author

Got it, I will do some more experiments and will be in touch once I have some updates. Thanks for the prompt response!

@lambdaclan
Copy link
Contributor Author

If there's things you need in wolfi then let us know, @EyeCantCU can take a look,

I made some progress. For now, I found a workaround, so I will be opening a new PR shortly that will improve the overall shell experience. Regarding the issue itself I have posted my findings here wolfi-dev/os#16744 for the Wolfi team to see. Maybe @EyeCantCU can offer some further feedback. We can always update container file at a later stage once and if the native packages issues are resolved.

@EyeCantCU
Copy link
Member

Hi @lambdaclan,

I'm happy to help with this. The best way to report issues with packages in Wolfi is to file an issue on our issue tracker here: https://github.com/wolfi-dev/os/issues

I can certainly look into this later today and figure out what the best approach here would be

@EyeCantCU
Copy link
Member

EyeCantCU commented May 15, 2024

@lambdaclan,

Took a moment to dig into this, and unfortunately, this isn't something we'd be able to provide upstream in Wolfi

Please see the notes left here: PowerShell/PowerShell#20143 (comment)

However, you could work around this by adding this to the Dockerfile:

RUN apk add dotnet-8-sdk && \
    dotnet tool install --tool-path /usr/bin PowerShell

@lambdaclan
Copy link
Contributor Author

Hello @EyeCantCU.

Thank you very much for taking some time to look into this issue, really appreciated.

Took a moment to dig into this, and unfortunately, this isn't something we'd be able to provide upstream in Wolfi
Please see the notes left here: PowerShell/PowerShell#20143 (comment)

Indeed, I am aware of the issue, although there is some work being done lately I am not sure when and if the issue will be resolved.

However, you could work around this by adding this to the Dockerfile:
RUN apk add dotnet-8-sdk &&
dotnet tool install --tool-path /usr/bin PowerShell

Yeap, this is exactly what I ended up doing, works well enough for now, and we can always update to a native package when available 👍

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

Successfully merging this pull request may close these issues.

Make a powershell toolbox
4 participants