Skip to content

Commit

Permalink
Integration of the Federation Registry service into Orchestrator (#25)
Browse files Browse the repository at this point in the history
* Added some dto classes (Quota, BlockStorageQuota, ComputeQuota, NetworkQuota, Project, Provider, Service, Sla, UserGroup) for the fedreg

* Added small fixes on files prevously added

* Fix date type

* Added Flavor, Image, Network, Region dto classes and adjusted Project, Service, Sla to support the objects returned from project API

* Add AuthMethod dto e fix related dtos to include it

* First attempt to use fedreg apis to populate classes

* Remove skip certificate verification and change fed-reg url

* First working version of remap function for slamPreferences with only preferences

* add usage attribute in Quota class and use it in remapAttributes function

* Completed the part of creation of a list of services in slamPreferences

* Completed sla element and so also slamPreferences

* Start working for CMDB replacement

* Implemented remap for cloudProvider and ComputeService

* Fixes for CMDB remap function

* Clean Slam and CMDB and update the filter

* Adapted the code to introduce the Identity Service

* Cleaned SlamServiceV2 and the remapAttributesForPreferences function

* Set identityServices as a list os Services

* Cleaned SlamServiceV2 and added comments

* cleaned CmdbServiceV2Impl class and improved code integrating jacoco suggestions

* change error printing into LOG.error

* remove comment about casting in remapAttributesForSla

* fix IAM clients and S3 buckets creation when deployment fails in a provider

* Fix log messages when find an IAM client and S3 bucket node and when skipping their creation

* set CloudProvider Name correctly in deployment info stored in database

* add region info of the cloudProvider to be returned in deployment info

* adapted orchestrator to accept cloudServices of oject-store type from fedreg
  • Loading branch information
lgiommi authored Jan 9, 2025
1 parent 34241a0 commit bb98e7d
Show file tree
Hide file tree
Showing 43 changed files with 1,708 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignite/
.DS_Store
*.pydevproject
.metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,19 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.validation.constraints.NotNull;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import org.checkerframework.checker.nullness.qual.NonNull;

@Data
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class CloudProvider implements CmdbIdentifiable {

@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,18 @@
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotNull;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

@Data
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
property = "service_type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public enum CloudServiceType {

@JsonProperty("compute") COMPUTE,
@JsonProperty("storage") STORAGE,
@JsonProperty("block-storage") BLOCK_STORAGE,
@JsonProperty("object-store") OBJECT_STORE,
@JsonProperty("network") NETWORK,
@JsonEnumDefaultValue @JsonProperty("unknown") UNKNOWN;

}
5 changes: 1 addition & 4 deletions src/main/java/it/reply/orchestrator/dto/cmdb/Flavor.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,19 @@
package it.reply.orchestrator.dto.cmdb;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Comparator;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;

@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class Flavor implements CmdbIdentifiable, Comparable<Flavor> {

private static final Comparator<Flavor> COMPARATOR = Comparator
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/it/reply/orchestrator/dto/cmdb/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@
package it.reply.orchestrator.dto.cmdb;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.checkerframework.checker.nullness.qual.Nullable;

@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class Image implements CmdbIdentifiable {

@JsonProperty("id")
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/it/reply/orchestrator/dto/fedreg/AuthMethod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package it.reply.orchestrator.dto.fedreg;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class AuthMethod {

@JsonProperty("idp_name")
@NotNull
private String idpName;

@JsonProperty("protocol")
@NotNull
private String protocol;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package it.reply.orchestrator.dto.fedreg;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class BlockStorageQuota extends Quota {

@JsonProperty("gigabytes")
private Integer gigabytes;

@JsonProperty("per_volume_gigabytes")
private Integer perVolumeGigabytes;

@JsonProperty("volumes")
private Integer volumes;

}
42 changes: 42 additions & 0 deletions src/main/java/it/reply/orchestrator/dto/fedreg/ComputeQuota.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package it.reply.orchestrator.dto.fedreg;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class ComputeQuota extends Quota {

@JsonProperty("cores")
private Integer cores;

@JsonProperty("instances")
private Integer instances;

@JsonProperty("ram")
private Integer ram;

}
82 changes: 82 additions & 0 deletions src/main/java/it/reply/orchestrator/dto/fedreg/Flavor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package it.reply.orchestrator.dto.fedreg;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class Flavor {

@JsonProperty("description")
private String description;

@JsonProperty("name")
@NotNull
private String name;

@JsonProperty("uuid")
@NotNull
private String uuid;

@JsonProperty("disk")
private Integer disk;

@JsonProperty("is_public")
private Boolean isPublic;

@JsonProperty("ram")
private Integer ram;

@JsonProperty("vcpus")
private Integer vcpus;

@JsonProperty("swap")
private Integer swap;

@JsonProperty("ephemeral")
private Integer ephemeral;

@JsonProperty("infiniband")
private Boolean infiniband;

@JsonProperty("gpus")
private Integer gpus;

@JsonProperty("gpu_model")
private String gpuModel;

@JsonProperty("gpu_vendor")
private String gpuVendor;

@JsonProperty("local_storage")
private String localStorage;

@JsonProperty("uid")
@NotNull
private String uid;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package it.reply.orchestrator.dto.fedreg;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class IdentityProvider {

@JsonProperty("description")
private String description;

@JsonProperty("endpoint")
@NotNull
private String endpoint;

@JsonProperty("group_claim")
@NotNull
private String groupClaim;

@JsonProperty("uid")
@NotNull
private String uid;

@JsonProperty("providers")
@Builder.Default
private List<Provider> providers = new ArrayList<>();
}
Loading

0 comments on commit bb98e7d

Please sign in to comment.