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

changes for increase/stop cpu load #45

Open
wants to merge 37 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2960b0a
Support for Docker image to build the code
sandy724 Jul 12, 2022
7c7a6ef
Added code for building the code
sandy724 Jul 12, 2022
2c2152c
REnamed dockerfile
sandy724 Jul 12, 2022
55f5177
Changes for intergration with BP Step Catalog
sandy724 Jul 12, 2022
eb987c8
Update default status to scuccess
sandy724 Jul 12, 2022
988f8ba
adding generateoutput in bash.sh
neha-sinha20 Jul 13, 2022
15486b1
Merge pull request #32 from opstree/bpmaven
sandy724 Jul 13, 2022
c3c62d9
Basic refactoring
sandy724 Jul 13, 2022
dc3bfee
adding packer code
neha-sinha20 Jul 14, 2022
5ec677e
Merge branch 'master' of https://github.com/opstree/spring3hibernate
neha-sinha20 Jul 14, 2022
be4b126
adding terraform code
neha-sinha20 Jul 15, 2022
d72132b
Update variable.json
neha-sinha20 Oct 6, 2022
420aabf
Update main.tf
neha-sinha20 Oct 6, 2022
de71885
Update terraform.tfvars
neha-sinha20 Oct 6, 2022
74631e7
Create backend.tf
neha-sinha20 Oct 6, 2022
ade71a8
Delete backend.tf
neha-sinha20 Oct 7, 2022
af79073
adding backend.tf in terrafrom code
neha-sinha20 Oct 7, 2022
fb2d04a
Added a global licenecy meta file
sandy724 Oct 17, 2022
7f8d7ff
Added sonar.properties
sandy724 Oct 17, 2022
6ad0786
gradle files
Cpriyanshi07 Oct 26, 2022
c8158ab
removing .gradle dir
Cpriyanshi07 Oct 26, 2022
e6f6a68
Merge pull request #34 from opstree/gradle
sandy724 Oct 26, 2022
b87ca56
Adding golden-ami code of packer
neha-sinha20 Nov 18, 2022
a7bcf45
Adding golden-ami code of packer
neha-sinha20 Nov 18, 2022
68fa849
Added code for Elasticache setup
sandy724 Nov 22, 2022
dfe0030
Added eks provider and tfvars
surabhimaheshwari Nov 30, 2022
9e90511
Merge pull request #36 from opstree/surabhi
sandy724 Nov 30, 2022
3a4cddc
added msk module provider and tfvars
surabhimaheshwari Nov 30, 2022
7f2046c
added network skeleton provider and tfvars
surabhimaheshwari Nov 30, 2022
ab39c2a
Updated variables value
surabhimaheshwari Nov 30, 2022
a555e25
Merge pull request #37 from opstree/surabhi
sandy724 Nov 30, 2022
026f651
Added capability to fetch & store state in S3
sandy724 Dec 2, 2022
f3b3da8
added _override.tf, backend.tf and data.tf
Cpriyanshi07 Dec 2, 2022
bc6e631
renamed data_network.tf
Cpriyanshi07 Dec 2, 2022
8e8ad31
Merge pull request #40 from opstree/msk-tf-files
sandy724 Dec 3, 2022
82d5977
Updated path to correct value
sandy724 Dec 9, 2022
c84c149
changes for cpu load increase and stop in controlled manner and on al…
shahid2311 May 29, 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
6 changes: 6 additions & 0 deletions ami/golden_org/linux_hardening/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: os-audit
hosts: localhost
become: true
roles:
- role: osm_linux_armour
4 changes: 4 additions & 0 deletions ami/golden_org/linux_hardening/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: osm_linux_armour
src: https://github.com/OT-OSM/linux_armour.git
scm: git
version: master
49 changes: 49 additions & 0 deletions ami/golden_org/packer_build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"region": "{{user `region`}}",
"source_ami": "{{user `source_ami`}}",
"instance_type": "{{user `instance_type`}}",
"ssh_username": "{{user `ssh_username`}}",
"ami_name": "{{user `ami_name`}}-{{timestamp}}",
"vpc_id": "{{user `vpc_id`}}",
"subnet_id": "{{user `subnet_id`}}",
"security_group_id": "{{user `security_group_id`}}",
"skip_region_validation": true,
"associate_public_ip_address": true,
"tags": {
"Name": "{{user `ami_name`}}-{{timestamp}}",
"Os_hardening" : "true",
"Environment": "global",
"Owner": "devops",
"Type": "golden"
}
}
],

"provisioners": [

{
"type": "shell",
"inline": ["sleep 30"]
},


{
"type": "file",
"source": "linux_hardening",
"destination": "/tmp/linux_hardening"
},

{
"type": "ansible-local",
"galaxy_command": "ansible-galaxy",
"galaxy_file": "linux_hardening/requirements.yml",
"playbook_file": "linux_hardening/playbook.yml"
}

]
}
11 changes: 11 additions & 0 deletions ami/golden_org/variable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"region": "ap-south-1",
"source_ami": "ami-024c319d5d14b463e",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "golden-ami",
"vpc_id": "vpc-0928ca75a3d30c971",
"subnet_id": "subnet-086ad3db8e3652bba",
"security_group_ids": "sg-01a18e59e1b026d8f",
"ami_virtualization_type": "hvm"
}
78 changes: 78 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apply plugin: 'java'
apply plugin: 'maven'

group = 'Spring3HibernateApp'
version = '1.8-SNAPSHOT'

description = """Spring3HibernateApp"""

sourceCompatibility = 1.6
targetCompatibility = 1.6



repositories {

maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
compile group: 'javax.activation', name: 'activation', version:'1.1'
compile group: 'antlr', name: 'antlr', version:'2.7.6'
compile group: 'aopalliance', name: 'aopalliance', version:'1.0'
compile group: 'asm', name: 'asm', version:'1.5.3'
compile group: 'asm', name: 'asm-attrs', version:'1.5.3'
compile group: 'cglib', name: 'cglib', version:'2.1_3'
compile group: 'commons-beanutils', name: 'commons-beanutils', version:'1.7.0'
compile group: 'commons-io', name: 'commons-io', version:'1.1'
compile group: 'commons-logging', name: 'commons-logging', version:'1.1.1'
compile group: 'commons-lang', name: 'commons-lang', version:'2.5'
compile group: 'commons-collections', name: 'commons-collections', version:'2.1.1'
compile group: 'commons-fileupload', name: 'commons-fileupload', version:'1.1.1'
compile group: 'org.apache.commons', name: 'commons-email', version:'1.1'
compile group: 'commons-digester', name: 'commons-digester', version:'1.8'
compile group: 'dom4j', name: 'dom4j', version:'1.6.1'
compile group: 'dumbster', name: 'dumbster', version:'1.6'
compile group: 'ehcache', name: 'ehcache', version:'1.2.3'
compile group: 'icu4j', name: 'icu4j', version:'2.6.1'
compile group: 'javassist', name: 'javassist', version:'3.4.GA'
compile group: 'javax.xml.bind', name: 'jaxb-api', version:'2.1'
compile group: 'javax.xml', name: 'jaxb-impl', version:'2.1'
compile group: 'jaxen', name: 'jaxen', version:'1.1.1'
compile group: 'jdom', name: 'jdom', version:'1.0'
compile group: 'javax.transaction', name: 'jta', version:'1.1'
compile group: 'jstl', name: 'jstl', version:'1.2'
compile group: 'log4j', name: 'log4j', version:'1.2.14'
compile group: 'org.apache.lucene', name: 'lucene-core', version:'2.3.2'
compile group: 'org.apache.lucene', name: 'lucene-highlighter', version:'2.0.0'
compile group: 'javax.mail', name: 'mail', version:'1.4'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.5.6'
compile group: 'mysql', name: 'mysql-connector-java', version:'5.0.5'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.5.6'
compile group: 'javax.persistence', name: 'persistence-api', version:'1.0'
compile group: 'quartz', name: 'quartz', version:'1.5.2'
compile group: 'javax.xml.stream', name: 'stax-api', version:'1.0-2'
compile group: 'javax.validation', name: 'validation-api', version:'1.0.0.GA'
compile group: 'xalan', name: 'xalan', version:'2.6.0'
compile group: 'xerces', name: 'xercesImpl', version:'2.6.2'
compile group: 'xml-apis', name: 'xml-apis', version:'1.3.02'
compile group: 'xerces', name: 'xmlParserAPIs', version:'2.6.2'
compile group: 'xom', name: 'xom', version:'1.0'
compile group: 'org.hibernate', name: 'hibernate-annotations', version:'3.3.1.GA'
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version:'3.3.2.GA'
compile group: 'org.hibernate', name: 'hibernate-validator', version:'4.0.2.GA'
compile group: 'org.hibernate', name: 'hibernate', version:'3.2.6.ga'
compile group: 'org.hibernate.common', name: 'hibernate-commons-annotations', version:'4.0.0.Final'
compile group: 'org.hibernate', name: 'hibernate-search', version:'3.0.0.GA'
compile group: 'org.springframework', name: 'spring-webmvc', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-core', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-aop', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-orm', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-expression', version:'3.0.1.RELEASE'
compile group: 'org.springframework', name: 'spring-asm', version:'3.0.1.RELEASE'
compile group: 'junit', name: 'junit', version:'4.4'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
}
7 changes: 7 additions & 0 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM maven:3.3-jdk-8
RUN apt-get update || true
RUN apt-get install jq
ENV SLEEP_DURATION 5s
COPY build.sh .
ENV ACTIVITY_SUB_TASK_CODE MVN_EXECUTE
ENTRYPOINT [ "./build.sh" ]
28 changes: 28 additions & 0 deletions builder/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
source functions.sh

echo "I'll build the code"
sleep $SLEEP_DURATION

cd $CODEBASE_DIR
mvn $INSTRUCTION
if [ $? -eq 0 ]
then
generateOutput mvn_execute true "dhek chal gya"
echo "build sucessfull"
elif [ $? != 0 ]
then
generateOutput mvn_execute false "nhi chala"
echo "build unsucessfull"
fi











9 changes: 9 additions & 0 deletions builder/functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generateOutput() {
Task=$1
Status=$2
Message=$3
OUTPUT_DIR=/src/${EXECUTION_DIR}/${EXECUTION_TASK_ID}
mkdir -p ${OUTPUT_DIR}
echo "{ \"${Task}\": {\"status\": \"${Status}\", \"message\": \"${Message}\"}}" | jq . > ${OUTPUT_DIR}/summary.json
echo "{ \"status\": \"${Status}\", \"message\": \"${Message}\"}" | jq . > ${OUTPUT_DIR}/${Task}.json
}
61 changes: 61 additions & 0 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
- - :permit
- MIT
- :who:
:why:
:versions: []
:when: 2022-10-17 06:50:29.255601214 Z
- - :permit
- Apache 2.0
- :who:
:why:
:versions: []
:when: 2022-10-17 06:54:27.256049185 Z
- - :permit
- Common Development and Distribution License 1.0
- :who:
:why:
:versions: []
:when: 2022-10-17 06:55:07.637942543 Z
- - :permit
- The GNU General Public License, Version 2
- :who:
:why:
:versions: []
:when: 2022-10-17 06:55:26.727717107 Z
- - :permit
- LGPL
- :who:
:why:
:versions: []
:when: 2022-10-17 06:55:58.022044091 Z
- - :permit
- GNU LESSER GENERAL PUBLIC LICENSE
- :who:
:why:
:versions: []
:when: 2022-10-17 06:56:09.078335004 Z
- - :permit
- Common Public License Version 1.0
- :who:
:why:
:versions: []
:when: 2022-10-17 06:56:20.370905240 Z
- - :permit
- CDDL + GPLv2 with classpath exception
- :who:
:why:
:versions: []
:when: 2022-10-17 06:56:32.140297451 Z
- - :permit
- GNU Lesser General Public License, version 2.1
- :who:
:why:
:versions: []
:when: 2022-10-17 06:57:00.424897761 Z
- - :permit
- Public Domain
- :who:
:why:
:versions: []
:when: 2022-10-17 06:57:09.597364315 Z
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading