Skip to content

Commit bb98e7d

Browse files
authored
Integration of the Federation Registry service into Orchestrator (#25)
* 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
1 parent 34241a0 commit bb98e7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1708
-102
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ignite/
12
.DS_Store
23
*.pydevproject
34
.metadata

src/main/java/it/reply/orchestrator/dto/cmdb/CloudProvider.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@
1919

2020
import com.fasterxml.jackson.annotation.JsonIgnore;
2121
import com.fasterxml.jackson.annotation.JsonProperty;
22-
2322
import java.util.HashMap;
2423
import java.util.List;
2524
import java.util.Map;
2625
import java.util.stream.Collectors;
27-
2826
import javax.validation.constraints.NotNull;
29-
30-
import lombok.AccessLevel;
3127
import lombok.AllArgsConstructor;
3228
import lombok.Builder;
3329
import lombok.Data;
34-
3530
import org.checkerframework.checker.nullness.qual.NonNull;
3631

3732
@Data
3833
@Builder
39-
@AllArgsConstructor(access = AccessLevel.PROTECTED)
34+
@AllArgsConstructor
4035
public class CloudProvider implements CmdbIdentifiable {
4136

4237
@JsonProperty("id")

src/main/java/it/reply/orchestrator/dto/cmdb/CloudService.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,18 @@
2222
import com.fasterxml.jackson.annotation.JsonTypeInfo;
2323
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
2424
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;
25-
2625
import java.util.ArrayList;
2726
import java.util.List;
28-
2927
import javax.validation.constraints.NotNull;
30-
31-
import lombok.AccessLevel;
3228
import lombok.AllArgsConstructor;
3329
import lombok.Builder;
3430
import lombok.Data;
35-
3631
import org.checkerframework.checker.nullness.qual.NonNull;
3732
import org.checkerframework.checker.nullness.qual.Nullable;
3833

3934
@Data
4035
@Builder
41-
@AllArgsConstructor(access = AccessLevel.PROTECTED)
36+
@AllArgsConstructor
4237
@JsonTypeInfo(
4338
use = JsonTypeInfo.Id.NAME,
4439
property = "service_type",

src/main/java/it/reply/orchestrator/dto/cmdb/CloudServiceType.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public enum CloudServiceType {
2424

2525
@JsonProperty("compute") COMPUTE,
2626
@JsonProperty("storage") STORAGE,
27+
@JsonProperty("block-storage") BLOCK_STORAGE,
28+
@JsonProperty("object-store") OBJECT_STORE,
29+
@JsonProperty("network") NETWORK,
2730
@JsonEnumDefaultValue @JsonProperty("unknown") UNKNOWN;
2831

2932
}

src/main/java/it/reply/orchestrator/dto/cmdb/Flavor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,19 @@
1818
package it.reply.orchestrator.dto.cmdb;
1919

2020
import com.fasterxml.jackson.annotation.JsonProperty;
21-
2221
import java.util.Comparator;
23-
2422
import lombok.AccessLevel;
2523
import lombok.AllArgsConstructor;
2624
import lombok.Builder;
2725
import lombok.Data;
2826
import lombok.NoArgsConstructor;
29-
3027
import org.checkerframework.checker.nullness.qual.Nullable;
3128
import org.jetbrains.annotations.NotNull;
3229

3330
@Data
3431
@Builder
3532
@NoArgsConstructor(access = AccessLevel.PROTECTED)
36-
@AllArgsConstructor(access = AccessLevel.PROTECTED)
33+
@AllArgsConstructor
3734
public class Flavor implements CmdbIdentifiable, Comparable<Flavor> {
3835

3936
private static final Comparator<Flavor> COMPARATOR = Comparator

src/main/java/it/reply/orchestrator/dto/cmdb/Image.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
package it.reply.orchestrator.dto.cmdb;
1919

2020
import com.fasterxml.jackson.annotation.JsonProperty;
21-
2221
import lombok.AccessLevel;
2322
import lombok.AllArgsConstructor;
2423
import lombok.Builder;
2524
import lombok.Data;
2625
import lombok.NoArgsConstructor;
27-
2826
import org.checkerframework.checker.nullness.qual.Nullable;
2927

3028
@Data
3129
@Builder
3230
@NoArgsConstructor(access = AccessLevel.PROTECTED)
33-
@AllArgsConstructor(access = AccessLevel.PROTECTED)
31+
@AllArgsConstructor
3432
public class Image implements CmdbIdentifiable {
3533

3634
@JsonProperty("id")
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright © 2015-2021 I.N.F.N.
3+
* Copyright © 2015-2020 Santer Reply S.p.A.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package it.reply.orchestrator.dto.fedreg;
19+
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import javax.validation.constraints.NotNull;
22+
import lombok.AccessLevel;
23+
import lombok.AllArgsConstructor;
24+
import lombok.Builder;
25+
import lombok.Data;
26+
import lombok.NoArgsConstructor;
27+
28+
@Data
29+
@Builder
30+
@NoArgsConstructor(access = AccessLevel.PROTECTED)
31+
@AllArgsConstructor(access = AccessLevel.PROTECTED)
32+
public class AuthMethod {
33+
34+
@JsonProperty("idp_name")
35+
@NotNull
36+
private String idpName;
37+
38+
@JsonProperty("protocol")
39+
@NotNull
40+
private String protocol;
41+
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright © 2015-2021 I.N.F.N.
3+
* Copyright © 2015-2020 Santer Reply S.p.A.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package it.reply.orchestrator.dto.fedreg;
19+
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import lombok.AccessLevel;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
import lombok.NoArgsConstructor;
26+
27+
@Data
28+
@EqualsAndHashCode(callSuper = true)
29+
@NoArgsConstructor(access = AccessLevel.PROTECTED)
30+
@AllArgsConstructor(access = AccessLevel.PROTECTED)
31+
public class BlockStorageQuota extends Quota {
32+
33+
@JsonProperty("gigabytes")
34+
private Integer gigabytes;
35+
36+
@JsonProperty("per_volume_gigabytes")
37+
private Integer perVolumeGigabytes;
38+
39+
@JsonProperty("volumes")
40+
private Integer volumes;
41+
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright © 2015-2021 I.N.F.N.
3+
* Copyright © 2015-2020 Santer Reply S.p.A.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package it.reply.orchestrator.dto.fedreg;
19+
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import lombok.AccessLevel;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
import lombok.NoArgsConstructor;
26+
27+
@Data
28+
@EqualsAndHashCode(callSuper = true)
29+
@NoArgsConstructor(access = AccessLevel.PROTECTED)
30+
@AllArgsConstructor(access = AccessLevel.PROTECTED)
31+
public class ComputeQuota extends Quota {
32+
33+
@JsonProperty("cores")
34+
private Integer cores;
35+
36+
@JsonProperty("instances")
37+
private Integer instances;
38+
39+
@JsonProperty("ram")
40+
private Integer ram;
41+
42+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright © 2015-2021 I.N.F.N.
3+
* Copyright © 2015-2020 Santer Reply S.p.A.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package it.reply.orchestrator.dto.fedreg;
19+
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import javax.validation.constraints.NotNull;
22+
import lombok.AccessLevel;
23+
import lombok.AllArgsConstructor;
24+
import lombok.Builder;
25+
import lombok.Data;
26+
import lombok.NoArgsConstructor;
27+
28+
@Data
29+
@Builder
30+
@NoArgsConstructor(access = AccessLevel.PROTECTED)
31+
@AllArgsConstructor(access = AccessLevel.PROTECTED)
32+
public class Flavor {
33+
34+
@JsonProperty("description")
35+
private String description;
36+
37+
@JsonProperty("name")
38+
@NotNull
39+
private String name;
40+
41+
@JsonProperty("uuid")
42+
@NotNull
43+
private String uuid;
44+
45+
@JsonProperty("disk")
46+
private Integer disk;
47+
48+
@JsonProperty("is_public")
49+
private Boolean isPublic;
50+
51+
@JsonProperty("ram")
52+
private Integer ram;
53+
54+
@JsonProperty("vcpus")
55+
private Integer vcpus;
56+
57+
@JsonProperty("swap")
58+
private Integer swap;
59+
60+
@JsonProperty("ephemeral")
61+
private Integer ephemeral;
62+
63+
@JsonProperty("infiniband")
64+
private Boolean infiniband;
65+
66+
@JsonProperty("gpus")
67+
private Integer gpus;
68+
69+
@JsonProperty("gpu_model")
70+
private String gpuModel;
71+
72+
@JsonProperty("gpu_vendor")
73+
private String gpuVendor;
74+
75+
@JsonProperty("local_storage")
76+
private String localStorage;
77+
78+
@JsonProperty("uid")
79+
@NotNull
80+
private String uid;
81+
82+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright © 2015-2021 I.N.F.N.
3+
* Copyright © 2015-2020 Santer Reply S.p.A.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package it.reply.orchestrator.dto.fedreg;
19+
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import java.util.ArrayList;
22+
import java.util.List;
23+
import javax.validation.constraints.NotNull;
24+
import lombok.AccessLevel;
25+
import lombok.AllArgsConstructor;
26+
import lombok.Builder;
27+
import lombok.Data;
28+
import lombok.NoArgsConstructor;
29+
30+
@Data
31+
@Builder
32+
@NoArgsConstructor(access = AccessLevel.PROTECTED)
33+
@AllArgsConstructor(access = AccessLevel.PROTECTED)
34+
public class IdentityProvider {
35+
36+
@JsonProperty("description")
37+
private String description;
38+
39+
@JsonProperty("endpoint")
40+
@NotNull
41+
private String endpoint;
42+
43+
@JsonProperty("group_claim")
44+
@NotNull
45+
private String groupClaim;
46+
47+
@JsonProperty("uid")
48+
@NotNull
49+
private String uid;
50+
51+
@JsonProperty("providers")
52+
@Builder.Default
53+
private List<Provider> providers = new ArrayList<>();
54+
}

0 commit comments

Comments
 (0)