Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This project hosts docker (https://www.docker.com/) images build for the APM sol
- Introscope Enterprise Manager database using Postgresql
- An Introscope sample application (small EPAgent) for demonstration purposes

This version supports Introscope version 10.1. For other versions please look at the branches in the GitHub project. Please feel free to contribute newer versions.
This version supports Introscope version 10.3. For other versions please look at the branches in the GitHub project. Please feel free to contribute newer versions.

The current idea is to have single-process containers, thus the Enterprise Manager, WebView and the APM postgres database are separate images. As docker containers are very light-weight, this is no overhead.

Expand Down
2 changes: 1 addition & 1 deletion database/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docker-introscope-postgres
A docker (https://www.docker.com/) image build for the APM solution of CA Technologies (CA APM). This project build a docker image for a postgres database with the schema for Introscope 10.0.0.12. It is meant to be used in combination with the docker image docker-introscope-enterprisemanager (https://github.com/stefansiegl/docker-introscope-enterprisemanager).
A docker (https://www.docker.com/) image build for the APM solution of CA Technologies (CA APM). This project build a docker image for a postgres database with the schema for Introscope 10.3. It is meant to be used in combination with the docker image docker-introscope-enterprisemanager (https://github.com/stefansiegl/docker-introscope-enterprisemanager).


## Building the image
Expand Down
2 changes: 1 addition & 1 deletion database/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker build -t apm-postgres:10.2 .
docker build -t apm-postgres:10.3 .
2 changes: 1 addition & 1 deletion database/createInstallDatabasesForIntroscope.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

final_script=/docker-entrypoint-initdb.d/installDatabasesForIntroscope.sh
script_dir=scripts
dbversion=10.2.0.0
dbversion=10.3.0.0
sql_files=($script_dir/createtables-postgres-$dbversion.sql $script_dir/createsequences-postgres-$dbversion.sql $script_dir/addindexes-postgres-$dbversion.sql $script_dir/create-apm-tables-postgres-$dbversion.sql $script_dir/create-apm-sequences-postgres-$dbversion.sql $script_dir/addconstraints-postgres-$dbversion.sql $script_dir/add-apm-indexes-postgres-$dbversion.sql $script_dir/add-apm-constraints-postgres-$dbversion.sql $script_dir/apm-defaults-postgres-$dbversion.sql $script_dir/addviews-postgres-$dbversion.sql $script_dir/defaults-postgres-$dbversion.sql $script_dir/initdb-postgres-$dbversion.sql $script_dir/procedures-postgres-$dbversion.sql $script_dir/quartz-1.5.1-postgres.sql)
# $script_dir/apm-procedures-postgres-$dbversion.sql --> contains pruning procedure but won't work with this script
# removed $script_dir/add-apm-pruning-function-postgres-$dbversion.sql --> not available for 10.0.0.12
Expand Down
3 changes: 1 addition & 2 deletions database/run-default-postgres-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh

docker run -d --name apm-postgres apm-postgres

docker run -d --name apm-postgres apm-postgres:10.3
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,15 @@ alter table appmap_edges
references appmap_id_mappings on delete cascade;

-- /appmap

-- aca
alter table aca_user_group
add CONSTRAINT aca_user_group_user_id
FOREIGN KEY ( user_id )
REFERENCES aca_user ( user_id ) on delete cascade;

alter table aca_user_group
add CONSTRAINT aca_user_group_group_id
FOREIGN KEY ( group_id )
REFERENCES aca_group ( group_id ) on delete cascade;
-- /aca
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,23 @@ CREATE INDEX appmap_settings_type_idx ON appmap_settings(type, deleted_at);
CREATE INDEX appmap_model_vertices_idx ON appmap_model_vertices(update_time DESC);
-- /appmap

-- aca
CREATE INDEX aca_user_searchable_attrib1_idx ON aca_user (searchable_attrib1);
CREATE INDEX aca_user_searchable_attrib2_idx ON aca_user (searchable_attrib2);
CREATE INDEX aca_user_searchable_attrib3_idx ON aca_user (searchable_attrib3);
CREATE INDEX aca_user_searchable_attrib4_idx ON aca_user (searchable_attrib4);
CREATE INDEX aca_user_searchable_attrib5_idx ON aca_user (searchable_attrib5);

CREATE INDEX aca_group_searchable_attrib1_idx ON aca_group (searchable_attrib1);
CREATE INDEX aca_group_searchable_attrib2_idx ON aca_group (searchable_attrib2);
CREATE INDEX aca_group_searchable_attrib3_idx ON aca_group (searchable_attrib3);
CREATE INDEX aca_group_searchable_attrib4_idx ON aca_group (searchable_attrib4);
CREATE INDEX aca_group_searchable_attrib5_idx ON aca_group (searchable_attrib5);

CREATE INDEX aca_user_group_group_id ON aca_user_group (group_id);

CREATE UNIQUE INDEX aca_acl_ak1 ON aca_acl(service_provider_id, service_provider_instance_id, resource_id, group_id);
CREATE UNIQUE INDEX aca_acl_ak2 ON aca_acl(service_provider_id, service_provider_instance_id, resource_id, user_id);

CREATE INDEX aca_audit_update_time_idx ON aca_audit (update_time);
-- /aca
23 changes: 23 additions & 0 deletions database/scripts/copy-scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
DB_VERSION=10.3
docker cp em:/opt/CA/Introscope/install/database-scripts/add-apm-constraints-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/add-apm-indexes-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/addconstraints-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/addindexes-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/addviews-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/apm-defaults-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/apm-procedures-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/create-apm-sequences-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/create-apm-tables-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/createsequences-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/createtables-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/dbupdate-apm-sequences-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/dbupdate-sequences-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/defaults-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/drop-apm-tables-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/dropconstraints-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/dropindexes-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/droptables-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/dropviews-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/initdb-postgres-${DB_VERSION}.0.0.sql .
docker cp em:/opt/CA/Introscope/install/database-scripts/procedures-postgres-${DB_VERSION}.0.0.sql .
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,8 @@ CREATE SEQUENCE seq_appmap_api_key_id MINVALUE 1;
ALTER SEQUENCE seq_appmap_api_key_id owned by appmap_api_keys.id;

-- /appmap

-- aca
CREATE SEQUENCE sq_aca_acl MINVALUE 1;
ALTER SEQUENCE sq_aca_acl owned by aca_acl.acl_id;
-- /aca
Original file line number Diff line number Diff line change
Expand Up @@ -8336,8 +8336,8 @@ CREATE TABLE appmap_vertices (
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP NOT NULL,
fork BIGINT NOT NULL,
vertex_name VARCHAR(256),
business_service VARCHAR(256),
vertex_name VARCHAR(1024),
business_service VARCHAR(1024),
gathered_attribs TEXT,
other_attribs TEXT,
PRIMARY KEY(vertex_id, start_time)
Expand Down Expand Up @@ -8404,3 +8404,69 @@ CREATE TABLE apm_secure_store(


-- /appmap

-- aca
CREATE TABLE aca_user
(
user_id character varying(256) not null,
realm_id character varying(256) not null,
searchable_attrib1 character varying(256) null,
searchable_attrib2 character varying(256) null,
searchable_attrib3 character varying(256) null,
searchable_attrib4 character varying(256) null,
searchable_attrib5 character varying(256) null,
attributes text null,
realm_attributes text null,
last_login_time timestamp without time zone NULL,
last_update timestamp without time zone NOT NULL,
CONSTRAINT aca_user_pk PRIMARY KEY (user_id)
);

CREATE TABLE aca_group
(
group_id character varying(256) not null,
realm_id character varying(256) not null,
searchable_attrib1 character varying(256) null,
searchable_attrib2 character varying(256) null,
searchable_attrib3 character varying(256) null,
searchable_attrib4 character varying(256) null,
searchable_attrib5 character varying(256) null,
attributes text null,
realm_attributes text null,
last_update timestamp without time zone NOT NULL,
CONSTRAINT aca_group_pk PRIMARY KEY (group_id)
);

CREATE TABLE aca_user_group
(
user_id character varying(256) not null,
group_id character varying(256) not null,
last_update timestamp without time zone NOT NULL,
CONSTRAINT aca_user_group_pk PRIMARY KEY (user_id, group_id)
);

CREATE TABLE aca_acl
(
acl_id numeric not null,
service_provider_id character varying(256) NOT NULL,
service_provider_instance_id character varying(256) NOT NULL,
resource_id character varying(256) NOT NULL,
group_id character varying(256) NULL,
user_id character varying(256) NULL,
resource_type_id character varying(10) NOT NULL,
capabilities_allow text NULL,
capabilities_grant text NULL,
last_update timestamp without time zone NOT NULL,
CONSTRAINT aca_acl_pk PRIMARY KEY (acl_id),
CONSTRAINT aca_acl_user_xor_group CHECK ( ( group_id is null and user_id is not null ) or (group_id is not null and user_id is null) ),
CONSTRAINT aca_acl_resource_type_id CHECK ( resource_type_id = 'regex' or resource_type_id = 'literal' )
);

create table aca_audit(
update_time timestamp without time zone NOT NULL,
user_id character varying(256) NOT NULL,
table_name character varying(256) NOT NULL,
change_from text null,
change_to text null
);
-- /aca
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ DROP TABLE APM_EDGE;
DROP TABLE APM_VERTEX_LOGICAL_EQUIVALENCE;
DROP TABLE APM_GEOLOCATION;
DROP TABLE APM_GEOLOCATION_METADATA;

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@ DROP TABLE IF EXISTS appmap_id_mappings, appmap_vertices, appmap_attribs, appmap
DROP TABLE IF EXISTS appmap_api_keys;
DROP TABLE IF EXISTS apm_secure_store;
-- /appmap


-- ACA
DROP TABLE aca_audit;
DROP TABLE aca_acl;
DROP TABLE aca_user_group;
DROP TABLE aca_user;
DROP TABLE aca_group;

DROP SEQUENCE sq_aca_acl;

-- /ACA
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Insert into ts_user_importances(ts_id, ts_name, ts_weight, ts_soft_delete, versi
Insert into ts_user_importances(ts_id, ts_name, ts_weight, ts_soft_delete, version_info) values(7, 'Critical', 6, false, 1);
Insert into ts_user_importances(ts_id, ts_name, ts_weight, ts_soft_delete, version_info) values(8, 'Trigger Immediately', 7, false, 1);

insert into ts_domains(ts_id, ts_name, ts_ip_address, ts_port, ts_db_versions, ts_tran_importance_id, ts_user_importance_id, version_info, ts_dynamic_group_reassign) values (1, 'Local Domain', 0, 80, '10.2.0.0', 5, 5, 1, false);
insert into ts_domains(ts_id, ts_name, ts_ip_address, ts_port, ts_db_versions, ts_tran_importance_id, ts_user_importance_id, version_info, ts_dynamic_group_reassign) values (1, 'Local Domain', 0, 80, '10.3.0.0', 5, 5, 1, false);

-- insert rows into the AppDef auth types table
Insert into ts_app_auth_types(ts_id, ts_name, ts_soft_delete, version_info) values(1, 'Application Specific', false, 1);
Expand Down Expand Up @@ -119,7 +119,7 @@ ALTER SEQUENCE ts_defect_meta_keys_ts_id_sq RESTART WITH 600000000000000000;
-- insert rows into the Introscope Config table
insert into ts_introscope_configs(ts_enabled, ts_soft_delete, version_info) values(true, false, 1);
insert into ts_introscope_ems(version_info, ts_name, ts_description, ts_username, ts_password, ts_hostname, ts_em_version, ts_web_view_version, ts_web_start_version, ts_port, ts_web_view_port, ts_web_start_port, ts_has_web_view, ts_has_web_start, ts_tran_trace_duration, ts_tran_trace_threshold_percnt, ts_enabled, ts_soft_delete)
values (1, '', '', '','','localhost', '10.2.0.0', '', '',5001, 8080, 8081, false, false, 30, 50, false, false);
values (1, '', '', '','','localhost', '10.3.0.0', '', '',5001, 8080, 8081, false, false, 30, 50, false, false);

-- insert Jasper Reports items into ts_settings
insert into ts_settings(ts_id, version_info, ts_key, ts_value, ts_description, ts_default, ts_soft_delete) values (1001, 1, 'reports.userImage', 'report-logo.gif', 'image shown at top of an exported report', 'wily_logo.gif', false);
Expand Down
34 changes: 17 additions & 17 deletions docker-compose-2MOM-4Collector-1CDV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# CDV

cdv:
image: apm-em:10.2
image: apm-em:10.3
links:
- cdvdb:db
- collector1:em1
Expand All @@ -25,10 +25,10 @@ cdv:
- CLUSTER_ROLE=CDV

cdvdb:
image: apm-postgres:10.2
image: apm-postgres:10.3

cdvwebview:
image: apm-webview:10.2
image: apm-webview:10.3
links:
- cdv:em
ports:
Expand All @@ -37,7 +37,7 @@ cdvwebview:
# MOMs

mom1:
image: apm-em:10.2
image: apm-em:10.3
links:
- momdb1:db
- collector1:em1
Expand All @@ -47,18 +47,18 @@ mom1:
- CLUSTER_ROLE=MOM

momdb1:
image: apm-postgres:10.2
image: apm-postgres:10.3

momwebview1:
image: apm-webview:10.2
image: apm-webview:10.3
links:
- mom1:em
ports:
- "8081:8080"


mom2:
image: apm-em:10.2
image: apm-em:10.3
links:
- momdb2:db
- collector3:em1
Expand All @@ -68,10 +68,10 @@ mom2:
- CLUSTER_ROLE=MOM

momdb2:
image: apm-postgres:10.2
image: apm-postgres:10.3

momwebview2:
image: apm-webview:10.2
image: apm-webview:10.3
links:
- mom2:em
ports:
Expand All @@ -82,63 +82,63 @@ momwebview2:
# Collectors

collector1:
image: apm-em:10.2
image: apm-em:10.3
links:
- collector1db:db
environment:
- HEAP=1024m
- CLUSTER_ROLE=Collector

collector1db:
image: apm-postgres:10.2
image: apm-postgres:10.3

sample1:
image: apm-sample:9.7
links:
- collector1:em

collector2:
image: apm-em:10.2
image: apm-em:10.3
links:
- collector2db:db
environment:
- HEAP=1024m
- CLUSTER_ROLE=Collector

collector2db:
image: apm-postgres:10.2
image: apm-postgres:10.3

sample2:
image: apm-sample:9.7
links:
- collector2:em

collector3:
image: apm-em:10.2
image: apm-em:10.3
links:
- collector3db:db
environment:
- HEAP=1024m
- CLUSTER_ROLE=Collector

collector3db:
image: apm-postgres:10.2
image: apm-postgres:10.3

sample3:
image: apm-sample:9.7
links:
- collector3:em

collector4:
image: apm-em:10.2
image: apm-em:10.3
links:
- collector4db:db
environment:
- HEAP=1024m
- CLUSTER_ROLE=Collector

collector4db:
image: apm-postgres:10.2
image: apm-postgres:10.3

sample4:
image: apm-sample:9.7
Expand Down
Loading