A client library to invoke with JuliaRun HTTP APIs.
All JuliaRun APIs require a context to operate. A JuliaRun client context consists of:
It can be created simply as:
ctx = Context()
Default values of all parameters are set to match those inside a JuliaRun cluster.
Pass appropriate values for each when calling from outside the cluster.
Apart from the context, some APIs also need a job to work with. A job in JuliaRunClient is an instance of one of the Job types created by passing the job name. The other required and optional parameters of a job type are needed only need to be passed to the job creation API.
getSystemStatus(ctx)
Verifies if JuliaRun is running and is connected to a compute cluster. Returns:
listJobs(ctx)
List all submitted jobs.
Returns:
{"jobname": { "type": "JuliaBatch" }...}
getAllJobInfo(ctx)
List all submitted jobs.
Returns:
{"jobname": { "type": "JuliaBatch", "status": [], "scale": [], "endpoint": [] }...}
self()
Returns the current Job.
getJobStatus(ctx, job)
Fetch current status of a Job.
Parameters:
Returns tuple/array with:
getJobScale(ctx, job)
Get the current scale of a job.
Parameters:
Returns tuple/array with:
initParallel()
Initialize the current job to accept parallel workers.
Returns a reference to the Julia cluster manager instance.
setJobScale(ctx, job, parallelism)
Request to scale the job up or down to the level of parallelism requested.
Parameters:
Returns:
waitForWorkers(min_workers)
Wait for a certain number of workers to join.
getJobEndpoint(ctx, job)
Get the endpoint exposed by the job/service.
Parameters:
Returns tuple/array of endpoints as URLs or IP and ports
deleteJob(ctx, job; force=false)
Removes the job entry from the queue.
Parameters:
Returns:
tailJob(ctx, job; stream, count)
Tail logs from the job.
Parameters:
Returns a string of log entries separated by new line.
submitJob(ctx, job; kwargs...)
Submit a job definition to execute on the cluster.
Parameters:
Returns nothing.
07/11/2017
2 months ago
37 commits