How does one set up a centralized Julia installation?

I think I kind of succeeded in manually setting up a centralized Julia installation and some pre-installed packages. I don’t know if this is best practices (probably not) but it is working for now. In general, if one has the resources, it is probably worth looking into JuliaTeam However, here is my setup in random order:

  • For each user, set the JULIA_DEPOT_PATH environment variable to a stack of paths where the first points to a user-writeable directory and the second is read-only, e.g. export JULIA_DEPOT_PATH=/home/$USER/julia_depot:/global/depot/path
  • when working as admin to install and update packages, reverse the order of the paths, so that the central installation comes first
  • Registries delete the General registry from the global repository, e.g. delete the folder /global/depot/path/registries. Otherwise when the user runs pkg operations the package manager would always try to update all regirstries, but does not have write access to the global one, also the package manager would keep asking from which registry to install a package. If you want to maintain an internal registry to register internal packages, this is the place to put it
  • now, as admin user you create a shared environment e.g. (Pkg.activate("globalenv",shared=true)) and install all the packages you want to be available for users in this environment the environment will be placed in /global/depot/path/environments/globalenv
  • to make the global packages loadable by the user you have to add this environment to the user’s environment stack. This is done by modifying the LOAD_PATH, so the user must add either run export JULIA_LOAD_PATH="@:@v#.#:@stdlib:/global/depot/path/environments/globalenv" from their bashrc or directly push the env path to their LOAD_PATH from within julia.

Hope this helps and good luck setting this up.

14 Likes