Git Product home page Git Product logo

aws-last-mile-delivery-hyperlocal's Introduction

AWS Last Mile Delivery Hyperlocal - Last Mile Logistics Accelerator

⚠️ Disclaimer ⚠️
This codebase is currently work in progress and requires improvements in a few areas before using it. The remaining issues are being tracked in this project and actively being developed.
This disclaimer will be removed once all non-priority:low issues are being resolved.

⭐ Introduction

Hyperlocal businesses that involve Grocery, Food Delivery, Instant Courier, etc, are likely to reach 3.4 Trillion USD by 2027. Hundreds of such businesses are being launched all across the world. This accelerator project will help these companies to avoid the undifferentiated heavy lifting by providing them a re-usable solution for tracking their (tens of thousands of) drivers and instantly make pick-up and routing decisions. The system provides granular real time tracking, complex search, as well as assignment of drivers to orders using optimisation techniques.

Getting started

Architecture

High-level Architecture

High-level Architecture

Solution Architecture

Solution Architecture

Folder Structure

.
├── _templates (generators for packages and components)
├── config (workspace configuration files)
├── docs (detailed documentation)
├── packages (common packages used in prototype infra and apps)
└── prototype (main infra, app code and scripts)
    ├── dispatch
    ├── infra
    ├── scripts
    └── simulator

Requirements - Tooling


Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-last-mile-delivery-hyperlocal's People

Contributors

amazon-auto avatar dependabot[bot] avatar mirgj avatar rodrigokestler avatar sperka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-last-mile-delivery-hyperlocal's Issues

Address cfn-nag warnings

  • Address all cfn-nag warnings and add relative comment where the item cannot be addressed
  • add cdk-nag to the solution

replace simulator origin/destination generator mechanism

Currently we create origin/destination records for the simulator with randomly generated coordinates that lead to routing errors in the dispatcher.

Instead, let's generate these records with real (routable) locations. We still keep the area definitions and radius, but the number will act as a max number.

https://overpass-turbo.eu/ - this open API helps to extract POIs from openstreetmap data, so we can easily run queries like the following and get enough locations back:

[out:json][timeout:25];
(
  node["amenity"~"cafe|restaurant"](around:5000.0,-6.1813448922772185,106.8372344970703);
);
out body;
>;
out skel qt;

Obviously around and lat/long coordinate values will be passed as parameters.

The key amenity seems to be quite extensively filled out (building tag is not e.g.: in Jakarta).

Query language guide here if needed to extend the above query.


GPU support to build h3DistanceCache at resolution 10 or build distanceMatrix for lat/longs

  • research the possibility to run traveldistance calculations parallel on GPU cores

A) Current H3 distance cache can be built for a pre-defined polygon (MM) at resolution 9 (174m/hexagon edge -- ~5600x5600 matrix) in around 4.5 hours on a c6g.metal graviton instance. The goal is to be able to build a resolution 10 (65m/hexagon edge) distance matrix (40k x 40k) in reasonable time.
Also, the current 5600x5600 matrix is ~600MB that is easy to load to memory, but a 40k x 40k matrix size would be around ~30gb --> should be separated to a distancematrix service with fast lookup.

B) direct distanceMatrix build for incoming lat/lng values on GPU with the ability to build ~1000x1000 matrices

Document deployment configuration parameters

  • most config parameters are in prototype/infra/config/local-XXXXX.json (gitignored) and only can be extracted from code
  • prototype/infra/config/test.json doesn't have all the parameters as an example

Split `parameterStoreKeys` in infra config by main components

Similarly to #142 split the config for parameterStoreKeys. Also make the values structured

parameterStoreKeys:
  locationService:
    geoTrackingApiUrl: /Hyperlocal/LocationService/Api/GeoTracking/Url
                                                             ^^
  instantDelivery:
    xxx: yyy

  sameDayDirectPudo:
    ...
    hubsTableName: /HyperLocal/SameDayDirectPudo/Ddb/Hubs/TableName
    ...
  • Also update application.properties files in apps for delivery-dispatch.
  • Update parameterStoreKeys type in infra project

GraphhopperManager lambda config mismatch

packages/@prototype/simulator/src/SimulatorManagerStack/GraphhopperManager/@lambda/src/index.js
runTask uses config.securityGroups, while config exposes securityGroup

also, in CDKv2 we pass securityGroupId, to investigate if that's ok to use in the lambda

Update dispatcher config settings

Current dynamic config parameters are stored in application.config, some of them need to be moved to parameter store or secrets manager.

To move:

  • driver API url

To remove:

  • s3 bucket for maps

CDKv2 securityGroup property securityGroupName -> securityGroupId in lambdas

search string: SECURITY_GROUP: props.securityGroup.securityGroupId

after CDKv2 update, ec2.SecurityGroup doesn't have the property securityGroupName, but only securityGroupId is available. Make sure that the for lambdas that use this pattern will be properly functional (usually ECS runTask operations)

Refactor instant delivery provider to return new object structure

Refactor instant delivery provider to return orders as list of segments that can also have mixed pick-up/drop-off. The same structure will be used for same day delivery

{
  jobId: '',
  driverId: '', // only for instant delivery
  driverIdentity: '', // only for instant delivery
  route: {
    distance: {
      value: 1152,
      unit: 'm', // meter
    },
    time: {
      value: 1160,
      unit: 'sec' //seconds
    },
    pointsEncoded: 'cxl_cBqwvnS|Dy@ogFyxmAf`IsnA|CjFzCsHluD_k@hi@ljL', //as per path polyline
  },
  segments: [
    {
      orderId: '',
      index: 1,
      from: { lat: 1, long: 2 },
      to: { lat: 1, long: 2 },
      segmentType: 'TO_ORIGIN',
      route: {
        distance: {
          value: 1152,
          unit: 'm', // meter
        },
        time: {
          value: 1160,
          unit: 'sec' //seconds
        },
        pointsEncoded: 'cxl_cBqwvnS|Dy@ogFyxmAf`IsnA|CjFzCsHluD_k@hi@ljL', //as per path polyline
      },
    },
    {
      orderId: '',
      index: 2,
      from: { lat: 1, long: 2 },
      to: { lat: 1, long: 2 },
      segmentType: 'TO_DESTINATION',
      route: {
        distance: {
          value: 478,
          unit: 'm', // meter
        },
        time: {
          value: 68,
          unit: 'sec' //seconds
        },
        pointsEncoded: '_p~iF~ps|U_ulLnnqC_mqNvxq`@, //as per path polyline
      },
    },
  ],
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.