You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
@@ -38,10 +36,6 @@ The following parameters can be set in config files or in env variables:
38
36
- KAFKA_ERROR_TOPIC: The kafka error topic.
39
37
- CREATE_CHALLENGE_TOPIC: the create challenge Kafka message topic, default value is 'challenge.notification.create'
40
38
- UPDATE_CHALLENGE_TOPIC: the update challenge Kafka message topic, default value is 'challenge.notification.update'
41
-
- CREATE_CHALLENGE_RESOURCE_TOPIC : The kafka topic to which to write create challenge resources events, default value is 'challenge.action.resource.create' (This topic exists in https://lauscher.topcoder-dev.com/ and can be used for testing)
42
-
- COPILOT_ROLE_UUID: The Copilot role UUID, default value is 'bac822d2-725d-4973-9714-360918a09bc0' ( the same value should be set for the corresponding configuration value in legacy-challenge-resource-processor at https://github.com/topcoder-platform/legacy-challenge-resource-processor/blob/develop/src/common/utils.js#L10)
43
-
- OBSERVER_ROLE_UUID: The Observer role UUID, default value is 'bac822d2-725d-4973-9712-360918a09bc0' ( the same value should be set for the corresponding configuration value in legacy-challenge-resource-processor at https://github.com/topcoder-platform/legacy-challenge-resource-processor/blob/develop/src/common/utils.js#L10)
44
-
- BUSAPI_URL: The event bus API URL
45
39
- AUTH0_URL: Auth0 URL, used to get TC M2M token
46
40
- AUTH0_AUDIENCE: Auth0 audience, used to get TC M2M token
47
41
- TOKEN_CACHE_TIME: Auth0 token cache time, used to get TC M2M token
@@ -50,19 +44,18 @@ The following parameters can be set in config files or in env variables:
50
44
- AUTH0_PROXY_SERVER_URL: Proxy Auth0 URL, used to get TC M2M token
51
45
- V5_CHALLENGE_API_URL: v5 challenge api url, default value is 'http://localhost:4000/v5/challenges'
52
46
- V5_CHALLENGE_TYPE_API_URL: v5 challenge type api url, default value is 'http://localhost:4000/v5/challengeTypes'
53
-
- INFORMIX: Informix database configuration parameters, refer `config/default.js` for more information
47
+
- V4_CHALLENGE_API_URL: v4 challenge api url, default value is 'http://localhost:4000/v4/challenges'
48
+
- V4_TECHNOLOGIES_API_URL: v4 technologies api url, default value is 'http://localhost:4000/v4/technologies'
49
+
- V4_PLATFORMS_API_URL: v4 platforms api url, default value is 'http://localhost:4000/v4/platforms'
54
50
55
51
There is a `/health` endpoint that checks for the health of the app. This sets up an expressjs server and listens on the environment variable `PORT`. It's not part of the configuration file and needs to be passed as an environment variable
56
52
57
53
Configuration for the tests is at `config/test.js`, only add such new configurations different from `config/default.js`
58
54
- MOCK_API_PORT: the mock server port, default is 4000
59
55
- WAIT_TIME: wait time used in test, default is 1500 or 1.5 second
60
-
- V4_CHALLENGE_API_URL: the v4 challenge api url, used mock v4 challenge api in testing
61
-
62
56
63
57
You can find sample `.env` files inside the `/docker` directory.
64
58
65
-
## Local Deployment
66
59
### Foreman Setup
67
60
To install foreman follow this [link](https://theforeman.org/manuals/1.24/#3.InstallingForeman)
68
61
To know how to use foreman follow this [link](https://theforeman.org/manuals/1.24/#2.Quickstart)
@@ -91,43 +84,68 @@ You can find sample `.env` files inside the `/docker` directory.
91
84
- run the producer and then write some message into the console to send to the `challenge.notification.create` topic:
`{"topic":"challenge.notification.create","originator":"challenge-api","timestamp":"2019-05-14T00:00:00.000Z","mime-type":"application/json","payload":{"id":"0fe70d1a-ad3c-4c58-b341-a478145c4747","created":"2020-03-23T13:21:07.729Z","createdBy":"TopcoderService","typeId":"0b2ac310-eaf0-40e3-b66b-37e5e9e09365","track":"DEVELOPMENT","name":"Lets see if this will work 12","description":"test-description","timelineTemplateId":"a93544bc-c165-4af4-b55e-18f3593b457a","phases":[{"phaseId":"a93544bc-c165-4af4-b55e-18f3593b457a","duration":1000000,"id":"607e8f90-1ed6-49a3-b5a2-486b761a3def","name":"Registration","isOpen":false,"scheduledStartDate":"2020-03-14T16:28:39.882Z","scheduledEndDate":"2020-03-26T06:15:19.882Z","actualStartDate":"2020-03-14T16:28:39.882Z","actualEndDate":"2020-03-26T06:15:19.882Z"},{"phaseId":"6950164f-3c5e-4bdc-abc8-22aaf5a1bd49","duration":1000000,"id":"486fc45e-01e1-4a20-bda1-50cff82943db","name":"Submission","isOpen":false,"scheduledStartDate":"2020-03-14T16:28:39.882Z","scheduledEndDate":"2020-03-26T06:15:19.882Z","actualStartDate":"2020-03-14T16:28:39.882Z","actualEndDate":"2020-03-26T06:15:19.882Z"}],"prizeSets":[{"type":"Challenge prizes","description":"desc","prizes":[{"description":"desc-first","type":"first place","value":500},{"description":"desc-second","type":"second place","value":250}]}],"reviewType":"INTERNAL","tags":["Other"],"projectId":8913,"forumId":456,"status":"Draft","startDate":"2020-03-14T16:28:39.882Z","terms":[{"id":"0dedac8f-5a1a-4fe7-936f-e1d04dc65b7d","agreeabilityType":"Electronically-agreeable","title":"Terms & Conditions of Use at TopCoder","url":""}],"endDate":"2020-03-26T06:15:19.882Z","numOfSubmissions":0,"numOfRegistrants":0}}`
95
88
- optionally, use another terminal, go to same directory, start a consumer to view the messages:
- writing/reading messages to/from other topics are similar
98
91
99
-
### Topcoder Informix Database Setup
100
-
We will use Topcoder Informix database setup on Docker.
92
+
### Local deployment without Docker
101
93
102
-
Go to `docker-ifx` folder and run `docker-compose up`
103
-
After the database has initialized, You can use a database GUI tool(example [DBeaver](https://dbeaver.io)) to run the sql script `docker-ifx/update.sql`.
94
+
Please make sure you installed and configured kafka
104
95
105
-
**Dev Only Step, DO NOT EXECUTE IN PRODUCTION**
106
-
For testing the creation of challenge resources, the users need to agree to user terms before adding them as resources, to achieve this : execute the sql script `docker-ifx/devOnly-Updates.sql` this will make all users in the database agree to all terms.
107
-
Additionally the above script will do the following :
108
-
-- Create two Copilot profiles in the db for users : ksmith and wyzmo
109
-
-- Create a TC direct project with id = 3000
110
-
-- Assign both copilots (ksmith and wyzmo) to the TC direct project with project_full permissions
111
-
-- Add three users ('Hung', 'twight' and 'dok_tester') with project_report, project_read and project_write permissions respectively.
96
+
Install all dependencies
112
97
113
-
### Local deployment without Docker
114
-
- Given the fact that the library used to access Informix DB depends on Informix Client SDK.
115
-
We will run the application on Docker using a base image with Informix Client SDK installed and properly configured.
116
-
For deployment, please refer to next section 'Local Deployment with Docker'
Mock server will be started by test tool during testing but for completing local setup please run mock server
116
+
in a separate terminal after running tests. Shutdown mock-api for running tests.
117
+
118
+
```
119
+
npm run mock-api
120
+
```
121
+
122
+
Run the application
123
+
124
+
```
125
+
npm start
126
+
```
127
+
128
+
We will be using mock version of V4 and V5 APIs for local development and testing. You can also configure
129
+
corresponding environment variables and point processor to topcoder-dev environment.
117
130
118
131
### Local Deployment with Docker
119
132
120
-
1. Make sure that Kafka, mock server and Informix are running as per instructions above.
133
+
1. Make sure that Kafka, mock server are running as per instructions above.
121
134
122
135
2. Go to `docker` folder
123
136
124
-
3. Rename the file `sample.api.env` to `api.env` And properly update the IP addresses to match your environment for the variables : KAFKA_URL, INFORMIX_HOST and V5_CHALLENGE_TYPE_API_URL( make sure to use IP address instead of hostname ( i.e localhost will not work)).Here is an example:
137
+
3. Rename the file `sample.api.env` to `api.env` And properly update the IP addresses to match below environment for the variables ( make sure to use IP address instead of hostname ( i.e localhost will not work)).Here is an example:
138
+
Please see that 192.168.1.3 is the IP of host machine for docker where we run all the dependencies
Refer to the verification document `Verification.md`
183
206
184
207
## Notes
185
-
In constants.js, 'processorUserId' is set to 132456 which is the id of the user 'heffan'. It used to populated auditing fields for the created records (create_user and modify_user).
186
-
In Production, a dedicated user should be created for the legacy-challenge-processor and this value should be properly updated in constants.js.
208
+
209
+
Application is configured to use local mock APs for development and you can point application
210
+
to topcoder dev environment for verification purposes. But, please be aware that you need to use correct
211
+
kafka message values for verification.
212
+
213
+
There are some critical issues in dependencies which come from Topcoder and no-kafka libraries. We use latest
214
+
versions as of now but these issues should be addressed.
0 commit comments