PelicanPlatform / pelican

The Pelican Platform for creating data federations
https://pelicanplatform.org/
Apache License 2.0
13 stars 27 forks source link

Include longitude and latitude in advertising origin/cache #464

Closed haoming29 closed 12 months ago

haoming29 commented 12 months ago

In #458, we found that Long/Lat fields of serverAds are empty for Pelican Origins.

For now, we don't include longitude and latitude when advertise to the director and hence there's no way to do a geolocation sort when we pick a cache (or origin if we have same namespace on different origins). We might want to get this info either from a config value or using IP address look up, or GPS if you want to go fancy.

jhiemstrawisc commented 12 months ago

Can you look into this again? I think RecordAd, the function we use to populate the ttlcache with server ads, calls an "UpdateLatLong" function as its first step. Because our population of lat/long values relies on a proprietary database (maxmind), we centralize that in the director so we only need to keep track of one API key per director instance instead of relying on each external server to provide information. Geo-location of caches does currently work.

haoming29 commented 12 months ago

Interesting. I tried yesterday with my local director and origin but my origin only shows up in director with 0 for both longitude and latitude. I will take a closer look today and see what’s going on. Thanks for pointing out!


From: Justin Hiemstra @.> Sent: Thursday, December 7, 2023 8:22:54 AM To: PelicanPlatform/pelican @.> Cc: HAOMING MENG @.>; Author @.> Subject: Re: [PelicanPlatform/pelican] Include longitude and latitude in advertising origin/cache (Issue #464)

Can you look into this again? I think RecordAd, the function we use to populate the ttlcache with server ads, calls an "UpdateLatLong" function as its first step. Because our population of lat/long values relies on a proprietary database (maxmind), we centralize that in the director so we only need to keep track of one API key per director instance instead of relying on each external server to provide information. Geo-location of caches does currently work.

— Reply to this email directly, view it on GitHubhttps://github.com/PelicanPlatform/pelican/issues/464#issuecomment-1845430640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJ3Z4KDKJTL5PHMZJPY66VLYIHGL5AVCNFSM6AAAAABAJ2O5IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGQZTANRUGA. You are receiving this because you authored the thread.Message ID: @.***>

jhiemstrawisc commented 12 months ago

Ah, that's likely because UpdateLatLong does hostname resolution for determining a GeoIP location. Unless the hostname you're using to register an origin or a cache has an actual A Record in DNS, or you've convinced the folks at MaxMind to add the hostname to their database, we default to the null lat/long. One of the 7.4 items I'm working on in the background is providing an override mechanism so that the Director can direct specific namespaces to specific caches.

haoming29 commented 12 months ago

Close this issue as this is the expected behavior for a container hostname. Other related issues can be a separate ticket.