Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
a013f70
Merge branch 'release-2.6.0'
Jan 9, 2020
81f6e2b
Issue #DIK-4850 fix: Collection summary api fix to get the proper gr…
manjudr Mar 3, 2021
4695064
Issue #DIK-4850 fix: review comments changes
manjudr Mar 3, 2021
901cacb
Merge pull request #333 from manjudr/summary-api-fix
maheshkumargangula Mar 3, 2021
05e243a
Github jira integration
Apr 6, 2021
e68113f
Merge branch 'master' into master
Apr 6, 2021
ad95ee4
Github jira integration
Apr 6, 2021
3293838
Merge pull request #343 from PradyumnaNagendra/master
maheshkumargangula Apr 9, 2021
9552fae
Merge branch 'release-3.7.0'
Apr 12, 2021
89c1a76
Merge release-3.7.0 to master
Apr 12, 2021
1be851d
Merge pull request #346 from PradyumnaNagendra/master
maheshkumargangula Apr 12, 2021
dde8399
SB-29551 | Enhancements in Course Service
karthik-tarento Apr 12, 2022
c1c9322
test cases execution added
gohilamariappan Apr 19, 2022
877f673
created newfile for mvn11
gohilamariappan Apr 19, 2022
d420054
Issue #SB-29648 mvn build tests
pc0202 Apr 20, 2022
714e5b5
Issue #SB-29648 test ignore
pc0202 Apr 20, 2022
83061ec
Merge pull request #444 from pritha-tarento/SB-29648
reshmi-nair Apr 25, 2022
a599dbe
Added few test cases
karthik-tarento Apr 26, 2022
69f2a51
Merge branch 'release-4.9.0' into 4.8.0-adminApis
karthik-tarento Apr 26, 2022
e591e8b
Added param to skipTests in build
karthik-tarento Apr 26, 2022
bcedd79
Using JDK 11 in circle.ci
karthik-tarento Apr 26, 2022
afd6119
Typo in machine config
karthik-tarento Apr 26, 2022
b632f31
Removed machine config
karthik-tarento Apr 26, 2022
9037792
Fix for test care error
karthik-tarento Apr 26, 2022
48ee102
Merge branch '4.8.0-adminApis' of https://github.com/sunbird-cb/sunbi…
karthik-tarento Apr 26, 2022
54698f1
Fix for test cases
karthik-tarento Apr 26, 2022
8b18e06
Reverted the changes in circle ci
karthik-tarento Apr 27, 2022
e7aebbe
Fix for test cases
karthik-tarento Apr 27, 2022
1cbffd3
Added test cases
karthik-tarento Apr 28, 2022
676fe1e
Changed build configuration for code coverage
karthik-tarento Apr 28, 2022
c9e1166
Merge pull request #443 from sunbird-cb/4.8.0-adminApis
reshmi-nair Apr 28, 2022
ca988de
SB-29756 | Content progress issue fix
karthik-tarento May 4, 2022
7593821
SB-29756 | Removed unnecessary field from default list
karthik-tarento May 4, 2022
723d88e
Merge pull request #447 from karthik-tarento/4.9.0-SB-29756-fix
reshmi-nair May 4, 2022
24651af
SB-29756 | Fix for type case issue
karthik-tarento May 5, 2022
2d2712b
Merge pull request #448 from karthik-tarento/patch-1
reshmi-nair May 5, 2022
232e112
SB-29756 | Fix for content progress read issue
karthik-tarento May 6, 2022
e83b588
Merge pull request #449 from karthik-tarento/patch-2
reshmi-nair May 6, 2022
9c39eba
Merge branch 'master' into local-5.0.0
prasadmoka Jun 22, 2022
e0306d6
Merge pull request #451 from prasadmoka/local-5.0.0
reshmi-nair Jun 22, 2022
9418662
feat:SB-30072- added TextBookTocUtilTest
prasadmoka Jul 5, 2022
fd3f905
feat:SB-30072- added TextBookTocUtilTest
prasadmoka Jul 5, 2022
e4aad16
feat:SB-30072- added TextBookTocUtilTest
prasadmoka Jul 6, 2022
e19c746
feat:LR-124 cassandra multi DC enable changes
prasadmoka Aug 4, 2022
2308b62
fix:LR-124 added logger for multiDC enabling
prasadmoka Aug 5, 2022
381974e
Merge branch 'Sunbird-Lern:release-5.0.0' into release-5.0.0
prasadmoka Aug 5, 2022
903d9fe
fix:LR-124 for checking multipleDC enabling
prasadmoka Aug 5, 2022
19ec927
fix:LR-124 added logger message
prasadmoka Aug 5, 2022
af754da
Merge pull request #1 from prasadmoka/local-5.0.0
prasadmoka Aug 5, 2022
ef1dbe2
Merge pull request #463 from prasadmoka/local-5.0.0
gandham-santhosh Aug 23, 2022
18e005e
Issue #LR-104 feat:CSP related change for sunbird-course-service
prasadmoka Aug 24, 2022
4b5858c
Issue #LR-104 fix:CSP coverage exclusions
prasadmoka Aug 25, 2022
49d1b33
Issue #LR-104 fix:CSP changes ignore few test cases
prasadmoka Aug 25, 2022
db8ca4d
Issue #LR-104 fix:CSP changes few test cases modified
prasadmoka Aug 25, 2022
b6a4611
Issue #LR-104 fix:use generic container for all service providers
prasadmoka Aug 26, 2022
552d12a
Issue #LR-104 fix:CSP coverage exclusions
prasadmoka Aug 26, 2022
780f632
Merge pull request #466 from prasadmoka/local-5.0.0
reshmi-nair Aug 26, 2022
f7c0f39
fix: LR-124 disabling multiple DCs
prasadmoka Sep 6, 2022
9de5b26
fix:LR-124 consistency level changes load test
prasadmoka Sep 6, 2022
3db5333
fix:LR-124 resolving SERIAL consistency
prasadmoka Sep 7, 2022
1333f35
fix:LR-124 for multiDC load test
prasadmoka Sep 7, 2022
1b85f33
Issue #LR-110 feat:added env for csp
Sep 9, 2022
ad048c0
Issue #LR-110 feat:added env for csp
Sep 9, 2022
3a7ac2f
Merge pull request #468 from amit-tarento/LR-110
prasadmoka Sep 9, 2022
3187122
Issue #SB-30930 feat:updated pdata version
Sep 13, 2022
1806ea8
Merge pull request #469 from amit-tarento/SB-30930
reshmi-nair Sep 13, 2022
51a067b
Issue #LR-110 feat: fixed csp connection issue
Sep 23, 2022
8eb7bd9
Merge pull request #470 from amit-tarento/LR-110-v3
reshmi-nair Sep 23, 2022
03b9e23
fix:SB-30068 removed ifExists check
prasadmoka Sep 28, 2022
32070b7
fix:removed unnecessary code
prasadmoka Sep 29, 2022
a9c5aac
Merge pull request #471 from prasadmoka/local-5.0.0
reshmi-nair Sep 29, 2022
56d0dff
Issue #LR-110 feat:upgraded cloud sdk
Oct 10, 2022
cbd7f26
Merge pull request #473 from amit-tarento/LR-v6
reshmi-nair Oct 10, 2022
6b814cd
Merge branch 'Sunbird-Lern:release-5.0.0' into release-5.0.0
prasadmoka Nov 3, 2022
2fd5ad0
Merge pull request #483 from Sunbird-Lern/release-5.0.0
reshmi-nair Nov 4, 2022
2776ce8
LR-265 Cloud Agnostic changes
prasadmoka Nov 7, 2022
b9d0deb
LR-265 Cloud Agnostic changes
prasadmoka Nov 7, 2022
c7c7df8
Merge pull request #484 from prasadmoka/local-5.1.0
reshmi-nair Nov 14, 2022
30ea3e3
feat : add Cname changes
aimansharief Nov 21, 2022
9a358c9
feat : add Cname changes
aimansharief Nov 21, 2022
25704ae
feat : add Cname changes
aimansharief Nov 21, 2022
5ca85de
LR-265 csp template variable changes
prasadmoka Nov 22, 2022
f98ee59
feat : add Cname changes
aimansharief Nov 22, 2022
23131b1
Merge pull request #495 from aimansharief/CNAME-changes
reshmi-nair Nov 22, 2022
252284d
Merge branch 'release-5.0.1' into local-5.1.0
prasadmoka Nov 22, 2022
8dd51b8
Update CourseBatchUtil.java
prasadmoka Nov 22, 2022
9c260e4
LR-265 template variable changes
prasadmoka Nov 23, 2022
739c7ac
LR-265 variable changes
prasadmoka Nov 23, 2022
47c57dc
Merge pull request #496 from prasadmoka/local-5.1.0
reshmi-nair Nov 23, 2022
b8f31d2
LR-262 variable change
prasadmoka Nov 24, 2022
7e552f7
LR-262 variable name update
prasadmoka Nov 24, 2022
3a769cc
Merge pull request #497 from prasadmoka/local-5.1.0
reshmi-nair Nov 24, 2022
7414dae
LR-251 - BatchService-Identity manager should be optional for setup
Nov 25, 2022
a8022f5
Issue #000 | Gloud signed url support changes added
kumarks1122 Nov 27, 2022
4d7564f
Issue #000 | Testcase changes adde
kumarks1122 Nov 29, 2022
c0facf0
Merge pull request #499 from kumarks1122/release-5.0.1-cloud-storage-…
reshmi-nair Nov 30, 2022
9e6e616
Merge pull request #500 from BharathwajShankar/merge-5.0.1
reshmi-nair Nov 30, 2022
7af5d47
LR-251 - BatchService-Identity manager should be optional for setup h…
Dec 5, 2022
fd49853
LR-251 - BatchService-Identity manager should be optional for setup a…
Dec 7, 2022
41ab010
LR-131 Decoupling Unused dependencies
aimansharief Dec 9, 2022
df18df7
Merge pull request #501 from aimansharief/LR-131
reshmi-nair Dec 9, 2022
d04e1e6
Merge pull request #498 from BharathwajShankar/LR-251
reshmi-nair Dec 9, 2022
c29cb12
ED-621:templateUrl placeholder value changed
prasadmoka Dec 26, 2022
fda152b
Merge pull request #502 from prasadmoka/local-5.1.0
reshmi-nair Dec 27, 2022
147fbb9
ED-621 changing telemetry version
BharathwajShankar Jan 6, 2023
00c1176
LR-278 - CLONE - File URL is not having new cname changes fix
BharathwajShankar Jan 9, 2023
b9876d9
LR-278 - CLONE - File URL is not having new cname changes fix in method
BharathwajShankar Jan 9, 2023
210ec50
LR-278 - CLONE - tweaks in the URLs
BharathwajShankar Jan 10, 2023
181a1b1
LR-278 - tweaking the urls
BharathwajShankar Jan 10, 2023
539f854
LR-278 - correcting cname url
BharathwajShankar Jan 10, 2023
deb4fed
LR-278 - correcting the comment and spacing
BharathwajShankar Jan 10, 2023
61bb1f4
LR-278 - fixing errors
BharathwajShankar Jan 10, 2023
412856f
LR-278 - minimizing function calls
BharathwajShankar Jan 10, 2023
41077fc
Merge pull request #504 from BharathwajShankar/LR-278
reshmi-nair Jan 10, 2023
22a5b48
LR-278 added container name to resolve placeholder
prasadmoka Jan 11, 2023
f177b11
LR-278 getBaseUrl to cloud util
prasadmoka Jan 11, 2023
c885c7f
LR_278 added new variables for local setup
prasadmoka Jan 11, 2023
b410f1f
LR-278 removed $ from placeholder
prasadmoka Jan 11, 2023
ffbc72e
LR-278 baseUrl at missing places
prasadmoka Jan 11, 2023
6a7394a
LR-278 removed unnecessary variable
prasadmoka Jan 11, 2023
4dc55f8
Merge pull request #505 from prasadmoka/local-5.1.0
reshmi-nair Jan 11, 2023
70af98f
Merge pull request #503 from BharathwajShankar/release-5.0.1
reshmi-nair Jan 12, 2023
ce0a33d
Merge pull request #506 from Sunbird-Lern/release-5.0.1
reshmi-nair Jan 12, 2023
6cd1fe3
Merge pull request #508 from Sunbird-Lern/master
gandham-santhosh Jan 13, 2023
911bc00
LR-310 - adding extra scenarios for auth enabled
BharathwajShankar Jan 25, 2023
09bb14f
LR-310 - Adding conf file in resource folder for making authenticatio…
BharathwajShankar Jan 25, 2023
06ce406
Merge pull request #509 from BharathwajShankar/LR-310
reshmi-nair Jan 31, 2023
9172014
updating the telemetry version
BharathwajShankar Feb 1, 2023
efc29da
Merge pull request #521 from BharathwajShankar/update_telemetry
reshmi-nair Feb 1, 2023
2a7c5e5
Merge pull request #522 from BharathwajShankar/merge_pr_master
reshmi-nair Feb 1, 2023
6ef73a5
LR-521 Merging Release 5.2.0 to master (#556)
reshmi-nair Apr 12, 2023
99bdf0b
LR-305 - adding yaml files from docs site (#559)
reshmi-nair Apr 14, 2023
8825ba1
LR-583 Merging Release 5.3.0 to master (#572)
reshmi-nair Jun 20, 2023
67d8534
Issue #LR-583 merge: release-5.4.0 to master (#587)
AmiableAnil Oct 27, 2023
b070298
Issue #LR-676 merge: repo name changes from sunbird to sunbird_useror…
BharathwajShankar Nov 10, 2023
d14e96b
Issue #LR-676 chore: Updated the learning-service to content service …
AmiableAnil Jan 25, 2024
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- run:
name: redis
command: sudo apt install redis-server -y
- run: mvn clean install
- run: mvn clean install -DCLOUD_STORE_GROUP_ID=$CLOUD_STORE_GROUP_ID -DCLOUD_STORE_ARTIFACT_ID=$CLOUD_STORE_ARTIFACT_ID -DCLOUD_STORE_VERSION=$CLOUD_STORE_VERSION
- run: cd course-mw/enrolment-actor && mvn scoverage:report
- run: cd course-mw/sunbird-util/cache-utils && mvn scoverage:report
- run: cd service && mvn play2:dist
Expand All @@ -25,7 +25,7 @@ jobs:
name: sonar
command: |
JAVA_REPORT_PATHS=`find /home/circleci/project -iname jacoco.xml | awk 'BEGIN { RS = "" ; FS = "\n"; OFS = ","}{$1=$1; print $0}'`
mvn verify -DskipTests=true sonar:sonar -Dsonar.projectKey=project-sunbird_sunbird-course-service -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.pullrequest.branch=$srcbranch -Dsonar.pullrequest.key=$CIRCLE_PR_NUMBER -Dsonar.pullrequest.base=$tarbranch -Dsonar.scala.coverage.reportPaths=/home/circleci/project/course-mw/enrolment-actor/target/scoverage.xml,/home/circleci/project/course-mw/sunbird-util/cache-utils/target/scoverage.xml -Dsonar.coverage.jacoco.xmlReportPaths=${JAVA_REPORT_PATHS}
mvn verify -DskipTests=true sonar:sonar -Dsonar.projectKey=project-sunbird_sunbird-course-service -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.pullrequest.branch=$srcbranch -Dsonar.pullrequest.key=$CIRCLE_PR_NUMBER -Dsonar.pullrequest.base=$tarbranch -Dsonar.coverage.exclusions=**/sunbird-util/sunbird-platform-core/**,**/course-actors-common/** -Dsonar.scala.coverage.reportPaths=/home/circleci/project/course-mw/enrolment-actor/target/scoverage.xml,/home/circleci/project/course-mw/sunbird-util/cache-utils/target/scoverage.xml -Dsonar.coverage.jacoco.xmlReportPaths=${JAVA_REPORT_PATHS}

workflows:
version: 2.1
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Please describe the tests that you ran to verify your changes in the below check

**Test Configuration**:
* Software versions: Java-11, play2-2.7.2, scala-2.11, redis-5.0.3
* Hardware versions: 2 CPU/ 4GB RAM
* Hardware versions: 2 CPU / 4GB RAM

### Checklist:

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ RUNNING_PID
/.target/
/bin/
/logs
**.vscode
2 changes: 1 addition & 1 deletion Dockerfile.Build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ENV M2_HOME /opt/apache-maven-3.3.9
ENV PATH ${M2_HOME}/bin:${PATH}
COPY learner /opt/learner/
WORKDIR /opt/learner/services
RUN mvn clean install -DskipTests
RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk -DCLOUD_STORE_VERSION=1.4.6
WORKDIR /opt/learner/services/learning-service
CMD ["mvn", "play2:dist"]
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ node('build-slave') {
env.NODE_ENV = "build"
print "Environment will be : ${env.NODE_ENV}"
sh 'git log -1'
sh 'mvn clean install -DskipTests=true '

sh "mvn clean install -DskipTests=true -DCLOUD_STORE_GROUP_ID=${params.cloud_store_group_id} -DCLOUD_STORE_ARTIFACT_ID=${params.cloud_store_artifact_id} -DCLOUD_STORE_VERSION=${params.cloud_store_version}"
}

// stage('Unit Tests') {
Expand Down
257 changes: 257 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,260 @@
This is the repository for Sunbird learning management system (lms) micro-service. It provides the APIs for lms functionality of Sunbird.

The code in this repository is licensed under MIT License unless otherwise noted. Please see the [LICENSE](https://github.com/project-sunbird/sunbird-lms-service/blob/master/LICENSE) file for details.
This readme file describes how to install and start course-service in your developement environment.
## Sunbird-course-service developement environment setup:
This readme file contains the instruction to set up and run the sunbird-course-service in local machine.

### System Requirements

### Prerequisites

- Java 11
- Latest Docker
- Latest Maven
(Only for Mac M1 use 3.8.8 Maven version)

### Prepare folders for database data and logs

To prepare folders for database data and logs, run the following command:

```shell
mkdir -p ~/sunbird-dbs/cassandra ~/sunbird-dbs/es
export sunbird_dbs_path=~/sunbird-dbs
```

To verify the creation of folders, run:

```shell
echo $sunbird_dbs_path
```

### Cassandra database setup in Docker

1. To get the Cassandra image, use the following command:

```shell
docker pull cassandra:3.11.6
```
For Mac M1 users follow the bellow command:
```shell
docker pull --platform=linux/amd64 cassandra:3.11.6
```

For the network, you can either use an existing network or create a new one by executing the following command:
```shell
docker network create sunbird_db_network
```

2. To create the Cassandra instance, run the following command:
```shell
docker run -p 9042:9042 --name sunbird_cassandra \
-v $sunbird_dbs_path/cassandra/data:/var/lib/cassandra \
-v $sunbird_dbs_path/cassandra/logs:/opt/cassandra/logs \
-v $sunbird_dbs_path/cassandra/backups:/mnt/backups \
--network sunbird_db_network -d cassandra:3.11.6
```


For Mac M1 users follow the below command:
```shell
docker run --platform=linux/amd64 -p 9042:9042 --name sunbird_cassandra \
-v $sunbird_dbs_path/cassandra/data:/var/lib/cassandra \
-v $sunbird_dbs_path/cassandra/logs:/opt/cassandra/logs \
-v $sunbird_dbs_path/cassandra/backups:/mnt/backups \
--network sunbird_db_network -d cassandra:3.11.6
```

3. To verify the setup, run the following command, which will show the status of Cassandra as up and running:

```shell
docker ps -a | grep cassandra
```

## To create/load keyspaces and tables to Cassandra

Click the link [sunbird-utils-cassandra-setup](https://github.com/Sunbird-Lern/sunbird-utils/tree/release-5.3.0#readme)
and follow the steps for creating/loading the Cassandra keyspaces and tables to your development environment.

Note: It is mandatory to follow the instructions provided in the link.

4. To verify the creation of keyspaces and tables, connect to the Cassandra Docker container using SSH and run the following command:

```shell
docker exec -it sunbird_cassandra /bin/bash
```

## Setting up Elastic Search in Docker

To set up Elastic Search in Docker, follow the below steps:

1. Obtain the Elastic Search image by executing the following command:

```shell
docker pull elasticsearch:6.8.11
```

For Mac M1 users follow the bellow command:
```shell
docker pull --platform=linux/amd64 elasticsearch:6.8.11
```

2. Create an Elastic Search instance by executing the following command to run it in a container:
```shell
docker run -p 9200:9200 --name sunbird_es -v
$sunbird_dbs_path/es/data:/usr/share/elasticsearch/data -v
$sunbird_dbs_path/es/logs://usr/share/elasticsearch/logs -v
$sunbird_dbs_path/es/backups:/opt/elasticsearch/backup
-e "discovery.type=single-node" --network sunbird_db_network
-d docker.elastic.co/elasticsearch/elasticsearch:6.8.11
```
For Mac M1 users follow the bellow command::
```shell
docker run --platform=linux/amd64 -p 9200:9200 --name sunbird_es -v
$sunbird_dbs_path/es/data:/usr/share/elasticsearch/data -v
$sunbird_dbs_path/es/logs://usr/share/elasticsearch/logs -v
$sunbird_dbs_path/es/backups:/opt/elasticsearch/backup
-e "discovery.type=single-node" --network sunbird_db_network
-d docker.elastic.co/elasticsearch/elasticsearch:6.8.11
```

The above command performs the following actions:
- "-p 9200:9200" maps the host's port 9200 to the container's port 9200, allowing access to the Elasticsearch API.
- "--name <container_name>" assigns a name to the container, which can be used to reference it in other Docker commands.
- "-v <host_directory_path>/es/data:/usr/share/elasticsearch/data" mounts the host's directory "<host_directory_path>/es/data" as the Elasticsearch data directory inside the container.
- "-v <host_directory_path>/es/logs://usr/share/elasticsearch/logs" mounts the host's directory "<host_directory_path>/es/logs" as the Elasticsearch logs directory inside the container.
- "-v <host_directory_path>/es/backups:/opt/elasticsearch/backup" mounts the host's directory "<host_directory_path>/es/backups" as the Elasticsearch backups directory inside the container.
- "-e "discovery.type=single-node"" sets an environment variable "discovery.type" with the value "single-node", which tells Elasticsearch to start as a single-node cluster.
- "--network <network_name>" assigns the container to a Docker network, which is used to connect the container to other containers in the same network.
- "-d" runs the container in detached mode, which allows it to run in the background.

To verify the setup, execute the following command. It will display the elastic search status as up and running.
```shell
docker ps -a | grep es
```

If you are using an Ubuntu system, perform the following step to ensure that the necessary permissions are created for the folder:
```shell
chmod -R 777 sunbird-dbs/es
```
### elastic search Indices and mappings setup

Create indices for,
To create indices, follow these steps:

1. Copy the JSON content of the index from the provided link below for each index.
2. Replace `<indices_name>` with the name of the index for which you want to create the mapping.
3. Replace `<respective_index_json_content>` with the JSON content you copied in step 1.

Use the following api to create each index:

```
PUT {{es_host}}/<indices_name>
Body : <respective_index_json_content>
```

Here's an example curl command for creating the `course-batch` index:

```
curl --location --request PUT 'localhost:9200/course-batch' \
--header 'Content-Type: application/json' \
--data '<course-batch_json_content>'
```

Make sure to replace `course-batch_json_content` with the name of the index JSON file for the corresponding index.

Here's the list of indices to create and their corresponding links:
- [Course-batch](https://github.com/project-sunbird/sunbird-devops/blob/release-5.3.0-lern/ansible/roles/es-mapping/files/indices/course-batch.json)

To create mappings for the listed indices, follow these steps:

1. Copy the JSON content of the mapping from the provided link for each index.
2. Replace `<indices_name>` with the name of the index for which you want to create the mapping.
3. Replace `<respective_mapping_json_content>` with the JSON content you copied in step 1.

Use the following api to create each mapping:

```
PUT {{es_host}}/<indices_name>/_mapping/_doc
Body: <respective_mapping_json_content>
```

Here's an example curl command for creating the mapping for the `course-batch` index:

```
curl --location --request PUT 'localhost:9200/course-batch/_mapping/_doc' \
--header 'Content-Type: application/json' \
--data '<course-batch_mapping_json_content>'
```

Make sure to replace `<course-batch_mapping_json_content>` with the name of the mapping JSON file for the corresponding index.

Here's the list of mappings to create and their corresponding links:

- [Course-batch](https://github.com/project-sunbird/sunbird-devops/blob/release-5.3.0-lern/ansible/roles/es-mapping/files/mappings/course-batch-mapping.json)

## Setting up Redis in Docker:

To set up Redis database in Docker, please follow the below steps:

1. Pull the Redis image from Docker Hub using the following command:
```shell
docker pull redis:4.0.0
```
2. Create a Redis instance by running it in a container with the following command:
```shell
docker run --name sunbird_redis -d -p 6379:6379 redis:4.0.0
```
3. To verify the Redis setup, run the following command to SSH into the Redis Docker container:
```shell
docker exec -it sunbird_redis bash
```

To set up Redis database in Docker for Mac M1, please follow the below steps:

1. Pull the Redis image from Docker Hub using the following command:
```shell
docker pull --platform=linux/amd64 redis:5.0.7
```
2. Create a Redis instance by running it in a container with the following command:
```shell
docker run --platform=linux/amd64 --name sunbird_redis -d -p 6379:6379 redis:5.0.7
```
3. To verify the Redis setup, run the following command to SSH into the Redis Docker container:
```shell
docker exec -it sunbird_redis bash
```
## Sunbird-course-service Setup

To set up the batch service, follow the steps below:

1. Clone the latest branch of the course service using the following command:
```shell
git clone https://github.com/Sunbird-Lern/sunbird-course-service.git
```

2. Set up the necessary environment variables by running the following script in the path `<project-base-path>/sunbird-course-service`:
```shell
./scripts/lms-config.sh
```

3. Build the application using the following maven command in the path `<project-base-path>/sunbird-course-service`:
```shell
mvn clean install -DskipTests
```
Make sure the build is successful before proceeding to the next step. If the build is not successful,
fix any configuration issues and rebuild the application.

4. Run the netty server using the following maven command in the path `<project-base-path>/sunbird-course-service/service`:
```shell
mvn play2:run
```

5. Verify the database connections by running the following command:
```shell
curl --location --request GET 'http://localhost:9000/health’
```
If all connections are established successfully, the health status will be shown as 'true', otherwise it will be 'false'.

Currently, the lms service is dependent on content read API for batch creation and User org service for getting user and organisation information.
We are planning to implement a mock service soon for these dependencies.
Loading