use of bio.terra.cli.businessobject.Config in project terra-cli by DataBiosphere.
the class Image method execute.
/**
* Updates the docker image id property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
String prevImageId = config.getDockerImageId();
String newImageId = argGroup.useDefault ? Config.getDefaultImageId() : argGroup.imageId;
if (!new DockerClientWrapper().checkImageExists(newImageId)) {
ERR.printf("WARNING: Image %s was not found on the local machine. " + "Do `docker pull %s` to obtain it.%n", newImageId, newImageId);
}
config.setDockerImageId(newImageId);
if (config.getDockerImageId().equals(prevImageId)) {
OUT.println("Docker image: " + config.getDockerImageId() + " (UNCHANGED)");
} else {
OUT.println("Docker image: " + config.getDockerImageId() + " (CHANGED FROM " + prevImageId + ")");
}
}
use of bio.terra.cli.businessobject.Config in project terra-cli by DataBiosphere.
the class ResourceLimit method execute.
/**
* Updates the resources cache size property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
int prevMaxResources = config.getResourcesCacheSize();
int newMaxResources = argGroup.useDefault ? Config.DEFAULT_RESOURCES_CACHE_SIZE : argGroup.max;
if (newMaxResources <= 0) {
throw new UserActionableException("Maximum number of resources allowed per workspace must be positive.");
}
config.setResourcesCacheSize(newMaxResources);
if (config.getResourcesCacheSize() == prevMaxResources) {
OUT.println("Max number of resources per workspace: " + config.getResourcesCacheSize() + " (UNCHANGED)");
} else {
OUT.println("Max number of resources per workspace: " + config.getResourcesCacheSize() + " (CHANGED FROM " + prevMaxResources + ")");
}
}
use of bio.terra.cli.businessobject.Config in project terra-cli by DataBiosphere.
the class AppLaunch method execute.
/**
* Updates the command runner option property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
Config.CommandRunnerOption prevAppLaunchOption = config.getCommandRunnerOption();
if (CommandRunnerOption.DOCKER_CONTAINER == mode) {
String imageId = Context.getConfig().getDockerImageId();
if (!new DockerClientWrapper().checkImageExists(imageId)) {
ERR.printf("WARNING: Image %s was not found on the local machine. " + "Do `docker pull %s` to obtain it.%n", imageId, imageId);
}
}
config.setCommandRunnerOption(mode);
OUT.println("App launch mode is " + config.getCommandRunnerOption() + " (" + (config.getCommandRunnerOption() == prevAppLaunchOption ? "UNCHANGED" : "CHANGED") + ").");
}
use of bio.terra.cli.businessobject.Config in project terra-cli by DataBiosphere.
the class Browser method execute.
/**
* Updates the browser launch option property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
Config.BrowserLaunchOption prevBrowserLaunchOption = config.getBrowserLaunchOption();
config.setBrowserLaunchOption(mode);
OUT.println("Browser launch mode for login is " + config.getBrowserLaunchOption() + " (" + (config.getBrowserLaunchOption() == prevBrowserLaunchOption ? "UNCHANGED" : "CHANGED") + ").");
}
use of bio.terra.cli.businessobject.Config in project terra-cli by DataBiosphere.
the class Format method execute.
@Override
protected void execute() {
Config config = Context.getConfig();
FormatOptions previousFormatOption = config.getFormat();
config.setFormat(format);
OUT.println("Output format is " + config.getFormat() + " (" + (config.getFormat() == previousFormatOption ? "UNCHANGED" : "CHANGED") + ").");
}
Aggregations