From d006747f9159c53bbd174973e64040486d1c6d9b Mon Sep 17 00:00:00 2001 From: Amit Priyadarshi Date: Thu, 22 Feb 2024 17:46:29 +0530 Subject: [PATCH 1/4] CO-748: metrics-data-transformer job migration from knowlg to coKreat (#3965) --- .../jobs/CoKreatFlinkJob/config.xml | 120 +++++++++++++ .../jobs/CoKreatFlinkJob/config.xml | 108 +++++++++++ .../jobs/CoKreatFlinkJob/config.xml | 168 ++++++++++++++++++ 3 files changed, 396 insertions(+) create mode 100644 deploy/jenkins/jobs/ArtifactUpload/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml create mode 100644 deploy/jenkins/jobs/Build/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml create mode 100644 deploy/jenkins/jobs/Deploy/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml diff --git a/deploy/jenkins/jobs/ArtifactUpload/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml b/deploy/jenkins/jobs/ArtifactUpload/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml new file mode 100644 index 0000000000..ad9ca9100c --- /dev/null +++ b/deploy/jenkins/jobs/ArtifactUpload/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml @@ -0,0 +1,120 @@ + + + + + + hudson.model.ParametersDefinitionProperty + com.sonyericsson.rebuild.RebuildSettings + + + + + false + + + + + -1 + 10 + -1 + 5 + + + + false + + + false + false + + + + + absolute_job_path + + + Do not change this value! The metadata.json will be copied from this job. + + + Build/KnowledgePlatform/CoKreatFlinkJob + false + + + image_tag + + + OPTIONAL: Specify the tag to upload a specific image version to the container registry. + + + false + + + artifact_source + + + ArtifactRepo - Push the docker image to container registry. + + + + + ArtifactRepo + + + + + + + 0 + 0 + + false + project + false + + + + + + + Build/KnowledgePlatform/CoKreatFlinkJob + + SUCCESS + 0 + BLUE + true + + + + + + + + 2 + + + https://github.com/Sunbird-coKreat/coKreat-jobs.git + + + + + ${public_repo_branch} + + + false + + + + true + false + + 1 + false + + + + kubernetes/pipelines/upload/Jenkinsfile + false + + + false + \ No newline at end of file diff --git a/deploy/jenkins/jobs/Build/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml b/deploy/jenkins/jobs/Build/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml new file mode 100644 index 0000000000..4a22394a38 --- /dev/null +++ b/deploy/jenkins/jobs/Build/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml @@ -0,0 +1,108 @@ + + + + + + hudson.model.ParametersDefinitionProperty + com.sonyericsson.rebuild.RebuildSettings + + + + + false + + + + + -1 + 10 + -1 + 1 + + + + false + + + false + false + + + + + cokreat_release_tag + + + +
  • To build from a tag, use refs/tags/github_tag
  • +
  • To build from a branch, use refs/heads/github_branch
  • +
  • The default value of ${public_repo_branch} will be the release / tag version set in global configuration
  • +
  • To build from a differnt branch, replace the ${public_repo_branch} with your branch
  • +
    +
    +
    + refs/heads/${public_repo_branch} + true +
    + + CLOUD_STORE_GROUP_ID + Set the Cloud store sdk group id. e.g. org.sunbird + ${cloud_store_group_id} + true + + + CLOUD_STORE_ARTIFACT_ID + Set the Cloud store sdk artifact id. e.g. cloud-store-sdk_2.12 + ${cloud_store_artifact_id} + true + + + CLOUD_STORE_VERSION + Set the Cloud store sdk version. e.g. 1.4.6 + ${cloud_store_version} + false + +
    +
    + + 0 + 0 + + false + project + false + + + + + + H/15 * * * * + false + + + +
    + + + 2 + + + https://github.com/Sunbird-coKreat/coKreat-jobs.git + githubPassword + + + + + ${cokreat_release_tag} + + + false + + + + kubernetes/pipelines/build/Jenkinsfile + false + + + false +
    \ No newline at end of file diff --git a/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml b/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml new file mode 100644 index 0000000000..2cbb5f7142 --- /dev/null +++ b/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/KnowledgePlatform/jobs/CoKreatFlinkJob/config.xml @@ -0,0 +1,168 @@ + + + + + + hudson.model.ParametersDefinitionProperty + com.sonyericsson.rebuild.RebuildSettings + + + + + false + + + + + -1 + 10 + -1 + 2 + + + + false + + + false + false + + + + + private_branch + choice-parameter-2544395024638227 + 1 + + true + + + + true + + + CoKreatFlinkJob + Deploy/dev/KnowledgePlatform/CoKreatFlinkJob + + + ET_FORMATTED_HTML + true + + + cokreat_release_tag + + + +
  • To build from a tag, use refs/tags/github_tag
  • +
  • To build from a branch, use refs/heads/github_branch
  • +
  • The default value of ${inquiry_pipeline_branch_or_tag} will be the release / tag version set in global configuration
  • +
  • To build from a differnt branch, replace the ${inquiry_pipeline_branch_or_tag} with your branch
  • +
    +
    +
    + refs/heads/${kokreat_pipeline_branch_or_tag} + false +
    + + image_tag + + + CAUTION: If the value is blank, image tag will be taken from the latest metadata.json. + + + false + + + absolute_job_path + + + Do not change this value! The metadata.json will be copied from this job. + + + ArtifactUpload/dev/KnowledgePlatform/CoKreatFlinkJob + false + + + job_names_to_deploy + + + Choose the job names to deploy. Multi-selection is available. + + + choice-parameter-1273072434092073 + 1 + + true + + + + CoKreatFlinkJob + Deploy/dev/KnowledgePlatform/CoKreatFlinkJob + + + PT_MULTI_SELECT + false + 1 + +
    +
    + + 0 + 0 + + false + project + false + + + + + +
    + + + 2 + + + https://github.com/Sunbird-coKreat/coKreat-jobs.git + + + + + ${cokreat_release_tag} + + + false + + + + false + true + + 0 + false + + + + kubernetes/pipelines/deploy/Jenkinsfile + false + + + false +
    \ No newline at end of file From efbaf2117baff9bcbb50ff48b4a61242252a8620 Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Tue, 2 Apr 2024 12:54:05 +0530 Subject: [PATCH 2/4] Issue #IQ-743 fix: updated memory and cpu limit --- kubernetes/helm_charts/core/assessment/values.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kubernetes/helm_charts/core/assessment/values.j2 b/kubernetes/helm_charts/core/assessment/values.j2 index 1c6a66f67a..1b4722f55d 100644 --- a/kubernetes/helm_charts/core/assessment/values.j2 +++ b/kubernetes/helm_charts/core/assessment/values.j2 @@ -14,11 +14,11 @@ repository: {{assessment_repository|default('assessment-service')}} image_tag: {{ image_tag }} resources: requests: - cpu: {{assessment_cpu_req|default('50m')}} - memory: {{assessment_mem_req|default('50Mi')}} + cpu: {{assessment_cpu_req|default('100m')}} + memory: {{assessment_mem_req|default('100Mi')}} limits: cpu: {{assessment_cpu_limit|default('1')}} - memory: {{assessment_mem_limit|default('500Mi')}} + memory: {{assessment_mem_limit|default('1024Mi')}} network: port: 9003 targetport: 9000 From c08cbf98349f11ab4b770f7a407a667e3fcca750 Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Mon, 15 Apr 2024 08:38:09 +0530 Subject: [PATCH 3/4] Issue #IQ-750 fix: added script for inQuiry --- pipelines/upload/schema/inquiry/Jenkinsfile | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 pipelines/upload/schema/inquiry/Jenkinsfile diff --git a/pipelines/upload/schema/inquiry/Jenkinsfile b/pipelines/upload/schema/inquiry/Jenkinsfile new file mode 100644 index 0000000000..f37147a563 --- /dev/null +++ b/pipelines/upload/schema/inquiry/Jenkinsfile @@ -0,0 +1,55 @@ +@Library('deploy-conf') _ +node() { + 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" + + stage('checkout public repo') { + folder = new File("$WORKSPACE/.git") + if (folder.exists()) + { + println "Found .git folder. Clearing it.." + sh'git clean -fxd' + } + checkout scm + } + + ansiColor('xterm') { + values = [:] + currentWs = sh(returnStdout: true, script: 'pwd').trim() + envDir = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-3].trim() + module = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-2].trim() + jobName = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-1].trim() + stage('deploy artifact'){ + sh """ + rm -rf schema_repo + git clone ${params.schema_repo} -b ${params.schema_repo_branch_or_tag} schema_repo + """ + ansiblePlaybook = "${currentWs}/ansible/kp_upload-schema.yml" + ansibleExtraArgs = "--extra-vars \" source_name=${currentWs}/schema_repo/schemas \" --vault-password-file /var/lib/jenkins/secrets/vault-pass" + values.put('currentWs', currentWs) + values.put('env', envDir) + values.put('module', module) + values.put('jobName', jobName) + values.put('ansiblePlaybook', ansiblePlaybook) + values.put('ansibleExtraArgs', ansibleExtraArgs) + println values + ansible_playbook_run(values) + currentBuild.result = 'SUCCESS' + currentBuild.description = "Private: ${params.private_branch}, Public: ${params.branch_or_tag}, schema_repo_branch_or_tag: ${params.schema_repo_branch_or_tag}" + } + } + summary() + } + catch (err) { + currentBuild.result = 'FAILURE' + throw err + } + finally { + slack_notify(currentBuild.result) + email_notify() + } +} From ee4783da4735c8e6416fa207eb011b471f8b6d35 Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Tue, 16 Apr 2024 13:43:03 +0530 Subject: [PATCH 4/4] Issue #IQ-750 fix: updated jenkins script --- .../{ => jobs}/InquiryUploadSchema/config.xml | 86 +++++++------------ 1 file changed, 31 insertions(+), 55 deletions(-) rename deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/{ => jobs}/InquiryUploadSchema/config.xml (68%) diff --git a/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/InquiryUploadSchema/config.xml b/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/jobs/InquiryUploadSchema/config.xml similarity index 68% rename from deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/InquiryUploadSchema/config.xml rename to deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/jobs/InquiryUploadSchema/config.xml index 7441f81065..1735ad1e56 100644 --- a/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/InquiryUploadSchema/config.xml +++ b/deploy/jenkins/jobs/Deploy/jobs/dev/jobs/Kubernetes/jobs/InquiryUploadSchema/config.xml @@ -1,8 +1,16 @@ - - + + + + + hudson.model.ParametersDefinitionProperty + com.sonyericsson.rebuild.RebuildSettings + + + false + -1 @@ -11,20 +19,21 @@ 5 - - + + false + + false false - + private_branch - choice-parameter-2544395024638227 1 true - + true @@ -44,13 +53,12 @@ return """<b>This parameter is not used</b>""" ET_FORMATTED_HTML true - + branch_or_tag - choice-parameter-2620434998790477 1 true - + true @@ -71,52 +79,20 @@ return """<b>This parameter is not used</b>""" ET_FORMATTED_HTML true - + schema_repo - <font color=dimgray size=2><b>Enter the repo url from which schema folder to be uploaded</b></font> - - - https://github.com/Sunbird-inQuiry/inquiry-api-service.git - https://github.com/project-sunbird/knowledge-platform.git - - - + Enter the repo url from which schema folder to be uploaded + https://github.com/Sunbird-inQuiry/inquiry-api-service.git + false + schema_repo_branch_or_tag - <font color=dimgray size=2><b>Enter the branch or tag for schema repo</b></font> - + Enter the branch or tag for schema repo false - - source_folder - - choice-parameter-5348290139923778 - 1 - - true - - - - InquiryUploadSchema - Deploy/dev/Kubernetes/InquiryUploadSchema - - - PT_MULTI_SELECT - false - 1 - - + 0 0 @@ -130,8 +106,8 @@ return """<b>This parameter is not used</b>""" - - + + 2 @@ -155,9 +131,9 @@ return """<b>This parameter is not used</b>""" - pipelines/upload/schema/knowledge-platform/schema.Jenkinsfile + pipelines/upload/schema/inquiry/Jenkinsfile false false - + \ No newline at end of file