-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand recipe to support containerized and standalone Jboss/Wildfly a…
…pp servers (#631)
- Loading branch information
Showing
20 changed files
with
733 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
node_modules | ||
.DS_Store | ||
recipes/.prettierrc | ||
*.war | ||
*.war |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "OpenSource", | ||
"Environment": "development", | ||
"Department": "Product", | ||
"Product": "Virtuoso" | ||
}, | ||
"resources": [ | ||
{ | ||
"id": "jboss", | ||
"display_name": "AwsDebianInfraJavaInstallHost", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t2.micro", | ||
"ami_name": "debian-10-amd64-2020????-???-*", | ||
"user_name": "admin" | ||
} | ||
], | ||
"services": [ | ||
{ | ||
"id": "java1", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/jboss/systemd/install/linux/roles", | ||
"port": 6001, | ||
"destinations": ["jboss"] | ||
} | ||
], | ||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "jbossRecipe", | ||
"resource_ids": [ | ||
"jboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/install-recipe/roles", | ||
"params": { | ||
"recipe_content_url": "https://raw.githubusercontent.com/newrelic/open-install-library/main/recipes/newrelic/apm/java/linux.yml", | ||
"validate_output": "New Relic installation complete" | ||
} | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": [ | ||
"jboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/validate-recipe/roles", | ||
"params": { | ||
"nrql_query": "Select count(*) from ApplicationAgentContext where agent.language='java' and host like '%HOSTNAME%' since 5 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "OpenSource", | ||
"Environment": "development", | ||
"Department": "Product", | ||
"Product": "Virtuoso" | ||
}, | ||
"resources": [ | ||
{ | ||
"id": "jboss", | ||
"display_name": "AwsLinux2InfraJavaInstallHost", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t2.micro", | ||
"ami_name": "amazonlinux-2-base*", | ||
"user_name": "ec2-user" | ||
} | ||
], | ||
"services": [ | ||
{ | ||
"id": "java1", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/jboss/systemd/install/linux/roles", | ||
"port": 6001, | ||
"destinations": ["jboss"] | ||
} | ||
], | ||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "jbossRecipe", | ||
"resource_ids": [ | ||
"jboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/install-recipe/roles", | ||
"params": { | ||
"recipe_content_url": "https://raw.githubusercontent.com/newrelic/open-install-library/main/recipes/newrelic/apm/java/linux.yml", | ||
"validate_output": "New Relic installation complete" | ||
} | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": [ | ||
"jboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/validate-recipe/roles", | ||
"params": { | ||
"nrql_query": "Select count(*) from ApplicationAgentContext where agent.language='java' and host like '%HOSTNAME%' since 5 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "OpenSource", | ||
"Environment": "development", | ||
"Department": "Product", | ||
"Product": "Virtuoso" | ||
}, | ||
"resources": [{ | ||
"id": "dockerjboss", | ||
"display_name": "AwsLinux2InfraJavaInstallHost", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t2.micro", | ||
"ami_name": "amazonlinux-2-base*", | ||
"user_name": "ec2-user" | ||
}], | ||
"services": [ | ||
{ | ||
"id": "docker", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/docker/install/aws-linux2/roles", | ||
"port": 9999, | ||
"destinations": [ | ||
"dockerjboss" | ||
] | ||
}, | ||
{ | ||
"id": "jboss", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/jboss/docker/linux/noApp/roles", | ||
"port": 9090, | ||
"destinations": [ | ||
"dockerjboss" | ||
] | ||
} | ||
], | ||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "jbossRecipe", | ||
"resource_ids": [ | ||
"dockerjboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/install-recipe/roles", | ||
"params": { | ||
"recipe_content_url": "https://raw.githubusercontent.com/newrelic/open-install-library/main/recipes/newrelic/apm/java/linux.yml", | ||
"validate_output": "New Relic installation complete" | ||
} | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": [ | ||
"dockerjboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/validate-recipe/roles", | ||
"params": { | ||
"nrql_query": "Select count(*) from ApplicationAgentContext where agent.language='java' and host like '%CONTAINERID%' since 15 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "OpenSource", | ||
"Environment": "development", | ||
"Department": "Product", | ||
"Product": "Virtuoso" | ||
}, | ||
"resources": [{ | ||
"id": "dockerjboss", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t2.medium", | ||
"ami_name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-????????.1", | ||
"user_name": "ubuntu" | ||
}], | ||
"services": [ | ||
{ | ||
"id": "docker", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/docker/install/debian/roles", | ||
"port": 9999, | ||
"destinations": [ | ||
"dockerjboss" | ||
] | ||
}, | ||
{ | ||
"id": "jboss", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/jboss/docker/debian/noApp/roles", | ||
"port": 9090, | ||
"destinations": [ | ||
"dockerjboss" | ||
] | ||
} | ||
], | ||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "jbossRecipe", | ||
"resource_ids": [ | ||
"dockerjboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/install-recipe/roles", | ||
"params": { | ||
"recipe_content_url": "https://raw.githubusercontent.com/newrelic/open-install-library/main/recipes/newrelic/apm/java/linux.yml", | ||
"validate_output": "New Relic installation complete" | ||
} | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": [ | ||
"dockerjboss" | ||
], | ||
"provider": "newrelic", | ||
"source_repository": "https://github.com/newrelic/open-install-library.git", | ||
"deploy_script_path": "test/deploy/linux/newrelic-cli/validate-recipe/roles", | ||
"params": { | ||
"nrql_query": "Select count(*) from ApplicationAgentContext where agent.language='java' and host like '%CONTAINERID%' since 5 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/deploy/linux/jboss/docker/linux/noApp/roles/configure/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
|
||
- name: Pull JBoss Docker image | ||
shell: "docker pull jboss/wildfly" | ||
become: yes |
16 changes: 16 additions & 0 deletions
16
test/deploy/linux/jboss/docker/linux/noApp/roles/start/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
|
||
- fail: | ||
msg: "service_id is required" | ||
when: service_id is not defined | ||
|
||
- debug: | ||
msg: Starting {{ service_id }} service | ||
|
||
- fail: | ||
msg: "service_port is required" | ||
when: service_port is not defined | ||
|
||
- name: Run JBoss Docker container | ||
shell: "docker run -d -p {{ service_port }}:8080 -p 9990:9990 jboss/wildfly /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0" | ||
become: yes |
2 changes: 2 additions & 0 deletions
2
test/deploy/linux/jboss/docker/linux/restApp/roles/configure/files/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM jboss/wildfly | ||
ADD spring-boot-rest.war /opt/jboss/wildfly/standalone/deployments/ |
35 changes: 35 additions & 0 deletions
35
test/deploy/linux/jboss/docker/linux/restApp/roles/configure/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
|
||
- name: purge python-pip | ||
shell: apt-get purge --auto-remove python-pip | ||
become: yes | ||
|
||
- name: apt-get update | ||
shell: apt-get update | ||
become: yes | ||
ignore_errors: true | ||
|
||
- name: install pip | ||
shell: apt-get -y install python3-pip | ||
become: yes | ||
|
||
- name: install docker-py | ||
shell: pip install docker-py | ||
become: yes | ||
|
||
- name: Upload war to host | ||
synchronize: src=. dest=/home/{{ ansible_user }} | ||
become: yes | ||
|
||
- name: Build JBoss Image | ||
docker_image: > | ||
name=spring-boot-rest | ||
tag=wildfly | ||
path=/home/{{ ansible_user }} | ||
state=present | ||
become: yes | ||
|
||
# NOTE: context root of deployed app is name of artifact i.e. http://localhost:<service_port>/spring-boot-rest | ||
- name: Run JBoss Docker container | ||
shell: "docker run -d -p {{ service_port }}:8080 spring-boot-rest:wildfly /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0" | ||
become: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.