Skip to content

Commit

Permalink
Merge branch 'release-2.6.0' into read-api
Browse files Browse the repository at this point in the history
  • Loading branch information
rheafernandes committed Nov 14, 2019
2 parents 291bc59 + d48ec8a commit f1dcaab
Show file tree
Hide file tree
Showing 23 changed files with 179 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
**/target/**
**/.idea/**
*.iml
**/*.iml
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openjdk:8-jre-alpine
RUN apk update \
&& apk add unzip \
&& apk add curl \
&& adduser -u 1001 -h /home/sunbird/ -D sunbird \
&& mkdir -p /home/sunbird
RUN chown -R sunbird:sunbird /home/sunbird
USER sunbird
COPY ./learning-api/learning-service/target/learning-service-1.0-SNAPSHOT-dist.zip /home/sunbird/
RUN unzip /home/sunbird/learning-service-1.0-SNAPSHOT-dist.zip -d /home/sunbird/
RUN rm /home/sunbird/learning-service-1.0-SNAPSHOT-dist.zip
WORKDIR /home/sunbird/
CMD java -cp '/home/sunbird/learning-service-1.0-SNAPSHOT/lib/*' play.core.server.ProdServerStart /home/sunbird/learning-service-1.0-SNAPSHOT
56 changes: 56 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
node('build-slave') {
try {
String ANSI_GREEN = "\u001B[32m"
String ANSI_NORMAL = "\u001B[0m"
String ANSI_BOLD = "\u001B[1m"
String ANSI_RED = "\u001B[31m"
String ANSI_YELLOW = "\u001B[33m"

ansiColor('xterm') {
stage('Checkout') {
if (!env.hub_org) {
println(ANSI_BOLD + ANSI_RED + "Uh Oh! Please set a Jenkins environment variable named hub_org with value as registery/sunbidrded" + ANSI_NORMAL)
error 'Please resolve the errors and rerun..'
} else
println(ANSI_BOLD + ANSI_GREEN + "Found environment variable named hub_org with value as: " + hub_org + ANSI_NORMAL)
}
cleanWs()
if (params.github_release_tag == "") {
checkout scm
commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
branch_name = sh(script: 'git name-rev --name-only HEAD | rev | cut -d "/" -f1| rev', returnStdout: true).trim()
build_tag = branch_name + "_" + commit_hash
println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag not specified, using the latest commit hash: " + commit_hash + ANSI_NORMAL)
} else {
def scmVars = checkout scm
checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/$params.github_release_tag"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]]
build_tag = params.github_release_tag
println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag specified, building from tag: " + params.github_release_tag + ANSI_NORMAL)
}
echo "build_tag: " + build_tag

stage('Build') {
env.NODE_ENV = "build"
print "Environment will be : ${env.NODE_ENV}"
sh 'mvn clean install -DskipTests=true '

}

stage('Package') {
dir('learning-api') {
sh 'mvn play2:dist -pl learning-service'
}
sh('chmod 777 ./build.sh')
sh("./build.sh ${build_tag} ${env.NODE_NAME} ${hub_org}")
}
stage('ArchiveArtifacts') {
archiveArtifacts "metadata.json"
currentBuild.description = "${build_tag}"
}
}
}
catch (err) {
currentBuild.result = "FAILURE"
throw err
}
}
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Build script
set -eo pipefail

build_tag=$1
name=learning-service
node=$2
org=$3

docker build -f ./Dockerfile --label commitHash=$(git rev-parse --short HEAD) -t ${org}/${name}:${build_tag} .
echo {\"image_name\" : \"${name}\", \"image_tag\" : \"${build_tag}\", \"node_name\" : \"$node\"} > metadata.json
53 changes: 0 additions & 53 deletions learning-api/learning-manager/conf/logback.xml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -271,209 +271,4 @@ play.filters {
}
}

# Learning-Service Configuration
content.metadata.visibility.parent=["textbookunit", "courseunit", "lessonplanunit"]

# Cassandra Configuration
content.keyspace.name=content_store
content.keyspace.table=content_data
#TODO: Add Configuration for assessment. e.g: question_data
orchestrator.keyspace.name=script_store
orchestrator.keyspace.table=script_data
cassandra.lp.connection="127.0.0.1:9042,127.0.0.2:9042,127.0.0.3:9042"
cassandra.lpa.connection="127.0.0.1:9042,127.0.0.2:9042,127.0.0.3:9042"

# Redis Configuration
redis.host=localhost
redis.port=6379
redis.maxConnections=128

#Condition to enable publish locally
content.publish_task.enabled=true

#directory location where store unzip file
dist.directory=/data/tmp/dist/
output.zipfile=/data/tmp/story.zip
source.folder=/data/tmp/temp2/
save.directory=/data/tmp/temp/

# Content 2 vec analytics URL
CONTENT_TO_VEC_URL="http://172.31.27.233:9000/content-to-vec"

# FOR CONTENT WORKFLOW PIPELINE (CWP)

#--Content Workflow Pipeline Mode
OPERATION_MODE=TEST

#--Maximum Content Package File Size Limit in Bytes (50 MB)
MAX_CONTENT_PACKAGE_FILE_SIZE_LIMIT=52428800

#--Maximum Asset File Size Limit in Bytes (20 MB)
MAX_ASSET_FILE_SIZE_LIMIT=20971520

#--No of Retry While File Download Fails
RETRY_ASSET_DOWNLOAD_COUNT=1

#Google-vision-API
google.vision.tagging.enabled = false

#Orchestrator env properties
env="https://dev.ekstep.in/api/learning"

#Current environment
cloud_storage.env=dev


#Folder configuration
cloud_storage.content.folder=content
cloud_storage.asset.folder=assets
cloud_storage.artefact.folder=artifact
cloud_storage.bundle.folder=bundle
cloud_storage.media.folder=media
cloud_storage.ecar.folder=ecar_files

# Media download configuration
content.media.base.url="https://dev.open-sunbird.org"
plugin.media.base.url="https://dev.open-sunbird.org"

# Configuration
graph.dir=/data/graphDB
akka.request_timeout=30
environment.id=10000000
graph.ids=["domain"]
graph.passport.key.base=31b6fd1c4d64e745c867e61a45edc34a
route.domain="bolt://localhost:7687"
route.bolt.write.domain="bolt://localhost:7687"
route.bolt.read.domain="bolt://localhost:7687"
route.bolt.comment.domain="bolt://localhost:7687"
route.all="bolt://localhost:7687"
route.bolt.write.all="bolt://localhost:7687"
route.bolt.read.all="bolt://localhost:7687"
route.bolt.comment.all="bolt://localhost:7687"

shard.id=1
platform.auth.check.enabled=false
platform.cache.ttl=3600000

# Elasticsearch properties
search.es_conn_info="localhost:9200"
search.fields.query=["name^100","title^100","lemma^100","code^100","tags^100","domain","subject","description^10","keywords^25","ageGroup^10","filter^10","theme^10","genre^10","objects^25","contentType^100","language^200","teachingMode^25","skills^10","learningObjective^10","curriculum^100","gradeLevel^100","developer^100","attributions^10","owner^50","text","words","releaseNotes"]
search.fields.date=["lastUpdatedOn","createdOn","versionDate","lastSubmittedOn","lastPublishedOn"]
search.batch.size=500
search.connection.timeout=30
platform-api-url="http://localhost:8080/language-service"
MAX_ITERATION_COUNT_FOR_SAMZA_JOB=2


# DIAL Code Configuration
dialcode.keyspace.name="dialcode_store"
dialcode.keyspace.table="dial_code"
dialcode.max_count=1000

# System Configuration
system.config.keyspace.name="dialcode_store"
system.config.table="system_config"

#Publisher Configuration
publisher.keyspace.name="dialcode_store"
publisher.keyspace.table="publisher"

#DIAL Code Generator Configuration
dialcode.strip.chars="0"
dialcode.length=6.0
dialcode.large.prime_number=1679979167

#DIAL Code ElasticSearch Configuration
dialcode.index=true
dialcode.object_type="DialCode"

framework.max_term_creation_limit=200

# Enable Suggested Framework in Get Channel API.
channel.fetch.suggested_frameworks=true

# Kafka configuration details
kafka.topics.instruction="local.learning.job.request"
kafka.urls="localhost:9092"

#Youtube Standard Licence Validation
learning.content.youtube.validate.license=true
learning.content.youtube.application.name=fetch-youtube-license
youtube.license.regex.pattern=["\\?vi?=([^&]*)", "watch\\?.*v=([^&]*)", "(?:embed|vi?)/([^/?]*)","^([A-Za-z0-9\\-\\_]*)"]

#Top N Config for Search Telemetry
telemetry_env=dev
telemetry.search.topn=5

installation.id=ekstep

learning.content.copy.invalid_status_list=["Flagged","FlaggedDraft","FraggedReview","Retired", "Processing"]
learning.content.copy.props_to_remove=["downloadUrl", "artifactUrl", "variants",
"createdOn", "collections", "children", "lastUpdatedOn", "SYS_INTERNAL_LAST_UPDATED_ON",
"versionKey", "s3Key", "status", "pkgVersion", "toc_url", "mimeTypesCount",
"contentTypesCount", "leafNodesCount", "childNodes", "prevState", "lastPublishedOn",
"flagReasons", "compatibilityLevel", "size", "publishChecklist", "publishComment",
"LastPublishedBy", "rejectReasons", "rejectComment", "gradeLevel", "subject",
"medium", "board", "topic", "purpose", "subtopic", "contentCredits",
"owner", "collaborators", "creators", "contributors", "badgeAssertions", "dialcodes",
"concepts", "keywords", "reservedDialcodes", "dialcodeRequired", "leafNodes"]

# Metadata to be added to copied content from origin
learning.content.copy.origin_data=["name", "author", "license", "organisation"]

learning.content.type.not.copied.list=["Asset"]

channel.default="in.ekstep"

# DialCode Link API Config
learning.content.link_dialcode_validation=true
dialcode.api.search.url="http://localhost:8080/learning-service/v3/dialcode/search"
dialcode.api.authorization=auth_key

# Language-Code Configuration
language.graph_ids=["as","bn","en","gu","hi","hoc","jun","ka","mai","mr","unx","or","san","sat","ta","te","urd", "pj"]

# Kafka send event to topic enable
kafka.topic.send.enable=false

learning.valid_license=["creativeCommon"]
learning.service_provider=["youtube"]

stream.mime.type=video/mp4
compositesearch.index.name="compositesearch"

hierarchy.keyspace.name=hierarchy_store
content.hierarchy.table=content_hierarchy
framework.hierarchy.table=framework_hierarchy

# Kafka topic for definition update event.
kafka.topic.system.command="dev.system.command"

learning.reserve_dialcode.content_type=["TextBook"]
# restrict.metadata.objectTypes=["Content", "ContentImage", "AssessmentItem", "Channel", "Framework", "Category", "CategoryInstance", "Term"]

#restrict.metadata.objectTypes="Content,ContentImage"

publish.collection.fullecar.disable=true

# Consistency Level for Multi Node Cassandra cluster
cassandra.lp.consistency.level=QUORUM


content.tagging.backward_enable=true
content.tagging.property="subject,medium"

content.nested.fields="badgeAssertions,targets,badgeAssociations"

content.cache.ttl=86400
content.cache.read=true
content.cache.hierarchy=true
content.discard.status=["Draft","FlagDraft"]

framework.categories_cached=["subject", "medium", "gradeLevel", "board"]
framework.cache.ttl=86400
framework.cache.read=true


# Max size(width/height) of thumbnail in pixels
max.thumbnail.size.pixels=150
28 changes: 28 additions & 0 deletions learning-api/learning-service/conf/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<configuration>

<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />

<!-- transaction-event-trigger START -->
<timestamp key="timestamp" datePattern="yyyy-MM-dd"/>
<!-- common transactions logs -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %msg%n</pattern>
</encoder>
</appender>

<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>


<logger name="play" level="INFO" />
<logger name="DefaultPlatformLogger" level="INFO" />
<!-- Telemetry Loggers-->
<logger name="TelemetryEventLogger" level="INFO" />

<root level="INFO">
<appender-ref ref="ASYNCSTDOUT" />
</root>

</configuration>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>learning-manager</artifactId>
<name>learning-manager</name>
<artifactId>learning-service</artifactId>
<name>learning-service</name>
<packaging>play2</packaging>
<parent>
<groupId>org.sunbird</groupId>
Expand Down
Loading

0 comments on commit f1dcaab

Please sign in to comment.