Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

GPII-3867 - Update load data section #361

Merged
merged 2 commits into from
Apr 18, 2019

Conversation

amatas
Copy link
Contributor

@amatas amatas commented Apr 16, 2019

Update the load of the data section in the README

Rendered version

gcp/README.md Outdated

Let's load the data, go back to the folder _testData/myDbData_ and run:
1. `curl -d @gpiiKeys.json -H "Content-type: application/json" -X POST http://localhost:5984/gpii/_bulk_docs`
1. `curl -d @.json -H "Content-type: application/json" -X POST http://localhost:5984/gpii/_bulk_docs`
1. `curl -d @gpiiKeys.json -H "Content-type: application/json" -X POST $GPII_DATASOURCE_HOSTNAME@localhost:5984/gpii/_bulk_docs`
Copy link
Contributor

Choose a reason for hiding this comment

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

When running inside rake sh, secret variables can be used directly, i.e. http://$TF_VAR_secret_couchdb_admin_username:[email protected]:5984/gpii/_bulk_docs.

Before I used the following command to interact with CouchDB from rake shell: rake sh["kubectl exec --namespace gpii couchdb-couchdb-0 -c couchdb -- curl -s http://$TF_VAR_secret_couchdb_admin_username:[email protected]:5984/gpii/_all_docs"]

Copy link
Contributor Author

@amatas amatas Apr 17, 2019

Choose a reason for hiding this comment

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

done, thanks @natarajaya

gcp/README.md Outdated
__Note__ that if you are going to perform this in production (prd) you should do it from the _prd_ folder and remember to use the _RAKE_REALLY_RUN_IN_PRD=true_ variable when issuing the commands against the production cluster.
1. Open a port forwarding between the cluster's couchdb host:port and your local machine: `kubectl --namespace gpii port-forward couchdb-couchdb-0 5984 &`
1. Get the current credentials for connecting to the couchdb from a flowmanager pod: `eval $(kubectl -n gpii exec flowmanager-[POD_ID] env | grep ^GPII_DATASOURCE_HOSTNAME | cut -f1 -d@)`
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check my previous comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@mrtyler
Copy link
Contributor

mrtyler commented Apr 17, 2019

These are fine cleanups, but this is not what I requested. GPII/universal#769 (comment)

@amatas
Copy link
Contributor Author

amatas commented Apr 17, 2019

@mrtyler I added the procedure I followed in the last 2 loads.
The JSON files were always generated by Javi and then he sent them to me for loading them.
Are you requesting the guide about how to build the JSON files?

@amatas amatas changed the title NOJIRA - Update load data section GPII-3867 - Update load data section Apr 17, 2019
@mrtyler
Copy link
Contributor

mrtyler commented Apr 17, 2019

Are you requesting the guide about how to build the JSON files?

Yes. The goal of this task was to add documentation we will need to start the system from scratch -- https://issues.gpii.net/browse/GPII-2806.

@amatas
Copy link
Contributor Author

amatas commented Apr 18, 2019

As we decided yesterday I'm going to merge this PR, the task is not completed as we still need the instructions about how to initialize the DB in the case of a disaster.

@amatas amatas merged commit a23bb60 into gpii-ops:master Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants