public class K8sUploader extends java.lang.Object implements IUploader
If there are uploader web server pods in the cluster, upload the job package to all those pods. Uploader completes after the uploading is finished. Uploader web server pods must have the label "app=twister2-uploader" This label can be set from the config with the parameter: "twister2.kubernetes.uploader.web.server.label"
If there are no uploader web servers, The job package is uploaded to each pod in the job directly. DirectUploader watches the job pods for both workers and the job master when a pod becomes Running, a thread transfers the job package to that pod. This class runs in the submitting client. It needs to run continually in the client until the job ends, to upload the job package in case of scaling up or pod failures.
Constructor and Description |
---|
K8sUploader() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This is to for disposing or cleaning up any internal state accumulated by the uploader
|
boolean |
complete()
if uploader is threaded,
this method will wait for the threaded uploading to finish
|
void |
initialize(Config cnfg,
java.lang.String jbID)
Initialize the uploader with the incoming context.
|
boolean |
undo()
Undo uploading.
|
java.net.URI |
uploadPackage(java.lang.String sourceLocation)
UploadPackage will upload the job package to the given location.
|
public void initialize(Config cnfg, java.lang.String jbID)
IUploader
initialize
in interface IUploader
public java.net.URI uploadPackage(java.lang.String sourceLocation) throws UploaderException
IUploader
uploadPackage
in interface IUploader
sourceLocation
- the source location with all the filesnull
if failed.UploaderException
public boolean complete()
IUploader
public boolean undo()
IUploader