Skip to content

JuliaComputing/DepotDelivery.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DepotDelivery

Build Status

DepotDelivery bundles a Julia project into a standalone depot that can run in air-gapped environments.

Features

  • Bundles all necessary Julia code and artifacts needed to run without internet access.
  • Build for platforms other than the host platform.
  • Can build multiple packages/projects into a single path.
  • Can precompile all dependencies to built path.

Usage

Example 1

using DepotDelivery: build

# Assumes `path/Project.toml` exists (or `path/JuliaProject.toml`)
path = build(path_to_project; platform = Base.BinaryPlatforms.HostPlatform())
  • path is the ready-to-ship depot.
  • Your project lives at $path/dev/MyProject.
  • The build settings live in $path/config/depot_build.toml
  • Run this in the production environment to get started: include("$path/config/depot_startup.jl").

Example 2

This example shows how to build a depo path from different Project.toml files, enabling precompilation as needed.

using DepotDelivery: build

# We can provide a depot_path to share DEPOT_PATH 
depot_path = "path/to/depot/"

# Assumes `path/Project.toml` exists (or `path/JuliaProject.toml`) in each entry of first argument, and force precompilation.
path = build(["path/project-1", "path-2/project-2"]; depot=depot_path, precompiled=true)

Be aware that build will copy everything inside those directories to depot_path/dev/. Avoid populating those directories with unnecessary files. For example, when starting a new project, it's better to run julia --project=./isolated_folder/ rather than julia --project=., as in the latter case the Project.toml file will coexist with other stuff.

Building for Non-Host Platforms

  • Use any Base.BinaryPlatforms.AbstractPlatform as the platform argument.
  • See Julia's supported OS/architectures.
  • See ?Base.BinaryPlatforms.Platform and the types in Pkg.BinaryPlatforms for details, e.g.
import Pkg

Base.BinaryPlatforms.Platform("windows", "x86_64"; cuda == "10.1")

# `arch` argument must be in (:x86_64, :i686m, :armv7l, :armv6l, :aarch64, :powerpc64le)
Pkg.BinaryPlatforms.Windows(:x86_64)
Pkg.BinaryPlatforms.MacOS()
Pkg.BinaryPlatforms.Linux(:powerpc64le)
Pkg.BinaryPlatforms.FreeBSD(:armv7l)

Limitations

  • The parts of your dependencies that expect/require internet access will not work (this should be expected).
  • It's assumed your package is completely standalone, and won't need to be used with packages outside of the provided project file.