Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cbrelease 4.8.12 sl dev #89

Open
wants to merge 49 commits into
base: cbrelease-4.8.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6955dd3
reverting shikshalokam changes
shishirsuman092 Apr 1, 2024
f569101
added the missing / in report path
varshamahuli97 Apr 1, 2024
f934026
updated storage path and added druid & mongo ip's
Apr 2, 2024
d888404
query mongo for report config
Apr 2, 2024
17ba09b
Testing in new branch
Apr 3, 2024
24c6d46
added a default value to includeExpiredSolutionIDs in dashboradUtil
Apr 4, 2024
0f4c867
uncommented code in QuestionReportModel and StatusReportModel
Apr 4, 2024
940b1d9
println to check mongo issue
Apr 4, 2024
1cee24a
changes to println
Apr 4, 2024
9391250
code clean up
Apr 4, 2024
6c856db
Merge pull request #85 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 4, 2024
a6a9002
fix for multiple evidences in a cell
Apr 5, 2024
f1bcd3d
fix for zip file inside another zip file
Apr 5, 2024
bbbe619
Merge pull request #86 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 8, 2024
a87cb40
fix for .crc files in folder after unzip
Apr 8, 2024
373740d
Merge branch 'sunbird-cb:cbrelease-4.8.12-sl-dev' into cbrelease-4.8.…
Vivek-M-08 Apr 10, 2024
5441cfe
Merge remote-tracking branch 'upstream/cbrelease-4.8.12-sl-dev' into …
Apr 10, 2024
d2a9465
fix for crc files
Vivek-M-08 Apr 10, 2024
e4cfac3
Merge pull request #87 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 10, 2024
159835f
Merge remote-tracking branch 'upstream/cbrelease-4.8.12-sl-dev' into …
Apr 15, 2024
9c3aa0f
fix for missing csv's
Apr 15, 2024
0914249
Merge pull request #88 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 15, 2024
3df045a
Merge branch 'cbrelease-4.8.12' into cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 15, 2024
f8bc837
updated fix for missing csv's
Apr 15, 2024
a9731fd
Merge pull request #90 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 15, 2024
eb7c62c
updated fix for survey status missing csv's
Apr 15, 2024
1f3ac3f
Merge branch 'sunbird-cb:cbrelease-4.8.12-sl-dev' into cbrelease-4.8.…
Vivek-M-08 Apr 15, 2024
d05aaf3
Merge pull request #91 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 16, 2024
6d81bf1
modifying all date fields to datetimein warehouse
varshamahuli97 Apr 16, 2024
10d48e1
Merge branch 'cbrelease-4.8.12-sl-dev' of https://github.com/sunbird-…
varshamahuli97 Apr 16, 2024
6d7a3c8
date to datetime fix in warehouse fields
varshamahuli97 Apr 16, 2024
aef3ad6
date to datetime fix
varshamahuli97 Apr 16, 2024
1d1aa83
date to datetime fix
varshamahuli97 Apr 16, 2024
44edd67
date to datetime fix
varshamahuli97 Apr 16, 2024
3dfd13a
date to datetime fix
varshamahuli97 Apr 16, 2024
4db36c3
date to datetime fix
varshamahuli97 Apr 16, 2024
006aadc
date to datetime fix
varshamahuli97 Apr 17, 2024
269de95
date to datetime fix
varshamahuli97 Apr 17, 2024
3727594
date to datetime fix
varshamahuli97 Apr 17, 2024
13f3fc8
date to datetime fix and
varshamahuli97 Apr 17, 2024
bcfda50
date to datetime fix and user and user_enrolment modifications
varshamahuli97 Apr 17, 2024
542eef3
added a new observation question report spark job
Apr 17, 2024
97715ad
Merge pull request #92 from Vivek-M-08/cbrelease-4.8.12-sl-dev
mathewjpallan Apr 18, 2024
c3e88e6
date to datetime fix - 1
varshamahuli97 Apr 19, 2024
9252146
Merge branch 'cbrelease-4.8.12-sl-dev' of https://github.com/sunbird-…
varshamahuli97 Apr 19, 2024
8ea4da4
data to datetime fix - final
varshamahuli97 Apr 19, 2024
956844e
date--datetime fix - uniform date formats across all the warehouse ta…
varshamahuli97 Apr 23, 2024
174d0ef
added a new observation status report spark job
Apr 23, 2024
1f53f22
Merge pull request #93 from Vivek-M-08/cbrelease-4.8.12-sl-dev
shishirsuman092 Apr 24, 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
Original file line number Diff line number Diff line change
Expand Up @@ -35,132 +35,131 @@ case class DummyInput(timestamp: Long) extends AlgoInput // no input, there are
case class DummyOutput() extends Output with AlgoOutput // no output as we take care of kafka dispatches ourself

case class DashboardConfig (
debug: String,
validation: String,
// kafka connection config
broker: String,
compression: String,
// redis connection config
redisHost: String,
redisPort: Int,
redisDB: Int,
// for blob storage
store: String,
container: String,
key: String,
secret: String,
// other hosts connection config
sparkCassandraConnectionHost: String, sparkDruidRouterHost: String,
sparkElasticsearchConnectionHost: String, fracBackendHost: String,
sparkMongoConnectionHost: String, mlSparkDruidRouterHost: String,
mlSparkMongoConnectionHost: String,
// kafka topics
roleUserCountTopic: String, orgRoleUserCountTopic: String,
allCourseTopic: String, userCourseProgramProgressTopic: String,
fracCompetencyTopic: String, courseCompetencyTopic: String, expectedCompetencyTopic: String,
declaredCompetencyTopic: String, competencyGapTopic: String, userOrgTopic: String, orgTopic: String,
userAssessmentTopic: String, assessmentTopic: String, acbpEnrolmentTopic: String,
// cassandra key spaces
cassandraUserKeyspace: String,
cassandraCourseKeyspace: String, cassandraHierarchyStoreKeyspace: String,
cassandraUserFeedKeyspace: String,
// cassandra table details
cassandraUserTable: String, cassandraUserRolesTable: String, cassandraOrgTable: String,
cassandraUserEnrolmentsTable: String, cassandraContentHierarchyTable: String,
cassandraRatingSummaryTable: String, cassandraUserAssessmentTable: String,
cassandraRatingsTable: String, cassandraOrgHierarchyTable: String,
cassandraUserFeedTable: String, cassandraAcbpTable: String,
cassandraCourseBatchTable: String,
cassandraLearnerStatsTable: String,
cassandraKarmaPointsTable: String,
cassandraHallOfFameTable: String,
cassandraKarmaPointsLookupTable: String,
cassandraKarmaPointsSummaryTable: String,
cassandraLearnerLeaderBoardTable: String,
cassandraLearnerLeaderBoardLookupTable: String,

//warehouse tables;
appPostgresHost: String,
appPostgresSchema: String,
appPostgresUsername: String,
appPostgresCredential: String,
appOrgHierarchyTable: String,
dwPostgresHost: String,
dwPostgresSchema: String,
dwPostgresUsername: String,
dwPostgresCredential: String,
dwUserTable: String,
dwCourseTable: String,
dwEnrollmentsTable: String,
dwOrgTable: String,
dwAssessmentTable: String,
dwBPEnrollmentsTable: String,
dwKcmDictionaryTable: String,
dwKcmContentTable: String,
dwCBPlanTable: String,
postgresCompetencyTable: String,
postgresCompetencyHierarchyTable: String,

// redis keys
redisRegisteredOfficerCountKey: String, redisTotalOfficerCountKey: String, redisOrgNameKey: String,
redisTotalRegisteredOfficerCountKey: String, redisTotalOrgCountKey: String,
redisExpectedUserCompetencyCount: String, redisDeclaredUserCompetencyCount: String,
redisUserCompetencyDeclarationRate: String, redisOrgCompetencyDeclarationRate: String,
redisUserCompetencyGapCount: String, redisUserCourseEnrolmentCount: String,
redisUserCompetencyGapEnrolmentRate: String, redisOrgCompetencyGapEnrolmentRate: String,
redisUserCourseCompletionCount: String, redisUserCompetencyGapClosedCount: String,
redisUserCompetencyGapClosedRate: String, redisOrgCompetencyGapClosedRate: String,

// mongoDB configurations
mongoDBCollection: String,
mongoDatabase: String,
platformRatingSurveyId: String,

// for reports
mdoIDs: String,
localReportDir: String,
standaloneAssessmentReportPath: String,
userReportPath: String,
userEnrolmentReportPath: String,
courseReportPath: String,
taggedUsersPath: String,
cbaReportPath: String,
blendedReportPath: String,
orgHierarchyReportPath: String,
commsConsoleReportPath: String,
acbpReportPath: String,
acbpMdoEnrolmentReportPath: String,
acbpMdoSummaryReportPath: String,
kcmReportPath: String,

commsConsolePrarambhEmailSuffix: String,
commsConsoleNumDaysToConsider: Int,
commsConsoleNumTopLearnersToConsider: Int,
commsConsolePrarambhTags: String,
commsConsolePrarambhNCount: Int,
commsConsolePrarambhCbpIds: String,

//ml report config
gracePeriod: String,
solutionIDs: String,
baseUrlForEvidences: String,
mlMongoDatabase: String,
surveyCollection: String,
mlReportPath: String,
surveyQuestionReportColumnsConfig: String,
surveyStatusReportColumnsConfig: String,
includeExpiredSolutionIDs: Boolean,


prefixDirectoryPath: String,
destinationDirectoryPath: String,
directoriesToSelect: String,
password: String,
// for weekly claps
cutoffTime: Float,
// to enable/disable report sync
reportSyncEnable: Boolean
) extends Serializable
debug: String,
validation: String,
// kafka connection config
broker: String,
compression: String,
// redis connection config
redisHost: String,
redisPort: Int,
redisDB: Int,
// for blob storage
store: String,
container: String,
key: String,
secret: String,
// other hosts connection config
sparkCassandraConnectionHost: String, sparkDruidRouterHost: String,
sparkElasticsearchConnectionHost: String, fracBackendHost: String,
sparkMongoConnectionHost: String, mlSparkDruidRouterHost: String,
mlSparkMongoConnectionHost: String,
// kafka topics
roleUserCountTopic: String, orgRoleUserCountTopic: String,
allCourseTopic: String, userCourseProgramProgressTopic: String,
fracCompetencyTopic: String, courseCompetencyTopic: String, expectedCompetencyTopic: String,
declaredCompetencyTopic: String, competencyGapTopic: String, userOrgTopic: String, orgTopic: String,
userAssessmentTopic: String, assessmentTopic: String, acbpEnrolmentTopic: String,
// cassandra key spaces
cassandraUserKeyspace: String,
cassandraCourseKeyspace: String, cassandraHierarchyStoreKeyspace: String,
cassandraUserFeedKeyspace: String,
// cassandra table details
cassandraUserTable: String, cassandraUserRolesTable: String, cassandraOrgTable: String,
cassandraUserEnrolmentsTable: String, cassandraContentHierarchyTable: String,
cassandraRatingSummaryTable: String, cassandraUserAssessmentTable: String,
cassandraRatingsTable: String, cassandraOrgHierarchyTable: String,
cassandraUserFeedTable: String, cassandraAcbpTable: String,
cassandraCourseBatchTable: String,
cassandraLearnerStatsTable: String,
cassandraKarmaPointsTable: String,
cassandraHallOfFameTable: String,
cassandraKarmaPointsLookupTable: String,
cassandraKarmaPointsSummaryTable: String,
cassandraLearnerLeaderBoardTable: String,
cassandraLearnerLeaderBoardLookupTable: String,

//warehouse tables;
appPostgresHost: String,
appPostgresSchema: String,
appPostgresUsername: String,
appPostgresCredential: String,
appOrgHierarchyTable: String,
dwPostgresHost: String,
dwPostgresSchema: String,
dwPostgresUsername: String,
dwPostgresCredential: String,
dwUserTable: String,
dwCourseTable: String,
dwEnrollmentsTable: String,
dwOrgTable: String,
dwAssessmentTable: String,
dwBPEnrollmentsTable: String,
dwKcmDictionaryTable: String,
dwKcmContentTable: String,
dwCBPlanTable: String,
postgresCompetencyTable: String,
postgresCompetencyHierarchyTable: String,

// redis keys
redisRegisteredOfficerCountKey: String, redisTotalOfficerCountKey: String, redisOrgNameKey: String,
redisTotalRegisteredOfficerCountKey: String, redisTotalOrgCountKey: String,
redisExpectedUserCompetencyCount: String, redisDeclaredUserCompetencyCount: String,
redisUserCompetencyDeclarationRate: String, redisOrgCompetencyDeclarationRate: String,
redisUserCompetencyGapCount: String, redisUserCourseEnrolmentCount: String,
redisUserCompetencyGapEnrolmentRate: String, redisOrgCompetencyGapEnrolmentRate: String,
redisUserCourseCompletionCount: String, redisUserCompetencyGapClosedCount: String,
redisUserCompetencyGapClosedRate: String, redisOrgCompetencyGapClosedRate: String,

// mongoDB configurations
mongoDBCollection: String,
mongoDatabase: String,
platformRatingSurveyId: String,

// for reports
mdoIDs: String,
localReportDir: String,
standaloneAssessmentReportPath: String,
userReportPath: String,
userEnrolmentReportPath: String,
courseReportPath: String,
taggedUsersPath: String,
cbaReportPath: String,
blendedReportPath: String,
orgHierarchyReportPath: String,
commsConsoleReportPath: String,
acbpReportPath: String,
acbpMdoEnrolmentReportPath: String,
acbpMdoSummaryReportPath: String,
kcmReportPath: String,

commsConsolePrarambhEmailSuffix: String,
commsConsoleNumDaysToConsider: Int,
commsConsoleNumTopLearnersToConsider: Int,
commsConsolePrarambhTags: String,
commsConsolePrarambhNCount: Int,
commsConsolePrarambhCbpIds: String,

//ml report config
gracePeriod: String,
solutionIDs: String,
baseUrlForEvidences: String,
mlMongoDatabase: String,
surveyCollection: String,
reportConfigCollection: String,
mlReportPath: String,
includeExpiredSolutionIDs: Boolean,


prefixDirectoryPath: String,
destinationDirectoryPath: String,
directoriesToSelect: String,
password: String,
// for weekly claps
cutoffTime: Float,
// to enable/disable report sync
reportSyncEnable: Boolean
) extends Serializable

object DashboardConfigParser extends Serializable {
/* Config functions */
Expand Down Expand Up @@ -309,10 +308,10 @@ object DashboardConfigParser extends Serializable {
baseUrlForEvidences = getConfigModelParam(config, "baseUrlForEvidences"),
mlMongoDatabase = getConfigModelParam(config, "mlMongoDatabase"),
surveyCollection = getConfigModelParam(config, "surveyCollection"),
reportConfigCollection = getConfigModelParam(config, "reportConfigCollection"),
mlReportPath = getConfigModelParam(config, "mlReportPath"),
surveyQuestionReportColumnsConfig = getConfigModelParam(config, "surveyQuestionReportColumnsConfig"),
surveyStatusReportColumnsConfig = getConfigModelParam(config, "surveyStatusReportColumnsConfig"),
includeExpiredSolutionIDs = getConfigModelParam(config, "includeExpiredSolutionIDs").toBoolean,
includeExpiredSolutionIDs = getConfigModelParam(config, "includeExpiredSolutionIDs", "true").toBoolean,


// comms-console
commsConsolePrarambhEmailSuffix = getConfigModelParam(config, "commsConsolePrarambhEmailSuffix", "[email protected]"),
Expand Down Expand Up @@ -802,6 +801,22 @@ object DashboardUtil extends Serializable {
filteredDf
}

def mongodbReportConfigAsString(url: String, mongoDatabase: String, collection: String, filter: String)(implicit spark: SparkSession): String = {
val schema = new StructType()
.add("report", StringType, true)
.add("config", StringType, true)
val df = spark.read.schema(schema)
.format("com.mongodb.spark.sql.DefaultSource")
.option("uri", url)
.option("database", mongoDatabase)
.option("collection", collection)
.load()
val filteredDf = df.filter(col("report") === filter)
val configAsString = filteredDf.select("config").first().getString(0)
println(s"Report config for $filter \n " + configAsString)
configAsString
}

def writeToCassandra(data: DataFrame, keyspace: String, table: String)(implicit spark: SparkSession): Unit = {
data.write.format("org.apache.spark.sql.cassandra")
.mode("append")
Expand Down Expand Up @@ -1205,4 +1220,4 @@ object Redis extends Serializable {
dispatch(redisKey, df.toMap[T](keyField, valueField), replace)
}

}
}
Loading