default JobExecutor getJobExecutor() { return DaemonTaskHandler.getJobExecutor(); }
default JobExecutor getJobExecutor() { return DaemonTaskHandler.getJobExecutor(); }
void cleanupResources() { log.info(this + " killing all jobs created by this task " + String.join(", ", runningJobs)); DaemonTaskHandler.getJobExecutor().cancelJobs(new ArrayList<>(runningJobs)); for (DaemonTask child : children) { if (child != null) { log.info(this + " interrupting child " + child); if (timedOut) { child.timeout(); } else { child.interrupt(); } } } }
static private void closeSshTunnel(Proxy proxy) { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); jobExecutor.cancelJob(proxy.getJobId()); }
static private void closeSshTunnel(Proxy proxy) { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); jobExecutor.cancelJob(proxy.getJobId()); }
ByteArrayOutputStream stderr = new ByteArrayOutputStream(); String jobId = DaemonTaskHandler.getJobExecutor().startJob(request, System.getenv(), new ByteArrayInputStream(manifest.getBytes()), status = DaemonTaskHandler.getJobExecutor().backoffWait(jobId); } catch (InterruptedException e) { throw new DaemonTaskInterrupted(e);
public void ensureKubectlExists(ConfigProblemSetBuilder p) { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); JobRequest request = new JobRequest() .setTokenizedCommand(Collections.singletonList("kubectl")) .setTimeoutMillis(TimeUnit.SECONDS.toMillis(10)); JobStatus status; try { status = jobExecutor.backoffWait(jobExecutor.startJob(request)); } catch (InterruptedException e) { throw new DaemonTaskInterrupted(e); } if (status.getResult() != JobStatus.Result.SUCCESS) { p.addProblem(FATAL, String.join(" ", "`kubectl` not installed, or can't be found by Halyard. It is needed for", "opening connections to your Kubernetes cluster to send commands to the Spinnaker deployment running there.")) .setRemediation(String.join(" ", "Visit https://kubernetes.io/docs/tasks/kubectl/install/.", "If you've already installed kubectl via gcloud, it's possible updates to your $PATH aren't visible to Halyard. ", "You might have to restart Halyard for it to pick up the new $PATH.")); } } }
static private Proxy openSshTunnel(String ip, int port, String keyFile) throws InterruptedException { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); List<String> command = new ArrayList<>();
public void ensureKubectlExists(ConfigProblemSetBuilder p) { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); JobRequest request = new JobRequest() .setTokenizedCommand(Collections.singletonList("kubectl")) .setTimeoutMillis(TimeUnit.SECONDS.toMillis(10)); JobStatus status; try { status = jobExecutor.backoffWait(jobExecutor.startJob(request)); } catch (InterruptedException e) { throw new DaemonTaskInterrupted(e); } if (status.getResult() != JobStatus.Result.SUCCESS) { p.addProblem(FATAL, String.join(" ", "`kubectl` not installed, or can't be found by Halyard. It is needed for", "opening connections to your Kubernetes cluster to send commands to the Spinnaker deployment running there.")) .setRemediation(String.join(" ", "Visit https://kubernetes.io/docs/tasks/kubectl/install/.", "If you've already installed kubectl via gcloud, it's possible updates to your $PATH aren't visible to Halyard. ", "You might have to restart Halyard for it to pick up the new $PATH.")); } } }
static private Proxy openSshTunnel(String ip, int port, String keyFile) throws InterruptedException { JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor(); List<String> command = new ArrayList<>();
String jobId = DaemonTaskHandler.getJobExecutor().startJob(request); status = DaemonTaskHandler.getJobExecutor().backoffWait(jobId); } catch (InterruptedException e) { throw new DaemonTaskInterrupted(e);
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); KubernetesV1ProviderUtils.kubectlDeleteNamespaceCommand(DaemonTaskHandler.getJobExecutor(), details, kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); } }
static public void deleteSpinnaker(KubernetesAccount account, String namespace) { List<String> command = kubectlPrefix(account); if (StringUtils.isNotEmpty(namespace)) { command.add("-n=" + namespace); } command.add("delete"); command.add("deploy,svc,secret"); command.add("-l=app=spin"); JobRequest request = new JobRequest().setTokenizedCommand(command); String jobId = DaemonTaskHandler.getJobExecutor().startJob(request); JobStatus status; try { status = DaemonTaskHandler.getJobExecutor().backoffWait(jobId); } catch (InterruptedException e) { throw new DaemonTaskInterrupted(e); } if (status.getState() != JobStatus.State.COMPLETED) { throw new HalException(Problem.Severity.FATAL, String.join("\n", "Deleting spinnaker never completed in " + namespace, status.getStdErr(), status.getStdOut())); } if (status.getResult() != JobStatus.Result.SUCCESS) { throw new HalException(Problem.Severity.FATAL, String.join("\n", "Deleting spinnaker failed in " + namespace, status.getStdErr(), status.getStdOut())); } }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); KubernetesV1ProviderUtils.kubectlDeleteNamespaceCommand(DaemonTaskHandler.getJobExecutor(), details, kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); } }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { DaemonTaskHandler.newStage("Invoking kubectl"); DaemonTaskHandler.message("Deleting all 'svc,deploy,secret' resources with label 'app=spin'..."); KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); new KubernetesV2Executor(DaemonTaskHandler.getJobExecutor(), details.getAccount()).deleteSpinnaker(kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); }
JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor();
JobExecutor jobExecutor = DaemonTaskHandler.getJobExecutor();
KubernetesV2Executor executor = new KubernetesV2Executor(DaemonTaskHandler.getJobExecutor(), account);
DaemonTaskHandler.message("Reading container " + getServiceName() + "'s logs"); KubernetesV1ProviderUtils.storeInstanceLogs( DaemonTaskHandler.getJobExecutor(), details, settings.getLocation(), DaemonTaskHandler.message("Reading container " + sidecarName + "'s logs"); KubernetesV1ProviderUtils.storeInstanceLogs( DaemonTaskHandler.getJobExecutor(), details, settings.getLocation(),
DaemonTaskHandler.message("Reading container " + getServiceName() + "'s logs"); KubernetesV1ProviderUtils.storeInstanceLogs( DaemonTaskHandler.getJobExecutor(), details, settings.getLocation(), DaemonTaskHandler.message("Reading container " + sidecarName + "'s logs"); KubernetesV1ProviderUtils.storeInstanceLogs( DaemonTaskHandler.getJobExecutor(), details, settings.getLocation(),