All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.elastisys.scale.cloudpool.aws.spot.server.Main Maven / Gradle / Ivy

Go to download

A cloud pool capable of managing a pool of AWS spot instances. This build module produces an all-in-one "server and application" executable jar file. When executed, it starts an embedded web server that publishes the cloud pool REST API endpoint.

There is a newer version: 5.2.3
Show newest version
package com.elastisys.scale.cloudpool.aws.spot.server;

import com.elastisys.scale.cloudpool.api.CloudPool;
import com.elastisys.scale.cloudpool.api.server.CloudPoolOptions;
import com.elastisys.scale.cloudpool.api.server.CloudPoolServer;
import com.elastisys.scale.cloudpool.aws.commons.poolclient.impl.AwsSpotClient;
import com.elastisys.scale.cloudpool.aws.spot.driver.SpotPoolDriver;
import com.elastisys.scale.cloudpool.commons.basepool.BaseCloudPool;
import com.elastisys.scale.cloudpool.commons.basepool.StateStorage;
import com.elastisys.scale.cloudpool.commons.basepool.driver.CloudPoolDriver;
import com.google.common.eventbus.EventBus;

/**
 * Main class for starting the REST API server for the AWS Spot Instance
 * {@link CloudPool}.
 */
public class Main {

	public static void main(String[] args) throws Exception {
		CloudPoolOptions options = CloudPoolServer.parseArgs(args);
		StateStorage stateStorage = StateStorage.builder(options.storageDir)
				.build();
		// event bus on which to send alerts are to be distributed to registered
		// email/webhook recipients
		EventBus eventBus = new EventBus();
		CloudPoolDriver driver = new SpotPoolDriver(new AwsSpotClient(),
				eventBus);
		CloudPoolServer.main(new BaseCloudPool(stateStorage, driver, eventBus),
				args);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy