AutoPKG + AutoPKGR understanding repository interaction

98 views
Skip to first unread message

Alan Auckland

unread,
Sep 28, 2023, 9:07:29 AM9/28/23
to autopkg-discuss
Hello,
I'm fairly new to AutoPKG and working with some things that are already setup.
I am hoping someone could help me understand how this would work. 

We had Munki, autopkg and autopkgr set up on a remote mac.
We use a repository to manage the munki side at least. 
The MacMini is not currently usable so my colleague and myself have to set up autopkg on our local devices to run the recipes.

My colleague set his autopkg up manually, but what I have been trying to do is figure out how we can make it so that enabling the repos is not a manual task. Moving autopkg between us and hosts would be a thing that would happen infrequently and missing a repo would be easy to do.
Whilst doing that I'm worried we might not have things setup and working how it was explained to me.

I was told that some repos have been "enabled" in autopkgr by checking the checkbox on because we want app x to use repo x and not repo z.
What I have noticed is that some repos have recipes for the same apps.
So there is an instance where we have enabled repos but still have recipes appearing in multiple ones, so if I were to run the recipe list, I am thinking that the list would choose the first one it comes to which might not be the repo we wanted to use.

We only have one recipe in the override directory. I don't fully understand it, but is this where we would explicitly say hey for this APP (EG Inkscape) Use only this Repo and ignore any others that might have a recipe for this app?

I also came across this post to try to re-create autopkg configuration on my local:
https://groups.google.com/g/autopkg-discuss/c/euxx3IxdzJg/m/q7qFRTStBwAJ

I tried pulling the data from my colleague's device onto my own.
Added those files into our repo with the idea to  symlink the files from the repo to the correct location. I wrote a setup bash script to do this and take ownership.
AutoPKG still didn't have any repos in a "checked" or "enabled" state so I think I would have to manually compare with my colleague's state which I am trying to avoid.
I'd like to if possible turn on a repo, the config to be saved and pushed in git so when my colleague next does a autopkgr task his config/setup is in sync with mine.

I hope that makes some sense. I appreciate this might not be achievable but any guidance would be appreciated.
Many thanks!

Anthony Reimer

unread,
Sep 28, 2023, 11:18:36 AM9/28/23
to autopkg...@googlegroups.com
Lots to unpack here. Responses inline:

> My colleague set his autopkg up manually, but what I have been trying to do is figure out how we can make it so that enabling the repos is not a manual task.


There are a number of people in the community that use AutoPkg (command line) in a CI/CD environment, so there are definitely things that can be done to automate this. (I don’t do this, but I believe the —-pull option for the info or make-override verbs will be helpful here.)


> I was told that some repos have been "enabled" in autopkgr by checking the checkbox on because we want app x to use repo x and not repo z.


This is not correct if you are doing things the way the AutoPkg Wiki advises. The normal workflow is to find the exact recipe you want to run, make an override, adjust Input variables as necessary within the override, and then run the override.


> What I have noticed is that some repos have recipes for the same apps.
> So there is an instance where we have enabled repos but still have recipes appearing in multiple ones, so if I were to run the recipe list, I am thinking that the list would choose the first one it comes to which might not be the repo we wanted to use.


If you are not using overrides AND you are running recipes by name (rather than identifier), then yes, the first matching recipe name will be run. An override will be run before any recipe in a repo.


> We only have one recipe in the override directory. I don't fully understand it, but is this where we would explicitly say hey for this APP (EG Inkscape) Use only this Repo and ignore any others that might have a recipe for this app?


If you grasp what I said above, (a) the fact that you only have one override is a bit of an issue, and (b) the existence of the override itself says to AutoPkg, “run the specific recipe of which this is an override and use the input variable values specified in the override, checking trust information to see if any related recipe has changed.” Making overrides for every recipe you want to run makes this process much simpler.


> I also came across this post to try to re-create autopkg configuration on my local:
> https://groups.google.com/g/autopkg-discuss/c/euxx3IxdzJg/m/q7qFRTStBwAJ


Some things have changed since Elliot wrote those instructions. AutoPkgr can no longer install AutoPkg, for instance. But it at least highlights things to look for.


> I tried pulling the data from my colleague's device onto my own.
> Added those files into our repo with the idea to symlink the files from the repo to the correct location.


You can change the location of any of the key directories AutoPkg uses. AutoPkgr can even do this. You shouldn’t have to symlink.


> AutoPKG still didn't have any repos in a "checked" or "enabled" state so I think I would have to manually compare with my colleague's state which I am trying to avoid.


Repos are “checked” in AutoPkgr when the repo is present in ~/Library/AutoPkg/RecipeRepos (or the alternate location you specified as per the wiki or via AutoPkgr).


> I'd like to if possible turn on a repo, the config to be saved and pushed in git so when my colleague next does a autopkgr task his config/setup is in sync with mine.


If you are overriding everything, then you really only need to version control the RecipeOverrides folder and the recipe list you are running (which I presume you are doing because you are using AutoPkgr).

Again, people with CI/CD experience may be able to assist better than I, but this should at least give you greater clarity.

Anthony Reimer
Integrated Arts Media Labs
University of Calgary

Alan Auckland

unread,
Oct 2, 2023, 9:25:57 AM10/2/23
to autopkg...@googlegroups.com
Thank you, 

I need to re-read this slow time but it does confirm my suspicion that we should be using the RecipeOverrides as I was suspecting. 
Our recipe_list has been created using the format
   com.reponame.appname.  

 My colleague was telling me that, that is how it knows to select the right recipe rather than just giving the app name only. 

It would be great to see an example of a CI/CD setup. 

 I tried to pull my colleague's autopkgr config, put that into our repo and write a script to symlink them
but I just broke autopkgr to the point an uninstall and reinstall wouldn't work anymore. (was telling me there was no default preferences found, even if i selected them manually)
So I am a bit apprehensive to try again. 

Essentially two of us are comfortable using the CLI and one other prefers the GUI, so we need to make it work for both preferably. 
My hope is to find a way that when either of us get a new laptop or we have to migrate the remote mac mini for upgrades etc
it is as simple as installing autopkg, autopkgr, pull the repo, running I guess a setup script and your back in business 

again thank you for the better understanding. I will pass this back and see where it takes us in the meantime.

--
You received this message because you are subscribed to a topic in the Google Groups "autopkg-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/autopkg-discuss/1DHBnBZDDro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autopkg-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autopkg-discuss/FD8D4DCF-E214-4193-BADB-EAD7AD4F291F%40ucalgary.ca.
Reply all
Reply to author
Forward
0 new messages