Job submission
On JuliaHub you can submit jobs, which are user-defined workloads that get allocated a dedicated compute capacity. For example, this includes running scripts in batch computations, cloud IDEs, interactive notebooks and so on. The functions and types here deal with starting up such jobs and apps. The functions to inspect running or finished jobs are documented separately.
- Compute configuration
- Runtime configuration
- Batch jobs
- Default Applications
- External package applications
- Reference
- Experimental APIs
- Index
A complete JuliaHub job workload is defined by the following configuration pieces:
Job configuration. This specifies the computation that gets run, and includes information such as the type of computation (batch script vs starting a GUI application), any arguments or Julia code that gets passed to the job etc.
As of now, there are three general types of jobs that can be run on JuliaHub:
- Batch jobs: non-interactive Julia scripts
- Default Applications: special, built-in, interactive applications (such as IDEs or product-specific dashboards)
- External package applications: Julia packages that can be run as either interactive or non-interactive jobs
Each of these categories are configured slightly differently, and are described in more detail below.
Compute configuration. This specifies the hardware and cluster topology that will be used to execute the job (such as the number of CPUs per node, whether there is a GPU present, the number of nodes), how the Julia processes are configured (e.g. single process per node vs process per cpu), and other low-level technical configuration.
Runtime parameters. These are various additional parameters that control how a job behaves. Currently, this is limited to passing environment variables to the jobs, overriding the job's name in the UI, and to various configuration options related to running interactive jobs.
In the JuliaHub.jl code, the first two categories are encapsulated by the AbstractJobConfig
and ComputeConfig
types. These two, together with the additional runtime parameters, make up a WorkloadConfig
object that can be submitted to JuliaHub for executing with the submit_job
function.
The following sections on this page explain the different aspects of job submission in more detail. See the guide on submitting batch jobs to see more practical examples of how to submit jobs.
Compute configuration
JuliaHub supports a predefined set of node configurations, each of which have a specific number of CPUs, memory, GPUs etc. A JuliaHub job must pick one of these node types to run on, although a distributed job can run across multiple instances of the same node type. A list of these node specifications can be obtained with the nodespecs
function (returning a list of NodeSpec
objects).
julia> JuliaHub.nodespecs()
9-element Vector{JuliaHub.NodeSpec}:
JuliaHub.nodespec(#= m6: 3.5 GHz Intel Xeon Platinum 8375C, 0.17/hr =#; ncpu=2, memory=8, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= r6: 3.5 GHz Intel Xeon Platinum 8375C, 0.22/hr =#; ncpu=2, memory=16, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= m6: 3.5 GHz Intel Xeon Platinum 8375C, 0.33/hr =#; ncpu=4, memory=16, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= r6: 3.5 GHz Intel Xeon Platinum 8375C, 0.42/hr =#; ncpu=4, memory=32, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= m6: 3.5 GHz Intel Xeon Platinum 8375C, 0.65/hr =#; ncpu=8, memory=32, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= r6: 3.5 GHz Intel Xeon Platinum 8375C, 1.3/hr =#; ncpu=8, memory=64, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= m6: 3.5 GHz Intel Xeon Platinum 8375C, 2.4/hr =#; ncpu=32, memory=128, ngpu=false, exactmatch=true)
JuliaHub.nodespec(#= p2: Intel Xeon E5-2686 v4 (Broadwell), 1.4/hr =#; ncpu=4, memory=61, ngpu=true, exactmatch=true)
JuliaHub.nodespec(#= p3: Intel Xeon E5-2686 v4 (Broadwell), 4.5/hr =#; ncpu=8, memory=61, ngpu=true, exactmatch=true)
While you can manually index into the list returned by nodespecs
, that is generally inconvenient. Instead, the nodespec
function should be used to find a suitable node for a particular job.
julia> JuliaHub.nodespec(ncpu=2, memory=8)
Node: 3.5 GHz Intel Xeon Platinum 8375C
- GPU: no
- vCores: 2
- Memory: 8 Gb
- Price: 0.17 $/hr
By default, nodespec
finds the smallest node that satisfies the specified requirements. However, it also supports the exactmatch
argument, which can be use to find the exactly matching node configuration.
julia> JuliaHub.nodespec(ncpu=3, memory=5; exactmatch=true)
ERROR: InvalidRequestError: Unable to find a nodespec: ncpu=3 memory=5 gpu=false
Stacktrace:
...
julia> JuliaHub.nodespec(ncpu=3, memory=5)
Node: 3.5 GHz Intel Xeon Platinum 8375C
- GPU: no
- vCores: 4
- Memory: 16 Gb
- Price: 0.33 $/hr
By default, JuliaHub jobs run on a single node. However, for a distributed job, additional nodes can be allocated to a job by specifying the nnodes
parameter. In that case, a Julia process is started on each node, and the additional nodes are linked to the main process via the Distributed
module.
While by default only a single Julia process is started on each node, by setting the process_per_cpu
parameter, multiple Julia processes are started on the same node. The processes are isolated from each other by running in separate containers, but they share the CPUs, GPUs, and most crucially, the memory.
See ComputeConfig
and submit_job
for more details on how exactly to set up this configuration.
Runtime configuration
The submit_job
function accepts various additional parameters that control aspects of the job. See the function's docstring for more details.
Parameter | Description |
---|---|
name | can be used to override the name of the job shown in the UI |
project | specifies the JuliaHub project UUID that the job is associate with |
timelimit | sets the time limit after which the job gets killed |
env | environment variables set at runtime |
As an example, to have an environment variable set while the job is running, you could call submit_job
as follows:
JuliaHub.submit_job(
JuliaHub.script"""
@info "Extracting 'MY_PARAMETER'" get(ENV, "MY_PARAMETER", nothing)
""",
env = Dict("MY_PARAMETER" => "example value"),
dryrun = true
)
JuliaHub.WorkloadConfig:
application:
JuliaHub.BatchJob:
code = """
@info "Extracting 'MY_PARAMETER'" get(ENV, "MY_PARAMETER", nothing)
"""
sha256(project_toml) = 62aca0c4b58726ab88c7beaa448e4ca3d51ba68c2d4f9c244b22e09dfe2919d1
sha256(manifest_toml) = 8a45e28aaeac067142b495ff5d7037cb795afe1c4ef7277c25359f2c45b73a1d
compute:
JuliaHub.ComputeConfig
Node: 3.5 GHz Intel Xeon Platinum 8375C
- GPU: no
- vCores: 2
- Memory: 8 Gb
- Price: 0.17 $/hr
Process per node: true
Number of nodes: 1
timelimit = 1 hour,
env:
MY_PARAMETER: example value
Batch jobs
Batch jobs are Julia scripts with (optional) associated Julia package environments (Project.toml
, Manifest.toml
and/or Artifacts.toml
) that run on the cluster non-interactively.
See also: @script_str
, script
, appbundle
for more details, and the guide on submitting batch jobs for a tutorial.
Specifying the job image
JuliaHub batch jobs can run in various container images. Different JuliaHub products often have their own image tailored for the application (e.g. that come with custom sysimages to reduce load times).
The list of all images available to the user can be obtained with batchimages
, and a specific one can be picked out with batchimage
. The latter function is particularly useful when submitting jobs.
JuliaHub.submit_job(
JuliaHub.BatchJob(
JuliaHub.script"""
using SpecialProductModule
SpecialProductModule.run()
""",
image = JuliaHub.batchimage("specialproduct"),
)
)
Default Applications
Starting application jobs with JuliaHub.jl is considered to be experimental. The APIs are likely to change in future JuliaHub.jl version.
Default applications are the JuliaHub-built in applications (such as dashboards and IDEs), generally associated with specific JuliaHub products. Specific examples of default applications available to everyone include the Pluto notebooks and the Julia IDE.
The list of available applications can be accessed via the applications
function, and specific applications can be picked out with application
.
julia> apps = JuliaHub.applications()
7-element Vector{JuliaHub.AbstractJuliaHubApp}:
JuliaHub.application(:default, "Linux Desktop")
JuliaHub.application(:default, "Julia IDE")
JuliaHub.application(:default, "Pluto")
JuliaHub.application(:default, "Windows Workstation")
JuliaHub.application(:package, "RegisteredPackageApp")
JuliaHub.application(:package, "CustomDashboardApp")
JuliaHub.application(:user, "ExampleApp.jl")
julia> JuliaHub.application(:default, "Pluto")
DefaultApp
name: Pluto
key: pluto
A JuliaHub job that launches an application can be started by passing the object returned by the application
function to submit_job
.
import JuliaHub # hide
JuliaHub.submit_job(
JuliaHub.application(:default, "Pluto"),
ncpu = 8, memory = 16,
)
External package applications
Starting package application jobs with JuliaHub.jl is considered to be experimental. The APIs are likely to change in future JuliaHub.jl version.
Specially crafted Julia packages can also be launched as JuliaHub jobs. They are either automatically picked up from the packages registries served by the JuliaHub instance (PackageApp
), or added by users themselves (UserApp
) via a Git URL.
A package application must have a top-level package environment (i.e. it has a Project.toml
the declares a name and a UUID), and it must have a entry script at bin/main.jl
. When a package job starts, the package is added to an environment and bin/main.jl
is called. Note that the bin/main.jl
script does not have any access to any of the package dependencies.
The applications
function can list all available packages (with filtering for user or registered). JuliaHub.application
can be used to pick a package by name. It works for both registered packages
JuliaHub.submit_job(
JuliaHub.application(:package, "RegisteredPackageApp"),
ncpu = 4,
)
and for private, user applications
JuliaHub.submit_job(
JuliaHub.application(:user, "ExampleApp.jl"),
ncpu = 4,
env = Dict("example_parameter" => "2")
)
Environment variables (i.e. env
) are a common way to communicate options and settings to package applications.
Reference
JuliaHub.NodeSpec
— Typestruct NodeSpec
Stores information about a compute node that can be allocated for JuliaHub jobs. The list of all available node specifications can be accessed with nodespecs
, or specific ones searched with nodespec
.
julia> JuliaHub.nodespec()
Node: 3.5 GHz Intel Xeon Platinum 8375C
- GPU: no
- vCores: 2
- Memory: 8 Gb
- Price: 0.17 $/hr
They can be used to contruct explicit compute configuration objects when submitting JuliaHub jobs.
See also: submit_job
, ComputeConfig
.
JuliaHub.nodespecs
— FunctionJuliaHub.nodespecs(; auth::Authentication) -> Vector{NodeSpec}
Query node specifications available on the current server, returning a list of NodeSpec
objects.
JuliaHub.nodespec
— FunctionJuliaHub.nodespec(
[nodes::Vector{NodeSpec}];
ncpu::Integer=1, ngpu::Integer=false, memory::Integer=1,
exactmatch::Bool=false, throw::Bool=true,
[auth::Authentication]
) -> Union{NodeSpec, Nothing}
Finds the node matching the specified node parameters. Throws an InvalidRequestError
if it is unable to find a node with the specific parameters. However, if throw
is set to false
, it will return nothing
instead in that situation.
By default, it searches for the smallest node that has the at least the specified parameters (prioritizing GPU count, CPU count, and memory in this order when deciding). If exactmatch
is set to true
, it only returns a node specification if it can find one that matches the parameters exactly.
A list of nodes (e.g. from nodespecs
) can also be passed, so that the function does not have to query the server for the list. When this method is used, it is not necessary to pass auth
.
JuliaHub.BatchImage
— Typestruct BatchImage
Represents an available JuliaHub batch job image. These can be passed to BatchJob
to specify which underlying job image will be used for the job.
A list of available batch images can be accessed with batchimages
and specific images can be constructed with batchimage
.
Objects of this type should not be constructed explicitly. The contructor methods are not considered to be part of the public API.
See also: batchimages
, batchimage
, BatchJob
, script
, appbundle
.
JuliaHub.batchimages
— FunctionJuliaHub.batchimages([product::AbstractString]; [auth::Authentication]) -> Vector{BatchImage}
Return the list of all batch job images available to the currently authenticated user, as a list of BatchImage
objects. These can be passed to BatchJob
.
Optionally, by passing a product identifier, the list can be narrowed down to images available for that specific product.
When using the package with an older JuliaHub instance (<= 6.1), the non-default batch images show up with @legacy
as the product name. This indicates that the package is using an older API, and not that the images themselves are outdated.
See also: BatchImage
, batchimage
, BatchJob
, script
, appbundle
.
JuliaHub.batchimage
— FunctionJuliaHub.batchimage(
[product::AbstractString, [image::AbstractString]];
throw::Bool=true, [auth::Authentication]
) -> BatchImage
Pick a product job batch image from the list of all batch image, returning a BatchImage
object. If image
is omitted, it will return the default image corresponding to product
. If product
is omitted as well, it will return the default image of the instance (generally the standard Julia batch image).
Will throw an InvalidRequestError
if the specified image can not be found. If throw=false
, it will return nothing
instead in this situation.
When using the package with an older JuliaHub instance (<= 6.1), the non-default batch images show up with @legacy
as the product name. This indicates that the package is using an older API, and not that the images themselves are outdated.
See also: BatchImage
, batchimages
, BatchJob
, script
, appbundle
.
JuliaHub.AbstractJobConfig
— Typeabstract type AbstractJobConfig
Abstract supertype of all application configuration types that can be passed to submit_job
for submission as a JuliaHub job. The package has built-in support for the following application configurations:
JuliaHub.BatchJob
— Typestruct BatchJob <: AbstractJobConfig
Represents the application configuration of a JuliaHub batch job. A batch job is defined by the following information:
- The Julia code that is to be executed in the job.
- Julia package environment (i.e.
Project.toml
,Manifest.toml
) and other files, such as the appbundle. - The underlying batch job container image (see also
batchimages
), which defaults to the standard Julia image by default.
Instances of this types should normally not be constructed directly, and the following functions should be used instead:
script
or@script_str
: for submitting simple Julia scripts or code snippetsappbundle
: for submitting more complex "appbundles" that include additional file, private or modified package dependencies etc.
Optional arguments
image :: Union{BatchImage, Nothing}
: can be used to specify which product's batch job image will be used when running the job, by passing the appropriateBatchImage
object (see also:batchimage
andbatchimages
). If set tonothing
(the default), the job runs with the default Julia image.sysimage :: Bool
: if set totrue
, requests that a system image is built from the job'sManifest.toml
file before starting the job. Defaults tofalse
.
The sysimage = true
option requires JuliaHub 6.3 to have an effect. When running against older JuliaHub versions, it does not have an effect.
Constructors
BatchJob(::BatchJob; [image::BatchImage], [sysimage::Bool]) -> BatchJob
Construct a BatchJob
, but override some of the optional arguments documented above. When the argument is omitted, the value from the underlying BatchJob
object is used. This is the only constructor that is part of the public API.
This method is particularly useful when used in in combination with the @script_str
string macro, to be able to specify the job image or trigger a sysimage build. For example, the following snippet will set a different batch image for the script-type job:
JuliaHub.BatchJob(
JuliaHub.script"""
@info "Hello World"
""",
image = JuliaHub.batchimage("...")
)
JuliaHub.script
— FunctionJuliaHub.script(...) -> BatchJob
Constructs the configuration for a script-type batch job, returning the respective BatchJob
object that can then be passed to submit_job
. A script-type batch job is defined by the following:
A user-provided Julia script that gets executed on the server. Note that no validation of the input code is done.
An optional Julia package environment (e.g.
Project.toml
,Manifest.toml
andArtifacts.toml
). If any of the TOML files are provided, they must parse as valid TOML files, but no further validation is done client-side.If the manifest is not provided, the project environment must be instantiated from scratch, generally pulling in the latest versions of all the dependencies (although
[compat]
sections are honored).It is also fine to omit the project file, and just provide the manifest, and the environment defined by the manifest still gets instantiated. If both are omitted, the job runs in an empty environment.
A JuliaHub job image, which determines the container environment that will be used to execute the code in (see
batchimage
,batchimages
,BatchImage
). If omitted, the default Julia image is used.
See also the @script_str
string macro to more easily submit simple scripts that are defined in code.
Methods
script(
scriptfile::AbstractString;
[project_directory::AbstractString], [image::BatchImage], [sysimage::Bool]
) -> BatchJob
Constructs a script-type batch job configuration the will execute the code in scriptfile
. Optionally, a path to a project environment directory can be passed via project_directory
, which will be searched for the environment TOML files, and a job image can be specified via image
.
script(;
code::AbstractString,
[project::AbstractString], [manifest::AbstractString], [artifacts::AbstractString],
[image::BatchImage], [sysimage::Bool]
) -> BatchJob
A lower-level method that can be used to construct the script-type BatchJob
configuration directly in memory (i.e. without having to write out intermediate files).
The code
keyword argument is mandatory and will specify contents of the Julia script that gets executed on the server. The Julia project environment can be specified by passing the contents of the TOML files via the corresponding arguments (project
, manifest
, artifacts
). The job image can be specified via image
.
See BatchJob
for a more thorough description of the optional arguments.
JuliaHub.@script_str
— MacroJuliaHub.@script_str -> JuliaHub.BatchJob
A string macro to conveniently construct a script-type batch job configuration (BatchJob
) that can be submitted as a JuliaHub job.
script = JuliaHub.script"""
@info "Hello World!"
"""
This allows for an easy submission of simple single-script jobs to JuliaHub:
JuliaHub.submit_job(
JuliaHub.script"""
@info "Hello World!"
"""
)
By default, the macro picks up the currently active Julia project environment (via Base.active_project()
), and attaches the environment .toml
files to the script. To disable this, you can call the macro with the noenv
suffix, e.g.
script = JuliaHub.script"""
@info "Hello World!"
"""noenv
However, if your local environment has development dependencies, you likely need to use an appbundle instead (see appbundle
).
There is no way to specify the job image with the string macro, and it will use the default Julia image. To use a different job image, you should either use the script
function, either by fully constructing the batch job configuration with the keyword arguments, or by using the BatchJob(::BatchJob; image=...)
method.
JuliaHub.submit_job(
JuliaHub.BatchJob(
JuliaHub.script"""
@info "Hello World!"
""",
image = JuliaHub.batchimage(...)
)
)
You can also use this pattern to set the sysimage
option.
JuliaHub.appbundle
— FunctionJuliaHub.appbundle(
directory::AbstractString, codefile::AbstractString;
[image::BatchImage], [sysimage::Bool]
) -> BatchJob
JuliaHub.appbundle(
directory::AbstractString;
code::AbstractString, [image::BatchImage], [sysimage::Bool]
) -> BatchJob
Construct an appbundle-type JuliaHub batch job configuration. An appbundle is a directory containing a Julia environment that is bundled up, uploaded to JuliaHub, and then unpacked and instantiated as the job starts.
The primary, two-argument method will submit a job that runs a file from within the appbundle (specified by codefile
, which must be a path relative to the root of the appbundle). The code that gets executed is read from codefile
, which should be a path to Julia source file relative to directory
.
JuliaHub.appbundle(@__DIR__, "my-script.jl")
Alternatively, if codefile
is omitted, the code must be provided as a string via the code
keyword argument.
JuliaHub.appbundle(
@__DIR__,
code = """
@show ENV
"""
)
See BatchJob
for a description of the optional arguments.
Extended help
The following should be kept in mind about how appbundles are handled:
The bundler looks for a Julia environment (i.e.
Project.toml
and/orManifest.toml
files) at the root of the directory. If the environment does not exist (i.e. the files are missing), the missing files are created. If the manifest is missing, then the environment is re-instantiated from scratch based on the contents ofProject.toml
. The generated files will also be left in the user-provided directorydirectory
.Development dependencies of the environment (i.e. packages added with
pkg> develop
orPkg.develop()
) are also bundled up into the archive that gets submitted to JuliaHub (including any current, uncommitted changes). Registered packages are installed via the package manager via the standard environment instantiation, and their source code is not included in the bundle directly.When the JuliaHub job starts, the bundle is unpacked and the job's starting working directory is set to the root of the unpacked appbundle directory, and you can e.g. load the data from those files with just
read("my-data.txt", String)
.JuliaHub 6.2 and older On some JuliaHub versions (6.2 and older), the working directory was set to the parent directory of unpacked appbundle (with the appbundle directory called
appbundle
), and so it was necessary to dojoinpath("appbundle", "mydata.dat")
to load files.When submitting appbundles with the two-argument
codefile
method, you can expect@__DIR__
andinclude
to work as expected.However, when submitting the Julia code as a string (via the
code
keyword argument), the behavior of@__DIR__
andinclude
should be considered undefined and subject to change in the future.The one-argument +
code
keyword argument method is a lower-level method, that more closely mirrors the underlying platform API. The custom code that is passed viacode
is sometimes referred to as the "driver script", and the two-argument method is implemented by submitting an automatically constructed driver script that actually loads the specified file.
As of JuliaHub.jl v0.1.10, the ability to launch appbundles using the two-argument method where the codefile
parameter point to a file outside of the appbundle itself, is deprecated. You can still submit the contents of the script as the driver script via the code
keyword argument.
JuliaHub.ComputeConfig
— Typestruct ComputeConfig
This type encapsulates the configuration of a jobs's compute cluster, including the hardware configuration and the cluster topology.
See also: submit_job
.
Constructors
JuliaHub.ComputeConfig(
node::NodeSpec;
nnodes::Integer = 1,
process_per_node::Bool = true,
elastic::Bool = false,
)
node
: aNodeSpec
object that specifies the hardware of a single node.nnodes::Union{Integer, Tuple{Integer, Integer}} = 1
: specifies the number of nodes of typenode
that will be allocated. Alternatively, a two-integer tuple can also be passed, where the first value specifies the minimum number of nodes required to start a job. By default, a single-node job is started.process_per_node::Bool = true
: if true, there will only be a single Julia process per node, and the total number of Julia processes will bennodes
. If set tofalse
, however, each core on each node will be allocated a separate Julia process (running in an isolated container on the same node), and so the total number of Julia processes will bennodes × ncpu
, and it will essentially always be a multi-process job.elastic::Bool = false
: if set, the job will be started in an elastic cluster mode. In this case, a minimum number ofnnodes
must not be passed.
JuliaHub.submit_job
— FunctionJuliaHub.submit_job(
app::Union{AbstractJuliaHubApp, AbstractJobConfig},
[compute::ComputeConfig];
# Compute keyword arguments
ncpu::Integer = 1, ngpu::Integer = 0, memory::Integer = 1,
nnodes::Integer = 1, minimum_nnodes::Union{Integer,Nothing} = nothing,
elastic::Bool = false,
process_per_node::Bool = true,
# Runtime configuration keyword arguments
[alias::AbstractString], [env], [expose::Integer],
[project::Union{UUID, AbstractString}], timelimit::Limit = Hour(1),
# General keyword arguments
dryrun::Bool = false,
[auth :: Authentication]
) -> Job
Submits the specified application config app
as a job to JuliaHub. Returns a Job
object corresponding to the submitted job.
Compute arguments. If compute
is passed, the compute keyword arguments can not be passed. If compute
is not passed, the following arguments can be used to specify the compute configration via keyword arguments:
ncpu
,ngpu
andmemory
are used to pick a node type that will be used to run the job. The node type will be a minimum one that satisfies the constraints, but may have more compute resources than specified by the arguments (it corresponds to theexactmatch = false
case ofnodespec
).nnodes
,minimum_nnodes
,process_per_node
, andelastic
specify the corresponding arguments inComputeConfig
.
Runtime configuration. These are used to set the Runtime configuration of the job.
alias :: Union{AbstractString, Nothing}
: can be used to override the name of the job that gets displayed in the UI. Passingnothing
is equivalent to omitting the argument.timelimit :: Limit
: sets the job's time limit (seeLimit
for valid values)env
: an iterable of key-value pairs that can be used to set environment variable that get set before, the job code gets executed.project :: Union{UUID, AbstractString, Nothing}
: the UUID of the project that the job will be associated with. If a string is passed, it must parse as a valid UUID. Passingnothing
is equivalent to omitting the argument.expose :: Union{Integer, Nothing}
: if set to an integer in the valid port ranges, that port will be exposed over HTTPS, allowing for (authenticated) HTTP request to be performed against the job, as long as the job binds an HTTP server to that port. The allowed port ranges are1025-9008
,
9010-23399,
23500-32767(in other words,
<= 1024,
9009,
23400-23499, and
>= 32768` can not be used). See the relevant manual section for more information.
General arguments.
auth :: Authentication
: optional authentication object (see the authentication section for more information)
dryrun :: Bool
: if set to true,submit_job
does not actually submit the job, but instead returns aWorkloadConfig
object, which can be used to inspect the configuration that would be submitted.The
WorkloadConfig
object can then be submitted to JuliaHub with the additionalsubmit_job
method:JuliaHub.submit_job(::WorkloadConfig; [auth::Authentication])
The timelimit = JuliaHub.Unlimited()
argument requires JuliaHub 6.3+.
JuliaHub.Limit
— TypeJuliaHub.Limit
Type-constraint on JuliaHub job timelimit
arguments in submit_job
.
The job time limit can either be a time period (an instance of Dates.Period
), an Integer
, (interpreted as the number of hours), or JuliaHub.Unlimited()
.
Only an integer number of hours are accepted by JuliaHub, and fractional hours from get rounded up to the next full integer number of hours (e.g. Dates.Minute(90)
will be interpreted as 2 hours).
JuliaHub.Unlimited
— Typestruct Unlimited
An instance of this type can be passed as the [timelimit
] option to submit_job
to start jobs that run indefinitely, until killed manually.
JuliaHub.submit_job(..., timelimit = JuliaHub.Unlimited())
JuliaHub.WorkloadConfig
— Typestruct WorkloadConfig
Represents a full job configuration, including the application, compute and runtime configuration.
Instances of this type can be constructed by passing dryrun = true
to submit_job
, and can also be directly submitted to JuliaHub with the same function.
Experimental APIs
Starting application jobs with JuliaHub.jl is considered to be experimental. The APIs are likely to change in future JuliaHub.jl version.
JuliaHub.AbstractJuliaHubApp
— Typeabstract type AbstractJuliaHubApp
Abstract supertype for JuliaHub applications object types.
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.applications
— FunctionJuliaHub.applications([category::Symbol]; [auth::Authentication]) -> Vector{AbstractJuliaHubApp}
Returns the list of applications enabled for the authenticated user, optionally in the specified category only. Returns a vector of AbstractJuliaHubApp
instances.
julia> JuliaHub.applications()
7-element Vector{JuliaHub.AbstractJuliaHubApp}:
JuliaHub.application(:default, "Linux Desktop")
JuliaHub.application(:default, "Julia IDE")
JuliaHub.application(:default, "Pluto")
JuliaHub.application(:default, "Windows Workstation")
JuliaHub.application(:package, "RegisteredPackageApp")
JuliaHub.application(:package, "CustomDashboardApp")
JuliaHub.application(:user, "ExampleApp.jl")
julia> JuliaHub.applications(:default)
4-element Vector{JuliaHub.DefaultApp}:
JuliaHub.application(:default, "Linux Desktop")
JuliaHub.application(:default, "Julia IDE")
JuliaHub.application(:default, "Pluto")
JuliaHub.application(:default, "Windows Workstation")
julia> JuliaHub.applications(:package)
2-element Vector{JuliaHub.PackageApp}:
JuliaHub.application(:package, "RegisteredPackageApp")
JuliaHub.application(:package, "CustomDashboardApp")
julia> JuliaHub.applications(:user)
1-element Vector{JuliaHub.UserApp}:
JuliaHub.application(:user, "ExampleApp.jl")
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.application
— FunctionJuliaHub.application(
category::Symbol, name::AbstractString;
throw::Bool=true, [auth::Authentication]
) -> AbstractJuliaHubApp
Returns the application corresponding to name
from the specified category of applications. Will throw an InvalidRequestError
if the application can't be found, or returns nothing
in this situation if throw=false
is passed.
category
specifies the application category and must be one of: :default
, :package
, or :user
. This is necessary to disambiguate apps with the same name in the different categories.
See also: applications
.
Examples
julia> JuliaHub.applications()
7-element Vector{JuliaHub.AbstractJuliaHubApp}:
JuliaHub.application(:default, "Linux Desktop")
JuliaHub.application(:default, "Julia IDE")
JuliaHub.application(:default, "Pluto")
JuliaHub.application(:default, "Windows Workstation")
JuliaHub.application(:package, "RegisteredPackageApp")
JuliaHub.application(:package, "CustomDashboardApp")
JuliaHub.application(:user, "ExampleApp.jl")
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.DefaultApp
— Typestruct DefaultApp <: AbstractJuliaHubApp
Represents a default JuliaHub instance application, and they can be started as jobs with submit_job
.
The list of available applications can be accessed via the applications
function, and specific applications can be picked out with application
.
julia> apps = JuliaHub.applications(:default)
4-element Vector{JuliaHub.DefaultApp}:
JuliaHub.application(:default, "Linux Desktop")
JuliaHub.application(:default, "Julia IDE")
JuliaHub.application(:default, "Pluto")
JuliaHub.application(:default, "Windows Workstation")
julia> JuliaHub.application(:default, "Pluto")
DefaultApp
name: Pluto
key: pluto
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.PackageApp
— Typestruct PackageApp <: AbstractJuliaHubApp
Represents a JuliaHub package application that is available in one of the instance's package registries. These packages can be started as JuliaHub jobs with submit_job
.
The list of available applications can be accessed via the applications
function, and specific applications can be picked out with application
.
julia> apps = JuliaHub.applications(:package)
2-element Vector{JuliaHub.PackageApp}:
JuliaHub.application(:package, "RegisteredPackageApp")
JuliaHub.application(:package, "CustomDashboardApp")
julia> JuliaHub.application(:package, "RegisteredPackageApp")
PackageApp
name: RegisteredPackageApp
uuid: db8b4d46-bfad-4aa5-a5f8-40df1e9542e5
registry: General (23338594-aafe-5451-b93e-139f81909106)
See also: help.juliahub.com
on applications
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.UserApp
— Typestruct UserApp <: AbstractJuliaHubApp
Represents a private application that has been added to the user account via a Git repository. These applications can be started as JuliaHub jobs with submit_job
.
The list of available applications can be accessed via the applications
function, and specific applications can be picked out with application
.
julia> apps = JuliaHub.applications(:user)
1-element Vector{JuliaHub.UserApp}:
JuliaHub.application(:user, "ExampleApp.jl")
julia> JuliaHub.application(:user, "ExampleApp.jl")
UserApp
name: ExampleApp.jl
repository: https://github.com/JuliaHubExampleOrg/ExampleApp.jl
See also: help.juliahub.com
on applications
Applications-related APIs are experimental, and may be changed or removed without notice.
JuliaHub.ApplicationJob
— Typestruct ApplicationJob <: AbstractJobConfig
AbstractJobConfig
that wraps a DefaultApp
. This is primarily used internally and should rarely be constructed explicitly.
JuliaHub.PackageJob
— Typestruct PackageJob <: AbstractJobConfig
AbstractJobConfig
that wraps a PackageApp
or UserApp
. This is primarily used internally and should rarely be constructed explicitly.
Constructors
JuliaHub.PackageJob(app::Union{JuliaHub.PackageApp,JuliaHub.UserApp}; [sysimage::Bool = false])
Can be used to construct a PackageApp
or UserApp
based job, but allows for some job parameters to be overridden. Currently, only support the enabling of a system image based job by setting sysimage = true
.
julia> app = JuliaHub.application(:package, "RegisteredPackageApp")
PackageApp
name: RegisteredPackageApp
uuid: db8b4d46-bfad-4aa5-a5f8-40df1e9542e5
registry: General (23338594-aafe-5451-b93e-139f81909106)
julia> JuliaHub.submit_job(JuliaHub.PackageJob(app; sysimage = true))
JuliaHub.Job: jr-xf4tslavut (Submitted)
submitted: 2023-03-15T07:56:50.974+00:00
started: 2023-03-15T07:56:51.251+00:00
finished: 2023-03-15T07:56:59.000+00:00
Index
JuliaHub.AbstractJobConfig
JuliaHub.AbstractJuliaHubApp
JuliaHub.ApplicationJob
JuliaHub.BatchImage
JuliaHub.BatchJob
JuliaHub.ComputeConfig
JuliaHub.DefaultApp
JuliaHub.Limit
JuliaHub.NodeSpec
JuliaHub.PackageApp
JuliaHub.PackageJob
JuliaHub.Unlimited
JuliaHub.UserApp
JuliaHub.WorkloadConfig
JuliaHub.appbundle
JuliaHub.application
JuliaHub.applications
JuliaHub.batchimage
JuliaHub.batchimages
JuliaHub.nodespec
JuliaHub.nodespecs
JuliaHub.script
JuliaHub.submit_job
JuliaHub.@script_str