Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory ckan 2.8 builded datapusher #31

Conversation

avdata99
Copy link
Contributor

@avdata99 avdata99 commented Mar 20, 2020

Using a built image of datapusher.
Added a test to check the service running.
I must fix CKAN because it fails to run datapusher in docker-compose. We will need to port this fix to CKAN 2.8.3. Maybe in a new issue.

@avdata99
Copy link
Contributor Author

I'm not able to add reviewrs here. @pjsharpe07 @adborden
I must fix CKAN because it fails to run datapusher in docker-compose. We will need to port this fix to CKAN 2.8.3. Maybe in a new issue.

@adborden
Copy link
Contributor

@avdata99 is this ready for review? It's still labeled WIP?

@avdata99 avdata99 changed the title WIP: Inventory ckan 2.8 builded datapusher Inventory ckan 2.8 builded datapusher Mar 23, 2020
@avdata99
Copy link
Contributor Author

@avdata99 is this ready for review? It's still labeled WIP?

I just fix the PR title. It's ready to analyze and merge

@jbrown-xentity
Copy link
Contributor

@avdata99 so looking at the CKAN changes, it's making changes to the datapusher, right? Isn't the datapusher integrated into CKAN core at this point?
Also, your requirements file doesn't pull from your fix, it's commented out. Is this the correct behavior?

@@ -102,7 +103,7 @@ solr_url = http://solr:8983/solr/inventory
# original plugins
# ckan.plugins = usmetadata datajson datastore datapusher stats text_view recline_view googleanalyticsbasic

ckan.plugins = googleanalyticsbasic datastore usmetadata datajson
ckan.plugins = googleanalyticsbasic datastore datapusher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the removal of usmetadata and datajson?

# datapusher hotfix: CKAN has an error for running with docker.
# Fixed in master, need to port to CKAN 2.8.3
# https://github.com/ckan/ckan/pull/5281/files
# -e git+https://github.com/avdata99/ckan@my_2.8.3#egg=ckan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your CKAN fix required before this PR is merged? Can you please push this to the GSA repo as a new branch datagov-inventory-2.8? I just added you as a collaborator https://github.com/GSA/ckan/invitations

@@ -104,3 +104,13 @@ function test_datastore_request () {
return 1;
fi
}

@test "datapusher working" {
datapusher_status=$(curl -X GET "http://datapusher:8000/status" | grep -o "push_to_datastore")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the --fail flag so a non 200 status code results in curl failing. Also, no need to grep and capture the output, grep will return non-zero and fail the test if it doesn't find the pattern. No need for the if/else. The test is simply:

Suggested change
datapusher_status=$(curl -X GET "http://datapusher:8000/status" | grep -o "push_to_datastore")
curl --silent --fail "http://datapusher:8000/status" | grep push_to_datastore

@adborden
Copy link
Contributor

adborden commented Mar 23, 2020

Hmm, @avdata99 FWIW, ckan/ckan@d834f17 looks like the wrong fix. If datapusher is hosted on a different Host, shouldn't we just set the ckan.datapusher.callback_url_base config?

Your fix changes site_url, which feels wrong to me. site_url should always be the CKAN URL (and ckan.site_url).

@avdata99
Copy link
Contributor Author

avdata99 commented Mar 24, 2020

Hmm, @avdata99 FWIW, ckan/ckan@d834f17 looks like the wrong fix. If datapusher is hosted on a different Host, shouldn't we just set the ckan.datapusher.callback_url_base config?

Your fix changes site_url, which feels wrong to me. site_url should always be the CKAN URL (and ckan.site_url).

@adborden From the point of view of the Datapusher (I mean, inside the Datapusher) you need to connect to the CKAN site URL in a different way when you are usin docker.

localhost:5000 is a common site_url config but fails if you are usin docker. In that case you need ckan:5000 (or app:5000 or something like this).

When CKAN talks to datapusher sends a ckan_url to allow datapusher to send data back to CKAN. Is just some lines bellow my changes.

If we use public URLs for both services (CKAN and Datapusher) this is not a problem. This just fails when you are inside Docker.

@jbrown-xentity jbrown-xentity merged commit 6186bae into GSA:inventory_ckan_2.8 Mar 24, 2020
@avdata99 avdata99 deleted the inventory_ckan_2.8_builded_datapusher branch March 25, 2020 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants