Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Sync master with develop #57

Merged
merged 20 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c8a5248
Issue 50 - Fix issues with api (documentation)
xxcxy Oct 6, 2020
055ee11
Merge pull request #51 from topcoder-platform/Issue_50
callmekatootie Oct 7, 2020
7c965ca
Support enrichment for users endpoints
callmekatootie Oct 13, 2020
92af080
Merge branch 'develop' of github.com:topcoder-platform/u-bahn-api int…
callmekatootie Oct 13, 2020
365423a
Support filtering by external id on users
callmekatootie Oct 13, 2020
95eb66b
Support filtering by org id on users
callmekatootie Oct 13, 2020
211f395
Merge winning submission from enrich contest
callmekatootie Oct 20, 2020
25ea241
Working data insertion script
callmekatootie Oct 21, 2020
7f7a6cb
Working db dump script and misc
callmekatootie Oct 21, 2020
8ac769b
Restore deleted code
callmekatootie Oct 21, 2020
2bf09e4
Merge pull request #54 from topcoder-platform/enrich-2
callmekatootie Oct 21, 2020
310adc9
1. Set the enrich policy name as a config
callmekatootie Oct 22, 2020
07ea1ad
Merge pull request #56 from topcoder-platform/enrich
callmekatootie Oct 22, 2020
2f5269e
Update elasticsearch host to support elastic cloud since we are using…
callmekatootie Oct 22, 2020
3006252
touch
cwdcwd Oct 22, 2020
e76171c
Debug why db to es migration script failed
callmekatootie Oct 23, 2020
f58967f
Merge branch 'develop' of github.com:topcoder-platform/u-bahn-api int…
callmekatootie Oct 23, 2020
49aa2fb
more debugging
callmekatootie Oct 23, 2020
354fedf
Fix issue where data migration from db to es fails
callmekatootie Oct 23, 2020
6235c7f
Fix issue where data migration from db to es fails
callmekatootie Oct 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ scripts/generate
.nyc_output
.env
coverage
.vscode
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- node 12.x
- npm 6.x
- docker
- elasticsearch 6.x
- elasticsearch 7.7

## Configuration

Expand Down Expand Up @@ -35,12 +35,24 @@ Configuration for the application is at config/default.js and config/production.
- UBAHN_UPDATE_TOPIC: Kafka topic for update message
- UBAHN_DELETE_TOPIC: Kafka topic for delete message
- UBAHN_AGGREGATE_TOPIC: Kafka topic that is used to combine all create, update and delete message(s)
- ES.HOST: Elasticsearch host
- ES.API_VERSION: Elasticsearch API version
- ES_HOST: Elasticsearch host
- ES.DOCUMENTS: Elasticsearch index, type and id mapping for resources.
- ATTRIBUTE_GROUP_PIPELINE_ID: The pipeline id for enrichment with attribute group. Default is `attributegroup-pipeline`
- SKILL_PROVIDER_PIPELINE_ID: The pipeline id for enrichment with skill provider. Default is `skillprovider-pipeline`
- USER_PIPELINE_ID: The pipeline id for enrichment of user details. Default is `user-pipeline`
- ATTRIBUTE_GROUP_ENRICH_POLICYNAME: The enrich policy for attribute group. Default is `attributegroup-policy`
- SKILL_PROVIDER_ENRICH_POLICYNAME: The enrich policy for skill provider. Default is `skillprovider-policy`
- ROLE_ENRICH_POLICYNAME: The enrich policy for role. Default is `role-policy`
- ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME: The enrich policy for achievement provider. Default is `achievementprovider-policy`
- SKILL_ENRICH_POLICYNAME: The enrich policy for skill. Default is `skill-policy`
- ATTRIBUTE_ENRICH_POLICYNAME: The enrich policy for skill. Default is `attribute-policy`
- ELASTICCLOUD_ID: The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this
- ELASTICCLOUD_USERNAME: The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
- ELASTICCLOUD_PASSWORD: The elastic cloud password for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud

For `ES.DOCUMENTS` configuration, you will find multiple other configurations below it. Each has default values that you can override using the environment variables


## Local deployment

Setup your Elasticsearch instance and ensure that it is up and running.
Expand Down
36 changes: 26 additions & 10 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,57 @@ module.exports = {

// ElasticSearch
ES: {
HOST: process.env.ES_HOST || 'localhost:9200',
API_VERSION: process.env.ES_API_VERSION || '7.4',
HOST: process.env.ES_HOST || 'http://localhost:9200',

ELASTICCLOUD: {
id: process.env.ELASTICCLOUD_ID,
username: process.env.ELASTICCLOUD_USERNAME,
password: process.env.ELASTICCLOUD_PASSWORD
},

// es mapping: _index, _type, _id
DOCUMENTS: {
achievementprovider: {
index: process.env.ACHIEVEMENT_PROVIDER_INDEX || 'achievement_provider',
type: '_doc'
type: '_doc',
enrichPolicyName: process.env.ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME || 'achievementprovider-policy'
},
attribute: {
index: process.env.ATTRIBUTE_INDEX || 'attribute',
type: '_doc'
type: '_doc',
enrichPolicyName: process.env.ATTRIBUTE_ENRICH_POLICYNAME || 'attribute-policy'
},
attributegroup: {
index: process.env.ATTRIBUTE_GROUP_INDEX || 'attribute_group',
type: '_doc'
type: '_doc',
pipelineId: process.env.ATTRIBUTE_GROUP_PIPELINE_ID || 'attributegroup-pipeline',
enrichPolicyName: process.env.ATTRIBUTE_GROUP_ENRICH_POLICYNAME || 'attributegroup-policy'
},
organization: {
index: process.env.ORGANIZATION_INDEX || 'organization',
type: '_doc'
type: '_doc',
enrichPolicyName: process.env.ORGANIZATION_ENRICH_POLICYNAME || 'organization-policy'
},
role: {
index: process.env.ROLE_INDEX || 'role',
type: '_doc'
type: '_doc',
enrichPolicyName: process.env.ROLE_ENRICH_POLICYNAME || 'role-policy'
},
skill: {
index: process.env.SKILL_INDEX || 'skill',
type: '_doc'
type: '_doc',
enrichPolicyName: process.env.SKILL_ENRICH_POLICYNAME || 'skill-policy'
},
skillprovider: {
index: process.env.SKILL_PROVIDER_INDEX || 'skill_provider',
type: '_doc'
type: '_doc',
pipelineId: process.env.SKILL_PROVIDER_PIPELINE_ID || 'skillprovider-pipeline',
enrichPolicyName: process.env.SKILL_PROVIDER_ENRICH_POLICYNAME || 'skillprovider-policy'
},
user: {
index: process.env.USER_INDEX || 'user',
type: '_doc'
type: '_doc',
pipelineId: process.env.USER_PIPELINE_ID || 'user-pipeline'
},
// sub resources under user
achievement: {
Expand Down
Loading