openbudgets / DAM

OBEU Data Analysis and Mining repository
3 stars 1 forks source link

Configure Endpoints #15

Open skarampatakis opened 6 years ago

skarampatakis commented 6 years ago

It seems that the env variables are not respected anywhere. I have set the .env to get the opencpu endpoint from my local container but it consists to ask the remote. Then I saw this file https://github.com/openbudgets/DAM/blob/staging_indigo/tasks/dam.json

Is it here where I need to change the parameters?

HimmelStein commented 6 years ago

DAM uses 'OKFGR_TS' env variable to configure the greek server, and it calls the package okfgr_dm, see here, https://github.com/openbudgets/okfgr_dm/blob/master/okfgr_dm/okfgr_server.py

does this help?

HimmelStein commented 6 years ago

@skarampatakis on our side, it works by updating the configuration in the .env file.

skarampatakis commented 6 years ago

On which .env you mean? This is the .env on Fhg server on the docker-config/damapp folder

export APP_SETTINGS="config.DevelopmentConfig"

export DATABASE_URL="postgresql://postgres:$DAM_POSTGRES_PW@dampostgres/obeu_dam"

#export VIRTUOSO_ENDPOINT="http://eis-openbudgets.iais.fraunhofer.de/virtuoso/sparql"
#export VIRTUOSO_ENDPOINT="http://apps.openbudgets.eu/virtuoso/sparql"
export VIRTUOSO_ENDPOINT="http://data.openbudgets.eu/sparql"
export FILE_OF_GRAPH_NAMES="GRAPH_NAMES.txt"

export OK_GREECE_ROOT="http://okfnrg.math.auth.gr"
export OKFGR_TimeSeries_EndPoint="/ocpu/library/TimeSeries.OBeu/R/ts.analysis"
export OKFGR_DM_Github="https://github.com/okgreece/TimeSeries.OBeu"
export OKFGR_SAT="/ocpu/library/DescriptiveStats.OBeu/R/open_spending.ds"
#export OKFGR_TS="/ocpu/library/OBeU/R/ts.obeu"
export OKFGR_TS="/ocpu/library/TimeSeries.OBeu/R/open_spending.ts/print"
export OKFGR_SERVER="okfnrg.math.auth.gr"

However when used through Indigo it sends a request to http://apps.openbudgets.eu/ocpu/ocpu/library/DescriptiveStats.OBeu/R/open_spending.ds/print

so I think it is not respected or it is a different file?

HimmelStein commented 6 years ago

@skarampatakis you are right. something @liyakun knows better

liyakun commented 6 years ago

@skarampatakis @HimmelStein I tried to change the .env file, but it seems that it is not used, I have to change dam.json to make it call the opencpu running on FHG server.

skarampatakis commented 6 years ago

So it is not the .env file who defines this parameter but the dam.json? Are these parameters required somewhere else? Otherwise please remove them to prevent confusion later on.

In terms of integration then it seems that we could have a dam.json file on the docker-config/damapp folder and copy it on build. But please take care that it should also be somehow configurable (domain agnostic) as required by https://github.com/openbudgets/integration/commit/a04eeb3d67af9318e0c832dd5962a38540dcee18#commitcomment-24646654