Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@kevin-zhonghao
Copy link
Contributor

@kevin-zhonghao kevin-zhonghao commented Jun 17, 2020

This PR proposes the following changes:

  • Optimized route manager service and added route with subnet/vpc related database tables
  • Modified issue in port manager
  • Successfully tested e2e integration

Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin-zhonghao Left a few comments. Please take a look.

- key: application.properties
path: application.properties
containers:
- image: zhonghaolyu/repo:sgKube1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to add one more step of pushing container image to the "official" container registry in the CI workflow (for every PR merge) so that this yaml file could pull the latest "official" image.

Create an issue ##270 for tracking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure ~ when CI is finished, I'll change it

- image: zhonghaolyu/repo:sgKube1
#- image: fwnetworking/controller:node_manager-v0.3.0
name: sgmanager-web
imagePullPolicy: IfNotPresent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big is the image? We could want to change the policy to alwaysPull.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About several hundreds MB

labels:
name: sgmanager-service
spec:
type: NodePort
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusterIP or NodePort? Let us discuss.

method = GET,
value = {"/vpcs/{vpcId}/routes/{routeId}"})
public RouteWebJson getRuleByVpcId(@PathVariable String vpcId, @PathVariable String routeId) throws Exception {
value = {"routes/vpcs/{vpcId}/get"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin-zhonghao We may need to change the API doc if any.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we didn't have route API doc right now, I will add it after


@Override
public void addMapperByRouteEntity(String subnetId, RouteEntity routeEntity) throws DatabasePersistenceException {
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Route Manager ServiceImpl and repo classes, I don't find usage of a transaction.

Please find the reference implementation:

public void createPortAndNeighbor(PortEntity portEntity, NeighborInfo neighborInfo) throws Exception {

@kevin-zhonghao

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix it ~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a ticket for tracking #274

@xieus xieus changed the title [E2E Integration] Port CURD - Bug Fix and New Route Manager APIs [Alcor Integration] Port CURD - Bug Fix and New Route Manager APIs Jul 2, 2020
kevin-zhonghao and others added 17 commits July 2, 2020 11:47
# Conflicts:
#	README.md
#	docs/modules/ROOT/pages/comm_protocol/fast_path.adoc
#	docs/modules/ROOT/pages/comm_protocol/rescue_path.adoc
#	docs/modules/ROOT/pages/controller.adoc
#	docs/modules/ROOT/pages/db_services/data_store.adoc
#	docs/modules/ROOT/pages/deploy_related/integration_nova.adoc
#	docs/modules/ROOT/pages/high_level/system_flow.adoc
#	docs/modules/ROOT/pages/mgmt_services/private_ip_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/security_group_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/virtual_mac_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/vpc_manager.adoc
#	docs/modules/ROOT/pages/sys_monitoring/monitoring.adoc
# Conflicts:
#	README.md
#	docs/modules/ROOT/pages/comm_protocol/fast_path.adoc
#	docs/modules/ROOT/pages/comm_protocol/rescue_path.adoc
#	docs/modules/ROOT/pages/controller.adoc
#	docs/modules/ROOT/pages/db_services/data_store.adoc
#	docs/modules/ROOT/pages/deploy_related/deployment.adoc
#	docs/modules/ROOT/pages/deploy_related/integration_nova.adoc
#	docs/modules/ROOT/pages/high_level/system_flow.adoc
#	docs/modules/ROOT/pages/mgmt_services/private_ip_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/security_group_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/virtual_mac_manager.adoc
#	docs/modules/ROOT/pages/mgmt_services/vpc_manager.adoc
#	docs/modules/ROOT/pages/sys_monitoring/monitoring.adoc
Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

if (!subnetUniqueIds.contains(subnetId)) {
Long tunnelId = subnetEntity.getTenantId() != null ? Long.valueOf(subnetEntity.getTenantId()) : null;
// FIXME :subnetEntity.getVpcId().hashCode() need to be changed to segmentId
Long tunnelId = getTunnelId(subnetEntity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new issue for tracking #275


public interface RouteWithSubnetMapperService {

public SubnetToRouteMapper getBySubnetId (String subnetId) throws ResourceNotFoundException, ResourcePersistenceException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments if possible.

@JsonProperty("route_ids")
private List<String> routeIds;

@CreatedDate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of moving these two to a common resource class.

RouteWebJson routeWebJson = restTemplate.getForObject(url, RouteWebJson.class);
if (routeWebJson == null) {
public RoutesWebJson getRouteBySubnetId(String subnetId) throws Exception {
String url = routeManagerUrl + "/subnets/" + subnetId + "/get";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Url usually doesn't come with /get

@xieus xieus changed the title [Alcor Integration] Port CURD - Bug Fix and New Route Manager APIs [Alcor Integration]Port CURD - Bug Fix and New Route Manager APIs Jul 3, 2020
@xieus xieus merged commit 297255f into futurewei-cloud:master Jul 3, 2020
@kevin-zhonghao kevin-zhonghao deleted the integration branch July 7, 2020 17:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New API] Route Manager to support GET routes by subnet Id

3 participants