Skip to content

Commit

Permalink
Dockerized development environment
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed Feb 23, 2015
1 parent 4f15e8a commit 7d5e7bb
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 52 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ The VOMS Admin service is a web application providing tools for administering
the VOMS VO structure. It provides an intuitive web user interface for daily
administration tasks.

## Build instructions
## Build with Maven

You will need maven 3 to build this project.
Requirements:

mvn package
- Java 6
- Maven 3

Build it with the following command:

will build the artifacts.
mvn package

### Eclipse import instructions
## Eclipse import instructions

To import the project in Eclipse for development, do as follows:

Expand All @@ -28,7 +31,21 @@ To import the project in Eclipse for development, do as follows:
From Eclipse menu, select “Import Existing Maven projects...”, and
point it to this project root directory.

## Dockerized development environment

Reauirements:

- Docker >= v.1.5.0
- Fig >= 1.0.1

Running

fig up

Will setup a running voms-admin-server instance, running a single VO named test.

## RPM package build

See README.md in ./package/rpm directory.


55 changes: 55 additions & 0 deletions fig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
conf:
image: busybox
volumes:
- /etc/voms-admin
command: true

data:
image: busybox
volumes:
- /var/lib/mysql
command: true

db:
image: mariadb:latest
ports:
- "3306"
volumes_from:
- data

environment:
MYSQL_ROOT_PASSWORD: pwd
MYSQL_USER: voms
MYSQL_PASSWORD: pwd
MYSQL_DATABASE: voms_test

mail:
image: jlynn/python-smtp
ports:
- "25"

adminserver:
image: italiangrid/voms-admin-server
hostname: dev
domainname: local.io
volumes:
- .:/code:ro
- ~/.jrebel:/home/voms/.jrebel:rw
- ~/jrebel:/jrebel:ro
- /var/log/voms-admin
volumes_from:
- conf
- data
ports:
- "8443:8443"
- "1044:1044"
links:
- db
- mail

environment:
MAILHOST: mail
MYSQL_ROOT_PASSWORD: pwd
ENABLE_JREBEL: y
# VOMS_JAVA_OPTS: -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=1044,suspend=n
# VOMS_SKIP_CONFIGURE: y
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<commons-cli.version>1.1</commons-cli.version>
<license-plugin.version>1.9.0</license-plugin.version>
<log.dir>var/log/voms-admin</log.dir>
<voms.source.prefix>/opt/voms-admin</voms.source.prefix>

<voms.source.prefix>/code</voms.source.prefix>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -184,7 +184,7 @@
</plugins>
</pluginManagement>
<plugins>
<!--
<!--
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
Expand All @@ -201,7 +201,7 @@
</plugin>
-->
<plugin>

<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down
79 changes: 39 additions & 40 deletions voms-admin-server/src/config/logback.container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,42 @@
-->

<configuration>

<logger name="org.eclipse.jetty" level="ERROR" />

<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${package.prefix}/${log.dir}/server.log</File>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${package.prefix}/${log.dir}/server-%d{yyyy-MM-dd}.log</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS'Z',UTC} - %level [%logger{0}] - %msg%n</pattern>
</encoder>
</appender>

<appender name="AUTHN"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${package.prefix}/${log.dir}/server-authn.log</File>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${package.prefix}/${log.dir}/server-authn-%d{yyyy-MM-dd}.log</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS'Z',UTC} - %level [%logger{0}] - %msg%n</pattern>
</encoder>
</appender>


<logger name="org.italiangrid.utils.https.impl.canl.CANLListener" level="INFO" additivity="false">
<appender-ref ref="AUTHN" />
</logger>

<root level="INFO">
<appender-ref ref="FILE" />
</root>

</configuration>
<configuration scan="true">

<logger name="org.eclipse.jetty" level="ERROR" />

<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${package.prefix}/${log.dir}/server.log</File>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${package.prefix}/${log.dir}/server-%d{yyyy-MM-dd}.log</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS'Z',UTC} - %level [%logger{0}] - %msg%n</pattern>
</encoder>
</appender>

<appender name="AUTHN"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${package.prefix}/${log.dir}/server-authn.log</File>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${package.prefix}/${log.dir}/server-authn-%d{yyyy-MM-dd}.log</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS'Z',UTC} - %level [%logger{0}] - %msg%n</pattern>
</encoder>
</appender>

<logger name="org.italiangrid.utils.https.impl.canl.CANLListener" level="INFO" additivity="false">
<appender-ref ref="AUTHN" />
</logger>

<root level="INFO">
<appender-ref ref="FILE" />
</root>

</configuration>
5 changes: 2 additions & 3 deletions voms-container/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
-->

<configuration>
<configuration scan="true">

<logger name="org.eclipse.jetty" level="ERROR" />

<!-- NORMALLY YOU SHOULD NOT EDIT BELOW THIS POINT -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
Expand All @@ -35,5 +34,5 @@
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>

</configuration>

0 comments on commit 7d5e7bb

Please sign in to comment.