Create a central repository for SPM #67355
Replies: 41 comments
-
@johnkeates - thanks for the feedback and ideas. |
Beta Was this translation helpful? Give feedback.
-
I imagine this as a relatively simple webservice where an author can authenticate using existing providers for simplicity (like GitHub, Bitbucket or something like that), connect a repository or manually upload a zip with a new SPM package. It shouldn't be that hard to clone one of the existing concepts. The issue would of course be: who's going to build it, who's going to host it, and who's going to pay for the bandwidth. I'm happy to help, but sadly, I don't have a spare server or free bandwidth to provide, so it's going to be engineering only from my side if any help is practical from outsiders. |
Beta Was this translation helpful? Give feedback.
-
If I were to start implementing this thing, where do I PR it? |
Beta Was this translation helpful? Give feedback.
-
@johnkeates - Add a PR in this same repo: saltstack/salt. |
Beta Was this translation helpful? Give feedback.
-
Why not instead package |
Beta Was this translation helpful? Give feedback.
-
Because they are complex packages, while packages like the ones used by nodejs and php (composer) are fairly simple. On top of that, rpm/deb is designed for end-user software, or software in general, whereas spm (and npm and composer) are for 'code' more than a finished product. Furthermore, windows and OSX don't do rpm/deb, neither does any BSD/Unix. We'd have to make .pkg's, msi's, pbi's, snappy app packages, opkg's for embedded devices etc... |
Beta Was this translation helpful? Give feedback.
-
No, I don't suggest to replace spm with rpm/deb/etc. This is definitely a bad idea. Just simply wrap it in rpm or another native packages. This way you use same environment and don't need a separate web service, hoster and somebody to pay for all this. There is no need to go deep in different package systemst as the only thing you need in the end is to deliver a singe spm file It should be fairly easy to implement for the most popular systems, right? |
Beta Was this translation helpful? Give feedback.
-
I suppose for most popular systems that could work, but that doesn't solve the dependency resolution problem. The only reason SPM would work and could get traction is if you can do something like Setting up a repo server for SPM isn't hard, and it's not like composer and npm were that hard to setup ;-) Even NuGet for C# works, and PECL, and PEAR! (and CPAN, and all those others). Another reason would be central publication of formulas, and the option for comments, votes on security and integrity, and maintainers that might need to change the upstream source. Say you have a formula you'd like to share, you just dump it on github and maybe link it to saltstack-formulas, and that's it. Not the nicest way to do this, and the lack of SPM usage makes resolving dependencies or creating meta-formulas that just pull in a selection of formulas that you need to set something up really hard. With an SPM "server" one could set a system up locally, or maybe SaltStack would host a public one, or possibly we'd just use jekyll and host it on github (which would make github sad, as happened with CocoaPods). It's not as much that it needs to be a hosted catch-all thing, but right now there is nothing there at all, and that's just not working. Even just for internal use, I need a webinterface where I can do this: formula (on github perhaps) -> Add to SPM server and point to github for upstream updates -> define any dependencies -> click publish -> done on workstation and/or master: spm install package (thing downloads package and puts it in the right spot) and then I can use the package. I already run internal apt repos (I tend to stay away from RPM systems), and I don't really feel like building an infrastructure like I just described but then also having to interface it on top of that repository. |
Beta Was this translation helpful? Give feedback.
-
Maybe we come from different point of views and experience. Personally I don't see So for us the low hanging fruit is to use only salt-related logic from We just propagate dependencies (from Maybe the difference is that with this approach you can get this right here right now while |
Beta Was this translation helpful? Give feedback.
-
Just to be clear, I'm aware that this works for us but isn't that useful for other users. Just describing what we've got. |
Beta Was this translation helpful? Give feedback.
-
Dependency resolution and enforcement has been added and should work (ref #31469). As @themalkolm states, SPM is designed only to install, manage, and remove Salt-related files. @johnkeates and @themalkolm, you both raise some important points, and I would love for you both to be more involved in the development of SPM. |
Beta Was this translation helpful? Give feedback.
-
@johnkeates I should also mention that I am currently working on a graphical front end for managing SPM repositories. @ssgward, it will not be part of the main Salt distribution, as the vast majority of Salt users will have no need for it. However, for those that do, it will be crucial. I will post an update here when it is available. |
Beta Was this translation helpful? Give feedback.
-
Good to know others are thinking and working on this thing. I see that Salt's SPM target was to simply supply a standard for formula installation based on a simple format and nothing else, but I thought the fact that it has channel/repo code in it meant someone already had the central repository in mind. Separate from who's doing what and what the best way to go about it: I do wonder how we're going to create a central 'thing' to store formulas in. I don't see current saltstack-formuals contributors making OS-specific packages, or any packages at all. At best we can expect a FORMULA file with basic data on the formula itself and that'd be it. Manually making packages isn't going to work out very well, and neither is asking people to maintain other people's packages based on sources they don't control. Taking this back to a basic form where you have a publicly accessible git repository somewhere, you'd need a way to assure:
Then, for each distribution you'd need a package repository, to accommodate it's preferred style, plus maybe a tarball server where you can just download the SPM packages directly. If we take a look at a few other configuration management tools, they have their own repositories; https://supermarket.chef.io/cookbooks Even Microsoft has something: https://gallery.technet.microsoft.com/scriptcenter/ If we take a look at a few domain-specific repositories for other systems, they have: https://www.npmjs.com They all work on all systems where their OS-specific counterparts were installed. If we take a look at what Salt itself supports: DEBIAN AND DERIVATIVES UBUNTU AND DERIVATIVES (probably just supported by Debian packages) RED HAT FAMILY SUSE FAMILY OTHER LINUX DISTROS BSD: SunOS: That's a lot of OS-specific packages we'd need to supply! Of course, this is possible if we have a method of automatically converting sources with a FORMULA file into an SPM package inside a bistro-specific package. But then you'd also have to host separate repositories for all of them, or do a whole lot more work to comply with all the distro-specific rules to be added into their repo's. And updates would be slow, unsupported or you'd get stuck om some volatile list where stuff like anti-virus software stores it's definitions. I'm not saying that there is no way it could work, but adopting an existing domain-specific packaging system seems to be a lot more sensible than sticking SPM inside a package. Aside form the whole packaging deal; what about a Salt-branded website where you can browse formulas? That would be a good thing in general, even if it only has links to github repos or SPM files. So far, to me, it looks like a few things will be needed to get this working:
|
Beta Was this translation helpful? Give feedback.
-
I'm actually glad that none of the saltstack-formulas are intentionally specific to just one package. A number of them do explicitly support multiple distributions, usually RedHat and Ubuntu at the very least. And since SPM is platform independent, we have ability to create a single Apache package (for instance) that can be used for multiple OSes. |
Beta Was this translation helpful? Give feedback.
-
I have this bad feeling that Salt will implement this for their top secret Salt Enterprise code and we'll have to make one ourselves out-of-tree :( |
Beta Was this translation helpful? Give feedback.
-
@themalkolm @johnkeates to be clear this is a proposal to generally leave behind spm conceptually most other python projects use pypi/pip to handle dependencies, and despite its shortfalls, consistency is important within a development community. If we use pip to handle dependencies:
we do not solve:
My ProposalA file server backend that loads a list of python modules (specified in master config) and uses their contents to expose files to the file server A simple import could be created to convert a file server/FORMULA root into a python package. This could be used to generate scaffolding for formulas. sample package:
QuestionIs there some reason that this proposal doesn't make sense, and what pitfalls do others see with this approach (aside from learning curve due to the difficulties of python packaging) After I have feedback, I have budget and time to complete something like this as my company is currently trying to figure out how to deploy changing infrastructure code for highly custom deployments (read can't fit in a docker container) and I'd be happy to work on this, but I want to make sure that my approach isn't misguided References: |
Beta Was this translation helpful? Give feedback.
-
@DanielFallon in the end we simply write rpm packages for all formulas. For custom behaviour during installation there are yum plugins. Made no sense for us to continue with spm. |
Beta Was this translation helpful? Give feedback.
-
@sjorge @Ch3LL This is what I was talking about this afternoon when compared to puppet modules or ansible roles. (Although when I first looked at Salt, SPM didn't exist, and it seems to go in the right direction) I share a lot of @johnkeates's ideas/concerns. If it's part of enterprise (?), I do hope it comes to open-source. I think it could give a big boost to the Salt adoption. |
Beta Was this translation helpful? Give feedback.
-
I spoke offline internally with the team to get some answers and this is something that we are wanting to do open source wise but is not currently being worked on due to other higher priority task items. But its something that we definitely want to do. :) |
Beta Was this translation helpful? Give feedback.
-
It's been briefly discussed in this thread, but there absolutely needs to be strong guarantees around package versions. Every package manager referenced in this thread has significant complexity around declaring versions, upgrading versions (by patch level, minor, etc), and allowing/disallowing multiple versions to be installed. Something which hasn't been discussed thoroughly is what versions of a package a SaltStack administrator wishes to have installed. I may want All package managers wrestle with this, and the result in every case has been to create yet another file that declares dependencies and the ideal versions (Ruby: Gemfile; Python: requirements.txt, setup.py, Pipfile; NPM: package.json; PHP: composer.json). I like @DanielFallon's proposal as:
|
Beta Was this translation helpful? Give feedback.
-
While talking about an SPM repository, central or not, there's one potentially quite important thing that most of package managers do, where pypi (and currently SPM) don't seem to - signing packages to prove where they came from and that they weren't modified. Are there any ideas around that? |
Beta Was this translation helpful? Give feedback.
-
So this is still open... I've seen some work on related tickets, but does that mean this is idle or simply not going to happen? |
Beta Was this translation helpful? Give feedback.
-
as it currently sits it is simply idle and not currently being worked on due to other higher priorities. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Beta Was this translation helpful? Give feedback.
-
Not stale. |
Beta Was this translation helpful? Give feedback.
-
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
-
I agree with @dafyddj. I also plan to have a self-hosted SPM server, based on POC given in #43318, but probably with Sonatype Nexus repository. |
Beta Was this translation helpful? Give feedback.
-
That seems to be a Swift repo, not SaltStack. |
Beta Was this translation helpful? Give feedback.
-
Not Stale, just in case. |
Beta Was this translation helpful? Give feedback.
-
Create a central repository for SPM to make it actually useful.
There currently is no usable central SPM repository to use, this makes SPM actually less useful than maintaining a mess of git submodules in a git repository to manage formulas. At this moment, either home-cooked formulas or formulas from github.com/saltstack-formulas are the best source, and SPM plays no role in it. No formula on the saltstack-formulas repo has any SPM metadata (as far as I could find) and there is no usable dependency management as a result.
Now that the SPM format is defined, it would be helpful for something like a central PECL-style or Packagist-style repository to be available. Adding a salt-provided community-driven central repository would also help with adopting the SPM format.
Beta Was this translation helpful? Give feedback.
All reactions