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

Commit cf49047

Browse files
Merge pull request #57 from topcoder-platform/develop
Sync master with develop
2 parents 16820cd + 6235c7f commit cf49047

15 files changed

+1581
-344
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ scripts/generate
66
.nyc_output
77
.env
88
coverage
9+
.vscode

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- node 12.x
66
- npm 6.x
77
- docker
8-
- elasticsearch 6.x
8+
- elasticsearch 7.7
99

1010
## Configuration
1111

@@ -35,12 +35,24 @@ Configuration for the application is at config/default.js and config/production.
3535
- UBAHN_UPDATE_TOPIC: Kafka topic for update message
3636
- UBAHN_DELETE_TOPIC: Kafka topic for delete message
3737
- UBAHN_AGGREGATE_TOPIC: Kafka topic that is used to combine all create, update and delete message(s)
38-
- ES.HOST: Elasticsearch host
39-
- ES.API_VERSION: Elasticsearch API version
38+
- ES_HOST: Elasticsearch host
4039
- ES.DOCUMENTS: Elasticsearch index, type and id mapping for resources.
40+
- ATTRIBUTE_GROUP_PIPELINE_ID: The pipeline id for enrichment with attribute group. Default is `attributegroup-pipeline`
41+
- SKILL_PROVIDER_PIPELINE_ID: The pipeline id for enrichment with skill provider. Default is `skillprovider-pipeline`
42+
- USER_PIPELINE_ID: The pipeline id for enrichment of user details. Default is `user-pipeline`
43+
- ATTRIBUTE_GROUP_ENRICH_POLICYNAME: The enrich policy for attribute group. Default is `attributegroup-policy`
44+
- SKILL_PROVIDER_ENRICH_POLICYNAME: The enrich policy for skill provider. Default is `skillprovider-policy`
45+
- ROLE_ENRICH_POLICYNAME: The enrich policy for role. Default is `role-policy`
46+
- ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME: The enrich policy for achievement provider. Default is `achievementprovider-policy`
47+
- SKILL_ENRICH_POLICYNAME: The enrich policy for skill. Default is `skill-policy`
48+
- ATTRIBUTE_ENRICH_POLICYNAME: The enrich policy for skill. Default is `attribute-policy`
49+
- 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
50+
- ELASTICCLOUD_USERNAME: The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
51+
- ELASTICCLOUD_PASSWORD: The elastic cloud password for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
4152

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

55+
4456
## Local deployment
4557

4658
Setup your Elasticsearch instance and ensure that it is up and running.

config/default.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,41 +50,57 @@ module.exports = {
5050

5151
// ElasticSearch
5252
ES: {
53-
HOST: process.env.ES_HOST || 'localhost:9200',
54-
API_VERSION: process.env.ES_API_VERSION || '7.4',
53+
HOST: process.env.ES_HOST || 'http://localhost:9200',
54+
55+
ELASTICCLOUD: {
56+
id: process.env.ELASTICCLOUD_ID,
57+
username: process.env.ELASTICCLOUD_USERNAME,
58+
password: process.env.ELASTICCLOUD_PASSWORD
59+
},
60+
5561
// es mapping: _index, _type, _id
5662
DOCUMENTS: {
5763
achievementprovider: {
5864
index: process.env.ACHIEVEMENT_PROVIDER_INDEX || 'achievement_provider',
59-
type: '_doc'
65+
type: '_doc',
66+
enrichPolicyName: process.env.ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME || 'achievementprovider-policy'
6067
},
6168
attribute: {
6269
index: process.env.ATTRIBUTE_INDEX || 'attribute',
63-
type: '_doc'
70+
type: '_doc',
71+
enrichPolicyName: process.env.ATTRIBUTE_ENRICH_POLICYNAME || 'attribute-policy'
6472
},
6573
attributegroup: {
6674
index: process.env.ATTRIBUTE_GROUP_INDEX || 'attribute_group',
67-
type: '_doc'
75+
type: '_doc',
76+
pipelineId: process.env.ATTRIBUTE_GROUP_PIPELINE_ID || 'attributegroup-pipeline',
77+
enrichPolicyName: process.env.ATTRIBUTE_GROUP_ENRICH_POLICYNAME || 'attributegroup-policy'
6878
},
6979
organization: {
7080
index: process.env.ORGANIZATION_INDEX || 'organization',
71-
type: '_doc'
81+
type: '_doc',
82+
enrichPolicyName: process.env.ORGANIZATION_ENRICH_POLICYNAME || 'organization-policy'
7283
},
7384
role: {
7485
index: process.env.ROLE_INDEX || 'role',
75-
type: '_doc'
86+
type: '_doc',
87+
enrichPolicyName: process.env.ROLE_ENRICH_POLICYNAME || 'role-policy'
7688
},
7789
skill: {
7890
index: process.env.SKILL_INDEX || 'skill',
79-
type: '_doc'
91+
type: '_doc',
92+
enrichPolicyName: process.env.SKILL_ENRICH_POLICYNAME || 'skill-policy'
8093
},
8194
skillprovider: {
8295
index: process.env.SKILL_PROVIDER_INDEX || 'skill_provider',
83-
type: '_doc'
96+
type: '_doc',
97+
pipelineId: process.env.SKILL_PROVIDER_PIPELINE_ID || 'skillprovider-pipeline',
98+
enrichPolicyName: process.env.SKILL_PROVIDER_ENRICH_POLICYNAME || 'skillprovider-policy'
8499
},
85100
user: {
86101
index: process.env.USER_INDEX || 'user',
87-
type: '_doc'
102+
type: '_doc',
103+
pipelineId: process.env.USER_PIPELINE_ID || 'user-pipeline'
88104
},
89105
// sub resources under user
90106
achievement: {

0 commit comments

Comments
 (0)