autopkg / recipes

Recipes for AutoPkg
230 stars 207 forks source link

FR: Make GenerateRelocatablePython a Shared Processor #390

Closed apizz closed 3 years ago

apizz commented 3 years ago

Describe the problem Recently needed to create our own Python framework utilizing https://github.com/gregneagle/relocatable-python with some custom requirements and discovered that within this repo there exists a custom GenerateRelocatablePython.py script used in conjunction with a recipe for packaging autopkg.

Preferences contents N/A

AutoPkg output N/A

Expected behavior In a perfect world, I'd like to see GenerateRelocatablePython become a Shared Processor. This change would allow a single RelocatablePython recipe to be made which admins could customize with their desired install path, python version, and requirements for their own deployments.

Version (please complete the following information):

nmcspadden commented 3 years ago

Why does this need to be a Shared processor? Seems like it could just be a regular processor for a Python recipe, and the recipe itself should be flexible and customizable enough.

Does this recipe exist yet?

On Wed, May 12, 2021 at 10:13 PM AP Orlebeke @.***> wrote:

Describe the problem Recently needed to create our own Python framework utilizing https://github.com/gregneagle/relocatable-python with some custom requirements and discovered that within this repo there exists a custom GenerateRelocatablePython.py script used in conjunction with a recipe for packaging autopkg.

Preferences contents N/A

AutoPkg output N/A

Expected behavior In a perfect world, I'd like to see GenerateRelocatablePython become a Shared Processor. This change would allow a single RelocatablePython recipe to be made which admins could customize with their desired install path, python version, and requirements for their own deployments.

Version (please complete the following information):

  • OS version: any
  • AutoPkg Version: latest

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/autopkg/recipes/issues/390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJFTX5WDSKMJDLDINIFU2DTNNNX7ANCNFSM44Z4P5RQ .

--

Nick McSpadden @.***

apizz commented 3 years ago

I have the recipe currently in a priv repo only. That said, and maybe I'm just not fully clear, but the point of making something like GenerateRelocatablePythong a shared processor is so that others can use in their own recipes without needing to make / maintain a separate copy of the python script in their own repo

apizz commented 3 years ago

The only requirement then is cloning the repo the shared processor lives in

nmcspadden commented 3 years ago

I'm still unclear on why different recipes would need to use a common "generate python" processor. I'm not really understanding what your end goal looks like. Can you describe at a higher level how you see this being used? What recipes do you have/foresee that will require this?

On Sun, May 16, 2021 at 11:20 AM AP Orlebeke @.***> wrote:

The only requirement then is cloning the repo the shared processor lives in

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/autopkg/recipes/issues/390#issuecomment-841855729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJFTXYIQBI5G2UEEIW2HPLTOAEILANCNFSM44Z4P5RQ .

--

Nick McSpadden @.***

apizz commented 3 years ago

So I see 2 scenarios at the moment:

  1. Admin wants to deploy a particular version of Python w/ specified dependencies in their environment. This is where my proposed recipe would come in, and where the admin could specify as part of Input variables where this is installed in order to more efficiently package this up and pull it into however they deploy packages.
  2. An admin who likr autopkg needs a relocatable Python within their project and wants to build the resulting PKG in the same way that the autopkg project itself does.

Am I incorrect that in both cases an admin would have to make a copy of the GenerateRelocatablePython processor to address this? I'm taking this directly from: https://github.com/autopkg/autopkg/wiki/Processor-Locations#shared-recipe-processors

gregneagle commented 3 years ago

I think this sounds like a house of cards. I'm not terribly comfortable with people building increasingly complex toolsets on top of my relocatable-python project. I make zero promises that I'll keep it compatible with things that use it. I make zero promises that it will continue to work the same way as it does today and output the same artifacts. Heck, I don't even promise to maintain it.

gregneagle commented 3 years ago

All this said, I don't understand why you cannot use GenerateRelocatablePython as a shared processor right now. You'd have to repo-add the recipes repo, but that's not a tough ask. You'd then use "com.github.autopkg.AutoPkgGitMaster/GenerateRelocatablePython" as the processor name, ala https://github.com/autopkg/autopkg/wiki/Processor-Locations#shared-recipe-processors

apizz commented 3 years ago

Hmm, I didn't realize you could use it that way without having a stub recipe. I'll give that a go.

apizz commented 3 years ago

Confirmed that worked as expected. Thanks!