Skip to content

Commit

Permalink
first pass at packaging all. console is now a fully running server
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Dec 17, 2010
1 parent a162725 commit bf8785c
Show file tree
Hide file tree
Showing 9 changed files with 342 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildscript {
}

dependencies {
classpath 'org.linkedin:org.linkedin.gradle-plugins:1.4.0'
classpath 'org.linkedin:org.linkedin.gradle-plugins:1.5.0'
}
}

Expand Down
73 changes: 73 additions & 0 deletions console/org.linkedin.glu.console-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright 2010-2010 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

apply plugin: 'org.linkedin.cmdline'
apply plugin: 'org.linkedin.release'

configurations {
jetty
}

dependencies {
jetty spec.external.jettyPackage
}

def jettyDistribution = "jetty-distribution-${spec.versions.jetty}"

cmdline {
dependsOn = [
':console:org.linkedin.glu.console-webapp:war'
]
resources = [
// licenses
fileTree(dir: rootDir, includes: ['*.txt', '*.md', '*.html']),

// console configuration
[
from: 'src/cmdline/resources',
into: new File(assemblePackageFile, jettyDistribution)
],

// keys
[
from: fileTree(dir: new File(rootDir, 'agent/org.linkedin.glu.agent-server/src/zk-config/keys'),
includes: ['console.dev.keystore', 'agent.dev.truststore', 'console.dev.secretkeystore']),
into: new File(assemblePackageFile, "${jettyDistribution}/conf"),
replaceTokens: false
]
]
}

def consoleWebappProject = evaluationDependsOn(':console:org.linkedin.glu.console-webapp')

/********************************************************
* task: package-assemble
* customizing package-assemble task to include jetty
********************************************************/
project.'package-assemble'.doFirst {
File basePackage = project.convention.plugins.cmdline.assemblePackageFile
File jettyRoot = new File(basePackage, jettyDistribution)

ant.untar(src: configurations.jetty.resolve().toList()[0],
dest: basePackage,
compression: 'gzip')

// remove the test.war application
project.delete(new File(jettyRoot, "webapps/test.war"))

ant.copy(file: consoleWebappProject.tasks.getByPath('package-war').artifactFile,
tofile: new File(jettyRoot, "webapps/console.war"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
console.sslEnabled=true

console.keystorePath="${System.properties['user.dir']}/conf/console.dev.keystore"
console.keystorePassword = 'nacEn92x8-1'
console.keyPassword = 'nWVxpMg6Tkv'

console.secretkeystorePath="${System.properties['user.dir']}/conf/console.dev.secretkeystore"

console.truststorePath="${System.properties['user.dir']}/conf/agent.dev.truststore"
console.truststorePassword = 'nacEn92x8-1'

// specify the database connection string
dataSource.dbCreate = "update"
dataSource.url = "jdbc:hsqldb:file:${System.properties['user.dir']}/database/tutorial;shutdown=true"

grails.serverURL = "http://${InetAddress.getLocalHost().canonicalHostName}:8080/console"

log4j = {
appenders {
file name:'file', file:'logs/console.log', layout:pattern(conversionPattern: '%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] %m%n')
}

root {
info 'file'
additivity = false
}

error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate'

info 'grails',
'com.linkedin'

//debug 'com.linkedin.glu.agent.tracker', 'com.linkedin.glu.zookeeper.client'

//trace 'org.hibernate.SQL', 'org.hibernate.type'

warn 'org.mortbay.log', 'org.restlet.Context'
}

/******************************************************
* This is how to configure ldap
******************************************************/
//ldap.server.url="ldaps://ldap.host:3269"
//ldap.search.base="dc=gluos"
//ldap.search.user="cn=Artifactoryr,ou=Pseudo-Users,dc=gluos"
//ldap.search.pass="*****"
//ldap.username.attribute="sAMAccountName"


console.defaults =
[
dashboard:
[
mountPoint: [checked: true, name: 'mountPoint', groupBy: true, linkFilter: true],
agent: [checked: true, name: 'agent', groupBy: true],
'metadata.container.name': [checked: true, name: 'container', groupBy: true, linkFilter: true],
'metadata.version': [checked: true, name: 'version', groupBy: true],
'metadata.product': [checked: true, name: 'product', groupBy: true, linkFilter: true],
'metadata.cluster': [checked: true, name: 'cluster', groupBy: true, linkFilter: true],
'initParameters.skeleton': [checked: false, name: 'skeleton', groupBy: true],
script: [checked: false, name: 'script', groupBy: true],
'metadata.modifiedTime': [checked: false, name: 'Last Modified', groupBy: false],
status: [checked: true, name: 'status', groupBy: true]
],

system:
[
agent: [name: 'agent'],
'metadata.container.name': [name: 'container'],
'metadata.product': [name: 'product'],
'metadata.version': [name: 'version'],
'metadata.cluster': [name: 'cluster']
],

model:
[
[
name: 'product',
header: ['version']
]
],

header:
[
metadata: ['drMode']
],

fabrics:
[
'glu-dev-1': ['drMode': 'primary'],
'glu-dev-2': ['drMode': 'secondary']
],
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#HSQL Database Engine 1.8.0.10
#Fri Dec 17 10:54:32 PST 2010
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
hsqldb.cache_size_scale=8
readonly=false
hsqldb.nio_data_file=true
hsqldb.cache_scale=14
version=1.8.0
hsqldb.default_table_type=memory
hsqldb.cache_file_scale=1
hsqldb.log_size=200
modified=no
hsqldb.cache_version=1.7.0
hsqldb.original_version=1.8.0
hsqldb.compatible_version=1.8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE AUDIT_LOG(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,DATE_CREATED TIMESTAMP NOT NULL,DETAILS VARCHAR(255),INFO LONGVARCHAR,TYPE VARCHAR(255) NOT NULL,USERNAME VARCHAR(255) NOT NULL)
CREATE MEMORY TABLE DB_CURRENT_SYSTEM(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,DATE_CREATED TIMESTAMP NOT NULL,FABRIC VARCHAR(255) NOT NULL,LAST_UPDATED TIMESTAMP NOT NULL,SYSTEM_MODEL_ID BIGINT NOT NULL,CONSTRAINT SYS_CT_49 UNIQUE(FABRIC))
CREATE MEMORY TABLE DB_DEPLOYMENT(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,DESCRIPTION VARCHAR(255),DETAILS LONGVARCHAR,END_DATE TIMESTAMP,FABRIC VARCHAR(255) NOT NULL,START_DATE TIMESTAMP NOT NULL,STATUS VARCHAR(255),USERNAME VARCHAR(255))
CREATE MEMORY TABLE DB_SYSTEM_MODEL(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,CONTENT LONGVARCHAR NOT NULL,CONTENT_SERIALIZER VARCHAR(255) NOT NULL,DATE_CREATED TIMESTAMP NOT NULL,FABRIC VARCHAR(255) NOT NULL,SYSTEM_ID VARCHAR(255) NOT NULL,CONSTRAINT SYS_CT_55 UNIQUE(SYSTEM_ID))
CREATE MEMORY TABLE DB_USER_CREDENTIALS(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,ONE_WAY_HASH_PASSWORD VARCHAR(255),USERNAME VARCHAR(255) NOT NULL,X509PEM VARCHAR(255),CONSTRAINT SYS_CT_59 UNIQUE(USERNAME))
CREATE MEMORY TABLE FABRIC(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,COLOR VARCHAR(255) NOT NULL,NAME VARCHAR(255) NOT NULL,ZK_CONNECT_STRING VARCHAR(255) NOT NULL,ZK_SESSION_TIMEOUT VARCHAR(255) NOT NULL,CONSTRAINT SYS_CT_63 UNIQUE(NAME))
CREATE MEMORY TABLE ROLE(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,NAME VARCHAR(255) NOT NULL)
CREATE MEMORY TABLE USER(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION BIGINT NOT NULL,USERNAME VARCHAR(255) NOT NULL,CONSTRAINT SYS_CT_69 UNIQUE(USERNAME))
CREATE MEMORY TABLE USER_PERMISSIONS(USER_ID BIGINT,PERMISSIONS_STRING VARCHAR(255),CONSTRAINT FKE693E610AF3CA4E9 FOREIGN KEY(USER_ID) REFERENCES USER(ID))
CREATE MEMORY TABLE USER_ROLE(USER_ROLES_ID BIGINT,ROLE_ID BIGINT,CONSTRAINT FK143BF46AAB2F1EAB FOREIGN KEY(USER_ROLES_ID) REFERENCES USER(ID),CONSTRAINT FK143BF46AA11E109 FOREIGN KEY(ROLE_ID) REFERENCES ROLE(ID))
ALTER TABLE DB_CURRENT_SYSTEM ADD CONSTRAINT FKDF2E5D967F4F52AE FOREIGN KEY(SYSTEM_MODEL_ID) REFERENCES DB_SYSTEM_MODEL(ID)
ALTER TABLE AUDIT_LOG ALTER COLUMN ID RESTART WITH 9
ALTER TABLE DB_CURRENT_SYSTEM ALTER COLUMN ID RESTART WITH 2
ALTER TABLE DB_DEPLOYMENT ALTER COLUMN ID RESTART WITH 1
ALTER TABLE DB_SYSTEM_MODEL ALTER COLUMN ID RESTART WITH 2
ALTER TABLE DB_USER_CREDENTIALS ALTER COLUMN ID RESTART WITH 5
ALTER TABLE FABRIC ALTER COLUMN ID RESTART WITH 3
ALTER TABLE ROLE ALTER COLUMN ID RESTART WITH 10
ALTER TABLE USER ALTER COLUMN ID RESTART WITH 5
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10
SET SCHEMA PUBLIC
INSERT INTO AUDIT_LOG VALUES(1,0,'2010-12-17 10:47:51.755000000',NULL,NULL,'login','admin')
INSERT INTO AUDIT_LOG VALUES(2,0,'2010-12-17 10:48:34.815000000',NULL,NULL,'fabric.resetCache','admin')
INSERT INTO AUDIT_LOG VALUES(3,0,'2010-12-17 10:48:34.843000000','1','["color":"#005a87", "zkConnectString":"localhost:2181", "zkSessionTimeout":"30s", "name":"glu-dev-1", "action":"save", "controller":"fabric", "__nvbe":"Admin"]','fabric.updated','admin')
INSERT INTO AUDIT_LOG VALUES(4,0,'2010-12-17 10:48:55.157000000',NULL,NULL,'fabric.resetCache','admin')
INSERT INTO AUDIT_LOG VALUES(5,0,'2010-12-17 10:48:55.161000000','2','["color":"#5a0087", "zkConnectString":"localhost:2181", "zkSessionTimeout":"30s", "name":"glu-dev-2", "action":"save", "controller":"fabric", "__nvbe":"Admin"]','fabric.updated','admin')
INSERT INTO AUDIT_LOG VALUES(6,0,'2010-12-17 10:49:20.900000000','glua','roles: [USER, RELEASE, ADMIN]','user.updated','admin')
INSERT INTO AUDIT_LOG VALUES(7,0,'2010-12-17 10:49:38.110000000','glur','roles: [USER, RELEASE]','user.updated','admin')
INSERT INTO AUDIT_LOG VALUES(8,0,'2010-12-17 10:54:07.402000000','fabric: glu-dev-1, systemId: 436406a6b53d1cfee7044bdd89cd0b5127f9ccb4',NULL,'system.change','admin')
INSERT INTO DB_CURRENT_SYSTEM VALUES(1,0,'2010-12-17 10:54:07.397000000','glu-dev-1','2010-12-17 10:54:07.397000000',1)
INSERT INTO DB_SYSTEM_MODEL VALUES(1,0,'{"id":"436406a6b53d1cfee7044bdd89cd0b5127f9ccb4","entries":[],"fabric":"glu-dev-1","metadata":{"product":{}}}','json','2010-12-17 10:54:07.375000000','glu-dev-1','436406a6b53d1cfee7044bdd89cd0b5127f9ccb4')
INSERT INTO DB_USER_CREDENTIALS VALUES(1,0,'0X6jKwsyqFbr9nU0jEqktHP37o9','admin',NULL)
INSERT INTO DB_USER_CREDENTIALS VALUES(2,0,'9Q3bcHAqMaxnSORSiwrIYHQvWIG','glua',NULL)
INSERT INTO DB_USER_CREDENTIALS VALUES(3,0,'9Q3bcHAqMaxnSORSiwrIYHQvWIG','glur',NULL)
INSERT INTO DB_USER_CREDENTIALS VALUES(4,0,'9Q3bcHAqMaxnSORSiwrIYHQvWIG','glu',NULL)
INSERT INTO FABRIC VALUES(1,0,'#005a87','glu-dev-1','localhost:2181','30s')
INSERT INTO FABRIC VALUES(2,0,'#5a0087','glu-dev-2','localhost:2181','30s')
INSERT INTO ROLE VALUES(1,0,'ADMIN')
INSERT INTO ROLE VALUES(2,0,'USER')
INSERT INTO ROLE VALUES(3,0,'RELEASE')
INSERT INTO ROLE VALUES(4,0,'USER')
INSERT INTO ROLE VALUES(5,0,'RELEASE')
INSERT INTO ROLE VALUES(6,0,'ADMIN')
INSERT INTO ROLE VALUES(7,0,'USER')
INSERT INTO ROLE VALUES(8,0,'RELEASE')
INSERT INTO ROLE VALUES(9,0,'USER')
INSERT INTO USER VALUES(1,0,'admin')
INSERT INTO USER VALUES(2,1,'glua')
INSERT INTO USER VALUES(3,1,'glur')
INSERT INTO USER VALUES(4,0,'glu')
INSERT INTO USER_ROLE VALUES(1,1)
INSERT INTO USER_ROLE VALUES(1,2)
INSERT INTO USER_ROLE VALUES(1,3)
INSERT INTO USER_ROLE VALUES(2,4)
INSERT INTO USER_ROLE VALUES(2,5)
INSERT INTO USER_ROLE VALUES(2,6)
INSERT INTO USER_ROLE VALUES(3,7)
INSERT INTO USER_ROLE VALUES(3,8)
INSERT INTO USER_ROLE VALUES(4,9)
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,4 @@ environments {
url = "jdbc:hsqldb:mem:testDb"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:hsqldb:file:prodDb;shutdown=true"
}
}
}
65 changes: 65 additions & 0 deletions org.linkedin.glu-all/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Copyright 2010-2010 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

apply plugin: 'org.linkedin.cmdline'
apply plugin: 'org.linkedin.release'

configurations {
zookeeperPackages
}

dependencies {
zookeeperPackages spec.external.linkedinZookeeperCliPackage
zookeeperPackages spec.external.linkedinZookeeperServerPackage
}

cmdline {
// dependsOn = [
// ':agent:org.linkedin.glu.agent-server:package-assemble',
// ':agent:org.linkedin.glu.agent-cli:package-assemble',
// ':console:org.linkedin.glu.console-webapp:war'
// ]
resources << fileTree(dir: rootDir, includes: ['*.txt', '*.md', '*.html'])
cmdlineLogLevel = 'lifecycle'
}

def agentServerProject = evaluationDependsOn(':agent:org.linkedin.glu.agent-server')
def agentCliProject = evaluationDependsOn(':agent:org.linkedin.glu.agent-cli')
def consoleWebappProject = evaluationDependsOn(':console:org.linkedin.glu.console-webapp')

// customizing package-assemble task to add agent cli, agent server and war
project.'package-assemble'.doFirst {
File basePackage = project.convention.plugins.cmdline.assemblePackageFile

copy {
from agentServerProject.convention.plugins.cmdline.assemblePackageFile
into new File(basePackage, "org.linkedin.glu.agent-server-${version}")
}

copy {
from agentCliProject.convention.plugins.cmdline.assemblePackageFile
into new File(basePackage, "org.linkedin.glu.agent-cli-${version}")
}

copy {
from consoleWebappProject.tasks.getByPath('package-war').artifactFile
into new File(basePackage, "org.linkedin.glu.console-webapp-${version}")
}

configurations.zookeeperPackages.resolve().each { zkp ->
ant.untar(src: zkp, dest: basePackage, compression: 'gzip')
}
}
19 changes: 19 additions & 0 deletions project-spec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spec = [
versions: [
grails: '1.3.5',
groovy: '1.7.5',
jetty: '7.2.2.v20101205',
linkedinUtils: '1.2.1',
linkedinZookeeper: '1.2.1',
restlet: '2.0.1',
Expand Down Expand Up @@ -51,11 +52,29 @@ spec.external = [
groovy: "org.codehaus.groovy:groovy:${spec.versions.groovy}",
httpClient: "org.apache.httpcomponents:httpclient:4.0",
ivy: 'org.apache.ivy:ivy:2.2.0',
jettyPackage: [
group: "org.eclipse.jetty",
name: "jetty-distribution",
version: spec.versions.jetty,
ext: "tar.gz"
],
junit: 'junit:junit:4.4',
linkedinUtilsCore: "org.linkedin:org.linkedin.util-core:${spec.versions.linkedinUtils}",
linkedinUtilsGroovy: "org.linkedin:org.linkedin.util-groovy:${spec.versions.linkedinUtils}",
linkedinZookeeperCliImpl: "org.linkedin:org.linkedin.zookeeper-cli-impl:${spec.versions.linkedinZookeeper}",
linkedinZookeeperCliPackage: [
group: "org.linkedin",
name: "org.linkedin.zookeeper-cli",
version: spec.versions.linkedinZookeeper,
configuration: "package"
],
linkedinZookeeperImpl: "org.linkedin:org.linkedin.zookeeper-impl:${spec.versions.linkedinZookeeper}",
linkedinZookeeperServerPackage: [
group: "org.linkedin",
name: "org.linkedin.zookeeper-server",
version: spec.versions.linkedinZookeeper,
configuration: "package"
],
log4j: 'log4j:log4j:1.2.16',
mimeUtil: 'eu.medsea.mimeutil:mime-util:2.1.3',
restlet: "org.restlet.jse:org.restlet:${spec.versions.restlet}",
Expand Down
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ include ':agent:org.linkedin.glu.agent-api',
':agent:org.linkedin.glu.agent-server',
':agent:org.linkedin.glu.agent-tracker',
':console:org.linkedin.glu.console-webapp',
':console:org.linkedin.glu.console-server',
':provisioner:org.linkedin.glu.provisioner-agent',
':provisioner:org.linkedin.glu.provisioner-core'
':provisioner:org.linkedin.glu.provisioner-core',
':org.linkedin.glu-all'

0 comments on commit bf8785c

Please sign in to comment.