Using Julia package manager offline

We recently decided to make Julia Language available on our cluster systems. The cluster system is not able to connect to the internet. Is there any way to download all Julia packages and make them available for our different users to install and use them offline?

Another option that we have is a system that can connect to the internet temporarily, but it is always connected to the main cluster system. Is there any way to use this system as a mirror for the Julia packages or not?

We want to use “Julia 1.0.1”.

our cluster operation system is: "CentOS 5.5

notes: I have seen the question asked before here, but it is for Julia 0.6 and a single package that will be copied by hand. I want that user uses the Pkg.add <pkgName> command but instead of the internet, the package manager gets the packages from our offline system.

Thank you for your help and time.

xref: Using Julia package manager offline - Stack Overflow

See some discussion in How does one set up a centralized Julia installation? and How to create a system administrator depot?

1 Like

thanks for the discussion links.
A question:
How can I get latest Julia packages for Julia 1.0 so that I can have them available offline?

Nothing short of adding them manually I think. I have thought about something like

pkg> registry instantiate

to “instantiate” a registry, that is, download all the packages in there, similar to how you can instantiate a Manifest.toml to get all packages in there.

I did this and it seems to work for me but with a problem!
First, by userA I add all the packages. But I don’t precompile anything.
Then I open the Julia in userB terminal and execute this command to push the userA DEPOT_PATH into userB DEPOT_PATH.

push!(DEPOT_PATH,"/home/userA/.julia")

the result is something like this:

3-element Array{String,1}:
 "/home/userB/.julia"                                   
 "/home/userB/julia-1.0.2/local/share/julia"
 "/home/userB/julia-1.0.2/share/julia"      
 "/home/userA/.julia"

Now when I use add [packageName] the Julia uses the added packages from the userA (“/home/userA/.julia”) path, and when I use precompile the results files will be stored in userB directory (“/home/userB/.julia”). By this way, There is no need to copy packages for all users, and each user can have different projects, etc.

But I have a problem. It is necessary to execute push! command every time a user starts Julia. I tried using export JULIA_DEPOT_PATH The result is:

1-element Array{String,1}: 
 "/home/userA/.julia"

and it causes an error when using packages (obviously because the userB has not permission to write in the userA directory).
It is needed to have all for paths in DEPOT_PATH.

Is there any way to set these 4 paths for each user without using push! command when a user starts Julia? I mean for example in bash or even by changing soething in julia source codes?

I found the answer.
There is a file named startup.jl in the julia-1.0.2/etc/julia path. anything in this file will be executed before the startup of Julia.
so I puted the push!() command inside this file and It’s done.
:slight_smile:

1 Like