Deploying on Rancher
Installing the Crop Sown Registry from the OpenG2P catalogue in Rancher: prerequisites, the choices to make, sample data, ODK Central, checks after install, and uninstall.
This page lists the steps and choices. What the registry is and how it is packaged: Crop Sown Registry. Install order and the install Jobs: Deployment.
Prerequisites
A Kubernetes cluster, with admin rights to it and to Rancher.
commons-base and commons-services installed and healthy in the namespace. See the Commons Helm Chart. The registry uses, from commons-services:
ServiceNeeded forSetting in the commons-services formMaster Data
Every coded field, the geography, sample farmers
Country Pack
ETH, Dataset Themesagriculture, Load Datasets on. For a demo, also Load Sample People onAWE
Cluster registrations and changes
Install AWE? on
Partner Management and Consent Manager
Partner calls: signature checks and consent
On (defaults)
ODK Central
Only if sowings are collected with ODK
Install ODK Central? on
The OpenG2P catalogue added in Rancher (Apps → Repositories).
The Farmer Registry is not needed. See How it relates to the Farmer Registry.
Install
In Rancher, select the cluster and the namespace.
Under Apps → Charts, refresh the repositories and select OpenG2P Crop Sown Registry.
Choose the version. Tick Show pre-release versions to see
0.0.0-develop.Nversions.Name the release, e.g.
csr. The release name is part of the hostnames and the database name.Tick Customize Helm options before install, then Next.
Make the choices below, then Install.
The form is the platform chart's form plus a Crop Sown Registry group. Each field is described in the form. In a values file, platform settings sit under registry.* and shared settings under global.*.
Choices
The defaults suit a production-like install. Change only these.
Base Domain
Your environment's domain
Every hostname derives from it. Default <namespace>.openg2p.org. The partner API is then at partner-<release>.<Base Domain>
Pull submissions from ODK Central
On only if sowings are collected with ODK
Needs more steps. See ODK Central
Pinned Catalogue Release
Empty, or a release to freeze the lists for a season
Empty reads the latest lists from Master Data
AWE Approver User Password
Your own
The initial password of the demo cluster approvers alex.carter and nina.patel
Leave as they are:
Install ID Generator?, Enable DB Seed and Load Templates to Object Store on. The ID generator issues Cluster IDs, the seed is the registry's configuration, and without the templates every DCI search fails.
Sanity - Run Full E2E off. The platform's e2e tier seeds an entity record this registry does not have.
Load Sample Images and Optional Seeds: this registry ships none.
The ID generator's unused platform pools (
individual,household,farmer) are harmless.
Settings only in YAML
Set these in Edit YAML:
Production
Keep Load Sample Data and Load sample crop seasons off, and Sanity - Run Full E2E off.
Keep Verify Partner Signature and Enforce Consent on.
Allow Unsigned Read of Data Scope Catalogue is on by default: anyone who can reach the partner API can list the scopes (field names, no data). Turn it off to keep them private; Partner Management then takes scopes as free text.
Replace the demo cluster approvers (see Customisation).
Sample data
Sample data is off by default. For a demo, turn on both switches:
Load Sample Data
Two sample clusters, approved: CL-4729318560 (teff, Sheno, Oromia) and CL-5863027194 (wheat, Tahtay Adiyabo, Tigray)
Master Data, for the clusters' geography
Load sample crop seasons
Crop seasons for every adult among Master Data's sample people
The sample clusters, and Master Data's sample people
What the crop seasons cover:
Farmers are Master Data's sample people: person
ETH-IND-0007is farmerFR-0007, with the person's national ID as the Fayda FAN.Plots are
LAND-0007-1for every farmer andLAND-0007-2for every third, in the person's district (woreda).Seasons: Meher 2018 complete (with a pest report for some); Belg 2018 complete for some farmers (with drought damage); Meher 2019 growing, so its harvests are due on the work list.
Verification: most sowings and harvests are verified; every fifth farmer's are pending. One sowing is corrected.
Clusters: farmers in a sample cluster's district join it.
The Farmer Registry numbers its sample farmers and lands the same way. A demo of both shows the same farmers and plots, though neither reads the other.
Collecting sowings with ODK Central
The registry can pull Sown activities from an ODK Central form. This is off by default and takes five steps.
The form. Build and publish an XLSForm with form ID
crop_sowingin an ODK Central project. The registry ships the field mapping, not the form. The form's field paths must match the mapping inscripts/activity_definitions.py(ODK_FORMS), e.g.farmer/farmer_id,plot/plot_id,plot/woreda,season/crop_year,season/season,sowing/crop,sowing/area_ha,sowing/seed_type,sowing/sowing_date_ec,sowing/photo. Coded answers must be Master Data codes.A login. Create an ODK Central web user with access to the project, and a Secret holding it:
The YAML. Add the
envVarsFromentries shown in Settings only in YAML.The switch. Set Pull submissions from ODK Central to
trueand upgrade.Activate the mapping. The seeded mapping is inactive, for project
1. There is no screen for it yet. In the registry's database:
Submissions are then pulled every five minutes. The ODK instance ID makes each pull idempotent. Photos are stored as documents. A submission that fails validation is kept in g2p_activity_odk_failures and retried; it does not hold back the others.
Verify
A healthy install ends with the Jobs complete and the pods running:
<release>-db-seed
Complete
<release>-activity-samples
Complete, with counts. Only when sample crop seasons are on
<release>-sanity
Complete: the partner API is up and serves DCI search
iam-register
Complete
Then open the staff portal at https://<Registry Hostname>:
Activity registers → Crop Sown shows the activity types under Record. With sample data, it also shows activities, crop seasons, summaries and indicators.
Cluster lists the sample clusters, if loaded.
End-to-end check. scripts/e2e_smoke.py in the repository records one crop season through the partner API (plan to harvest), checks idempotency, a blocked out-of-order activity and a correction, and reads it back with DCI search. It does not sign its requests or carry a consent, so it runs against a registry with Verify Partner Signature and Enforce Consent off, typically the hybrid local run:
Uninstall
helm uninstall leaves the database, PVCs and IAM rows behind. Use the repository's script, with --dry-run first:
It removes the release, leftover Jobs, labelled Secrets and ConfigMaps, the registry's database and role in commons-postgresql, its IAM rows, and its PVCs and PVs. Options: --keep-iam, --keep-pvs, --force, --yes. It leaves shared services alone: the Keycloak client, the templates in the shared object store, Master Data, and any Partner Management or Consent Manager entries.
Last updated
Was this helpful?