Closed bjones1 closed 2 years ago
This is a larger PR, though most of the changes are in the docs. Hopefully, it's the last major fix to the Docker stuff for a while.
Is this going to force me and others with working setups to change our directory structure? I can't tell.
No (mostly):
runestone init
will clone repos in rsdocker/
instead of the current directory.docker-tools
from a virtual environment.Why will it insist on a VE for macOS? Not linux? Not Windows? That seems like a weird distinction, further just a few weeks ago nothing worked if I tried to use a VE now I'm going to have to.
OS X weirdness / a workaround. For some reason, on OS X running pip install -e docker
to install rsmanage
means that rsmanage
isn't on the $PATH. It is for Windows and Linux. However, putting this in a venv on OS X makes these commands work (after activating the venv, which does the $PATH updates needed). I have no idea why OS X does this. The only thing in the venv is click
and the rsmanage
and docker-tools
scripts. The venv is stored in a separate directory from the Docker Poetry environment and doesn't interact with it.
I guess for me because I installed python using homebrew both docker-tools and rsmanage are installed in the /opt/homebrew/bin path which is added to one's path by homebrew.
I'm concerned about forcing someone to have a particular virtual environment as I have many different VE s that I move between all of which allow me to run poetry, docker-tools, and rsmanage.
I don't mean to make it more complicated, but I wonder if the confusion isn't from people on older macos using the delivered version of python. In reality I think we should be telling people to install homebrew and then install a version of python with homebrew. ? homebrew is also a good way to install docker. brew install --cask docker
gives you the same docker desktop app as downloading a dmg.
Both David Farmer and Barb's Macs put their files in completely different directories. ??? I'd assumed their Python came from Homebrew, but I could be wrong.
For Mac, you're in charge -- this was just my best guess at making it easier to install on Mac. If Homebrew guarantees that this works right, then that seems like a simpler solution and I'll be happy to pull the venv stuff out. Anything that avoids manual edits to $PATH works for me.
OK, I'm going to make a test user on my mac and see if I can figure out what is going on.
Both David and Barb had new new M1 Macs. We never touched Python 2; I thought OS X didn't ship with Python 3 at all.
I fully agree with using homebrew to install Docker -- that's now in this PR.
Thanks for Mac help. At some point, I'll rent another macincloud, but I have so little need for that other than the occasional Docker stuff.
There is no docker group on macOS. So the command you added will fail. Do not add one. the docker issues I was having were because I added a new user, but only logged in from the command line as that user. I didn't login as as that new user with the GUI and startup docker desktop for myself.
With that I will confirm that with homebrew installed and FIRST in my path. Then running init put rsmanage and docker-tools in the expected (/opt/homebrew/bin) for me.
HOWEVER!!
For Homebrew, the default prefix is: /usr/local for macOS on Intel, /opt/homebrew for macOS on Apple Silicon/ARM, and /usr/local for Rosetta 2 to coexist and use bottles.
On a stock mac install /etc/paths contains /usr/local/bin BUT NOT /opt/homebrew/bin
So, for macOS users I would recommend that they edit /etc/paths and add /opt/homebrew/bin as the first line in that file. Then I would say to install homebrew following the instructions (https://brew.sh/) Then they should brew install python@3.10 run which python3 -- should say /opt/homebrew/bin They can install poetry with brew install poetry. Then go ahead and do the bootstrapping.
This should remove the need for a VE as docker-tools and rsmange will get installed in /opt/homebrew/bin
OK, I finally integrated these updates. I didn't realize this wasn't a draft PR and force-pushed a rebase and some fixes.
OK, finally wrapping this up. Ready for (re-)review.
This puts all the cloned repos in the
rsdocker/
subdirectory.On OS X, it runs everything in a venv placed in
rsdocker/rsvenv
.There are also lots of docs fixes and improvements.