Project

General

Profile

Actions

Task #6185

closed

Problem while creating service endpoints under GRSF and GRSF_Admin contexts

Added by Costantino Perciante over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
High
Category:
Other
Target version:
Start date:
Dec 12, 2016
Due date:
% Done:

100%

Estimated time:
Infrastructure:
Production

Description

I should create two service endpoints for each of the above contexts. The problem is that once they are created through the infrastructure monitor portlet, in the GRSF context I see 4 endpoints, which means also the two endpoints related to the other (grsf admin) context. It seems not only a visualisation problem, because by using the IS client library and querying for these service endpoints in the GRSF context all resources are returned. Of course, my code cannot work with more than one resource of the same type in the same context, so it fails.

Actions #1

Updated by Costantino Perciante over 8 years ago

Let me add some more information

The code I'm using for querying is this one

@Test
    public void discoverInGRSF() throws Exception{

        String context = "/d4science.research-infrastructures.eu/FARM/GRSF";
        ScopeProvider.instance.set(context);
        List<ServiceEndpoint> resources = getConfigurationFromISFORDB();

        for (ServiceEndpoint serviceEndpoint : resources) {
            logger.debug("Service is " + serviceEndpoint);
        }
    }

private List<ServiceEndpoint> getConfigurationFromISFORDB() throws Exception{

        String RUNTIME_DB_RESOURCE_NAME = "CKanDatabase";
        String PLATFORM_DB_NAME = "postgres";
        SimpleQuery query = queryFor(ServiceEndpoint.class);
        query.addCondition("$resource/Profile/Name/text() eq '"+ RUNTIME_DB_RESOURCE_NAME +"'");
        query.addCondition("$resource/Profile/Platform/Name/text() eq '"+ PLATFORM_DB_NAME +"'");
        DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
        List<ServiceEndpoint> toReturn = client.submit(query);
        return toReturn;

    }
The result set is this one (printed result)
2016-12-13 09:47:23,188 [main] DEBUG org.gcube.datacatalogue.ckanutillibrary.TestDataCatalogueLib - Service is ServiceEndpoint [id=109f7250-74c9-4d00-91b9-e64f0b917a60, scopes=[/d4science.research-infrastructures.eu/FARM/GRSF_Admin], type=RuntimeResource, version=0.4.x, profile=[name=CKanDatabase, description=CKanDatabase, version=null, category=Database, runtime=[hostedOn=ckan-pg-d4s.d4science.org, status=READY, ghn=[id=]], platform=[name=postgres, version=9, minorVersion=1, revisionVersion=0, buildVersion=0], accessPoints=[AccessPoint [description=ckan database access point, accessData=[username=ckan_grsf_admin, password=FePVOjeZOse7gkBmfWzo1nVM9gdbMybN+GuOU3pl2jw=], interface=[endpoints=[name=ckan_prod_grsf_admin, address=ckan-pg-d4s.d4science.org:5432]], properties=[]]]]]
2016-12-13 09:47:23,188 [main] DEBUG org.gcube.datacatalogue.ckanutillibrary.TestDataCatalogueLib - Service is ServiceEndpoint [id=4022e2e2-3bc8-4f05-b84f-56788eb745b0, scopes=[/d4science.research-infrastructures.eu/FARM/GRSF], type=RuntimeResource, version=0.4.x, profile=[name=CKanDatabase, description=CKanDatabase, version=null, category=Database, runtime=[hostedOn=ckan-pg-d4s.d4science.org, status=READY, ghn=[id=]], platform=[name=postgres, version=9, minorVersion=1, revisionVersion=0, buildVersion=0], accessPoints=[AccessPoint [description=ckan database access point, accessData=[username=ckan_grsf, password=FePVOjeZOse7gkBmfWzo1nVM9gdbMybN+GuOU3pl2jw=], interface=[endpoints=[name=ckan_prod_grsf, address=ckan-pg-d4s.d4science.org:5432]], properties=[]]]]]

If the same query is done against the GRSF_Admin scope, a single result is returned (as expected)
Hope it helps

Actions #2

Updated by Costantino Perciante over 8 years ago

I've just done another test under the ENVRIPlus context, that is to create a fake service endpoint. If I query the IS for this resource under the ENVRI context, that resource is wrongly returned back.

P.S.
same query used above

Actions #3

Updated by Roberto Cirillo over 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

This issue was fixed in ic-client 1.0.2 currently deployed in production.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)