You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2014/09/03 14:26:50 UTC

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/142

    add maxmind v2 (now ASL licensed) in preference to Utrace

    update to https://github.com/apache/incubator-brooklyn/pull/140 re BROOKLYN-32

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/incubator-brooklyn maxmind2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/142.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #142
    
----
commit a64e2835bb676cb71e33604e1a1423e66fe385a4
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2014-09-02T20:03:27Z

    add maxmind v2 (now ASL licensed) in preference to Utrace, but with fallback to Utrace if maxmind not installed

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/142


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by richardcloudsoft <gi...@git.apache.org>.
Github user richardcloudsoft commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#issuecomment-54315552
  
    On the transitive dependencies question, I'm OK with relaxing this. The exercise I went through was useful to clarify our dependencies and weed out version collisions, but now it's served its purpose in making clear our dependencies. It's more effort to maintain it going forward than the ongoing benefit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#issuecomment-54308538
  
    LGTM - only minor comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#discussion_r17058509
  
    --- Diff: core/src/test/java/brooklyn/location/geo/HostGeoLookupIntegrationTest.java ---
    @@ -56,4 +58,20 @@ public void testUtraceLookup() throws Exception {
             Assert.assertEquals(geo.latitude, 51, 2);
             Assert.assertEquals(geo.longitude, 9, 5);
         }
    +
    +    @Test(groups = "Integration")
    +    public void testMaxmindLookup() throws Exception {
    +        HostGeoInfo geo = new MaxMind2HostGeoLookup().getHostGeoInfo(InetAddress.getByName("maxmind.com"));
    +        log.info("maxmind.com at "+geo);
    +        
    +        // used to be Washington; now lDalas - in case this is temporary failover will accept either!
    +        // Also saw variation in lat/lon reported, so happy to within one degree now.
    +//      Assert.assertEquals(geo.displayName, "Washington, DC (US)");
    +//      Assert.assertEquals(geo.latitude, 38.90, 0.1);
    +//      Assert.assertEquals(geo.longitude, -77.02, 0.1);
    --- End diff --
    
    this code is untouched from before maxmind was removed -- but i agree we can improve it by removing the comments


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#issuecomment-54307305
  
    @aledsage good point, @richardcloudsoft this is actually a reasonably argument *against* including when you are using a primary entry point to a dependency which exposes some of its dependents.
    
    i don't know whether the Jackson we use is in `jackson-databind` or in one of its dependencies e.g. `jackson-core`.  and i don't care -- `jackson-databind` encourages you to use things from its core.  it seems counter-productive for me to attempt to track and redeclare the version of `jackson-core`.
    
    i noticed this here because there is a version mismatch -- `jackson-databind 2.4.2` depends on `jackson-core 2.4.0`.  that's maybe a minor bug on their side but it meant that we were getting inconsistent versions of `jackson-core` since we explicitly declared `2.4.2` for all `jackson` libs but we were not excluding the dependency declared by `jackson-databind`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by richardcloudsoft <gi...@git.apache.org>.
Github user richardcloudsoft commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#discussion_r17056955
  
    --- Diff: core/src/test/java/brooklyn/location/geo/HostGeoLookupIntegrationTest.java ---
    @@ -56,4 +58,20 @@ public void testUtraceLookup() throws Exception {
             Assert.assertEquals(geo.latitude, 51, 2);
             Assert.assertEquals(geo.longitude, 9, 5);
         }
    +
    +    @Test(groups = "Integration")
    +    public void testMaxmindLookup() throws Exception {
    +        HostGeoInfo geo = new MaxMind2HostGeoLookup().getHostGeoInfo(InetAddress.getByName("maxmind.com"));
    +        log.info("maxmind.com at "+geo);
    +        
    +        // used to be Washington; now lDalas - in case this is temporary failover will accept either!
    +        // Also saw variation in lat/lon reported, so happy to within one degree now.
    +//      Assert.assertEquals(geo.displayName, "Washington, DC (US)");
    +//      Assert.assertEquals(geo.latitude, 38.90, 0.1);
    +//      Assert.assertEquals(geo.longitude, -77.02, 0.1);
    --- End diff --
    
    Please remove commented out code - this has been folded into the new block beneath it, is that right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#discussion_r17053046
  
    --- Diff: camp/camp-server/pom.xml ---
    @@ -70,20 +70,13 @@
             
             <dependency>
                 <groupId>com.fasterxml.jackson.core</groupId>
    -            <artifactId>jackson-annotations</artifactId>
    -        </dependency>
    -        <dependency>
    -            <groupId>com.fasterxml.jackson.core</groupId>
                 <artifactId>jackson-databind</artifactId>
    +            <!-- jackson-core and jackson-annotations are pulled in from this, with the right version -->
    --- End diff --
    
    @richardcloudsoft you previously changed lots of `pom.xml` files so all code dependencies were explicit. Will this change lead to whatever tool you used giving warnings about that again? Care to argue the case?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#discussion_r17053236
  
    --- Diff: core/src/main/java/brooklyn/location/geo/MaxMind2HostGeoLookup.java ---
    @@ -0,0 +1,115 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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 brooklyn.location.geo;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.net.InetAddress;
    +import java.net.MalformedURLException;
    +
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import brooklyn.util.internal.BrooklynSystemProperties;
    +import brooklyn.util.net.Networking;
    +import brooklyn.util.text.Strings;
    +
    +import com.google.common.base.Throwables;
    +import com.google.common.collect.Lists;
    +import com.maxmind.geoip2.DatabaseReader;
    +import com.maxmind.geoip2.model.CityResponse;
    +import com.maxmind.geoip2.record.Subdivision;
    +
    +public class MaxMind2HostGeoLookup implements HostGeoLookup {
    +
    +    public static final Logger log = LoggerFactory.getLogger(MaxMind2HostGeoLookup.class);
    +    
    +    static final String MAXMIND_DB_URL = "http://dev.maxmind.com/geoip/geoip2/geolite2/#Downloads";
    +    // TODO this should be configurable from system property or brooklyn.properties
    +    // TODO and should use properties BrooklynServerConfig.MGMT_BASE_DIR (but hard to get mgmt properties here!)
    +    static final String MAXMIND_DB_PATH = System.getProperty("user.home")+"/"+".brooklyn/"+"GeoLite2-City.mmdb";
    --- End diff --
    
    Would be good to externalise this as a config key so can be set in brooklyn.properties etc. But not needed in this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#issuecomment-54321301
  
    thanks guys, merging


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...

Posted by richardcloudsoft <gi...@git.apache.org>.
Github user richardcloudsoft commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#issuecomment-54317078
  
    BROOKLYN-60 is the issue for this PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---