-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New MAAS (Metal as a Service) infrastructure. #53
base: master
Are you sure you want to change the base?
Conversation
infrastructure.getCredentials().getPassword(), | ||
infrastructure.isAllowSelfSignedSSLCertificate()); | ||
} catch (RemoteConnectFailureException e) { | ||
throw new RuntimeException("ERROR trying to create MaasClient with infrastructure : " + infrastructure, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private Function<Infrastructure, MaasClient> buildMaasClient = memoise(infrastructure -> maasClientBuilder.buildMaasClientFromInfrastructure(infrastructure)); | ||
|
||
private Function<Infrastructure, MaasClient> memoise(Function<Infrastructure, MaasClient> fn) { | ||
return (a) -> maasClientCache.computeIfAbsent(a, fn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maasClientCache.remove(infrastructure); | ||
} | ||
|
||
private Function<Infrastructure, MaasClient> buildMaasClient = memoise(infrastructure -> maasClientBuilder.buildMaasClientFromInfrastructure(infrastructure)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Override | ||
public void deleteInstance(Infrastructure infrastructure, String instanceId) { | ||
if (!maasProviderClientCache.getMaasClient(infrastructure).releaseMachineById(instanceId)) { | ||
throw new RuntimeException("ERROR when deleting MAAS instance : " + instanceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Component | ||
public class MaasProvider implements CloudProvider { | ||
|
||
private final Logger logger = Logger.getLogger(MaasProvider.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set<Instance> instances = futureMachines.stream().map(futureMachine -> { | ||
try { | ||
return futureMachine.get(); | ||
} catch (InterruptedException | ExecutionException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final Logger logger = Logger.getLogger(MaasProvider.class); | ||
|
||
@Getter | ||
private final String type = "maas"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
@Override | ||
public Set<Image> getAllImages(Infrastructure infrastructure) { | ||
throw new NotSupportedException("Operation not supported for MAAS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retest this please |
1 similar comment
retest this please |
Implementation of the new MAAS (Metal as a Service) cloud infrastructure.
The new infrastructure essentially rely on the Java REST Client developped by ActiveEon: https://github.com/ow2-proactive/maas-rest-client.
Note: It is assumed that the machines to deploy are already registered to the MAAS region/rack controllers. Usually a first boot is enough to register new machines when controllers are configured with auto-discovery feature. New machines may need to be configured manually if the power parameters can not be retrieved automatically (eg. IPMI configuration). Once the machines are recognized by MAAS (systemId generated) they can be allocated, deployed, and released by the connector-iaas.
For now, the deployment can be done in two different ways:
Supported feature:
Limitations:
Improvements: