Table of Contents |
---|
Introduction
Info |
---|
If you would prefer to install DuraCloud from a binary distribution, you can find instructions for that process here. |
DuraCloud application software is composed of many parts. A breakdown of the primary pieces is as follows:
- DuraStore - this web application provides the access to and management of storage resources, which includes handling the storage portion of the DuraCloud REST API
- StorageProviders - this set is made up of the StorageProvider interfaces and the implementations which connect to distinct cloud stores (currently Amazon S3, Rackspace CloudFiles, and EMC Atmos); the storage providers which are currently supported are listed here.
- DurAdmin DuraService - this web application handles the deployment and management of services within DuraCloud, which includes handling the services portion of the DuraCloud REST API
- Services - the set of all deployable services, as well as the support projects that allow the DuraCloud services infrastructure to function
- ComputeProviders - this set is made up of the ComputeProvider interfaces and the implementation which connect to distinct cloud compute services (currently Amazon EC2, using the typica library)is the UI front end of DuraCloud, it provides users with a view into the information available from the other applications. DurAdmin uses the REST APIs of the other applications to communicate with them.
- Security - handles security for the DuraCloud applications
- Common - a set of projects which provide utilities for other portions of the codebase to reuse
The DuraCloud software, by its very nature, is designed to be integrated with underlying cloud storage and compute providers.
As As may be expected, these integrations are exercised through many "integration tests"these integrations are necessary for the system to be properly exercised. In order for DuraCloud to connect to these underlying providers, appropriate credentials must first be established and available to the build framework.
However, in order to get up and running quickly with the software, the baseline can be initially built with just its unit tests.
Once the developer has independently acquired credentials for one or more of the supported underlying storage providers (below) builds may then be run with integration tests.
This guide lays out the three tiers of building/testing the baseline:
be provided as part of the application configuration step. It is recommended that you acquire the necessary storage provider credentials prior to attempting to set up DuraCloud. Only one storage provider is required to run DuraCloud.
This guide lays out the steps necessary to begin using DuraCloud:
- Configure DuraCloud database
- Build and deploy the DuraCloud web applications
- Test your installation
- build with unit tests
- build with storage and services integration tests
- build with OSGi services container integration tests
Although this document is written from a Linux environment perspective, analogous builds/installations have been tested in Windows (but may have limitations, as noted below). Any comments or feedback are welcomed.
Prerequisites
Software that must be installed on your system prior to building/using DuraCloud
- Maven 2.2.1 or above
- Tomcat 6.x or above
- Java 6 (note: the djatoka service has compatibility issues with open-jdk)
- Subversion
Building DuraCloud
Info | ||
---|---|---|
|
- Java: Version 8 required
- The Oracle JDK is recommended for building DuraCloud, as this is the JDK used for DuraCloud testing.
- Maven 3.x
- Tomcat 8.x
- Git
- DuraCloud Management Console
- DuraCloud Mill
Setting up DuraCloud
Info |
---|
Any portions of the configuration below for which you need to include a replacement value will be written in all capital letters and included in brackets: [LIKE-THIS] |
Build and deploy the DuraCloud web applications
...
Check out latest stable release from
SubversionGitHub repository
Code Block svn cogit clone --branch duracloud-4.0.0 https://svngithub.duraspace.orgcom/duracloud/tags/duracloud-0.9.0
Set environment variables
Code Block export JAVA_OPTS="-XX:MaxPermSize=256m" export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
Configure Tomcat
$CATALINACode Block Add to $CATALINA_HOME/conf/tomcat-users.xml
No Format <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="admin"/> <user username="[ANY-USERNAME]" password="[ANY-PASSWORD]" roles="admin,manager-gui,manager-script"/> </tomcat-users>
Add to $CATALINA_HOME/
conf/
- Configure Maven2
- Add tomcat user to $M2_HOME/conf/settings.xml
No Format <servers> <server> <id>tomcat-server</id> <username>[ANY-USERNAME]</username> <password>[ANY-PASSWORD]</password> </server> </servers>
- Add tomcat user to $M2_HOME/conf/settings.xml
- Build with only unit tests
- From top of source tree
Note: Each of the maven2 project modules are configured to halt the build if there is a test failure. The only exception to this is the integration-test module which is configured to run through all of its tests regardless of failures. So the above build command can optionally exclude the '-PskipIntTests' flag if desired.Code Block mvn clean install -PskipIntTests
- From top of source tree
Info |
---|
Building in Windows: Currently the service projects which deploy as WAR files (beginning with WebAppUtilService) do not pass unit tests on a Windows environment due to limitations regarding the deployment of Tomcat instances. You may choose to either perform a build skipping tests "mvn clean install -DskipTests" or to allow the tests to run but not stop the build "mvn clean install -Dmaven.test.failure.ignore=true" |
Build with integration tests
This step assumes the successful completion of the previous build instructions.
As mentioned above, the integration tests require credentials in order to connect to the underlying storage providers. The tests themselves are configured to acquire these credentials from a locally created, encrypted database.
- Create unit-test-db
- From inside the //unit-test-db module, run:
Code Block mvn assembly:assembly java -jar target/unit-test-db-[VERSION]-db-util.jar
- From inside the //unit-test-db module, run:
- Running the above db util jar will provide a commandline interface for adding credentials
- Add credentials for s3, emc, rackspace, root-user
- Set the root-user to username: 'root', password: 'rpw' to just use the application default.
- See root user discussion below for ways of changing the default.
- Add the connection details for the unit-test-db to $M2_HOME/conf/settings.xml
No Format <profile> <id>always</id> <properties> <duracloud.home>[LOCATION-WHERE-APPLICATION-HAS-WRITE-ACCESS]</duracloud.home> <unit.database.home.default>[LOCATION-WHERE-UNIT-TEST-DB-WAS-CREATED]</unit.database.home.default> <unit.database.password.default>[UNIT-TEST-DB-BOOT-PASSWORD]</unit.database.password.default> </properties> </profile> <activeProfiles> <activeProfile>always</activeProfile> </activeProfiles>
- where duracloud.home is the directory under which the logs and osgi-container will be placed
- where unit.database.home.default is the location of the unit-test-database created above
- where unit.database.password.default is the boot password used during creation of the unit-test-database above
- The integration tests also expect a registry (read: 'space') of services to be available within the primary storage provider of service storage host
- The naming of the space follows the convention "duracloud-<version>-service-repo"
- The services to be loaded into the registry can be found in the target directories of each of the service projects
- See discussion below about application configuration, including the service storage host
- Build with unit and integration tests
- From top of source tree
Code Block mvn clean install
- From top of source tree
- As mentioned before, if there are any failures in the //integration-test module, the build will still complete, but the failures will be listed
Build with OSGi services container integration tests
This step assumes the successful completion of the previous build instructions
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
Optional items
Code coverage
server.xml
Add the config attribute "URIEncoding" with value "UTF-8" to your Tomcat Connector. Your connector may look like the following:
No Format <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
Create a duracloud properties file (/any/path/to/duracloud.properties) that contains the following keys:
No Format mill.db.name=<mill db name> mill.db.port=<mysql port> mill.db.host=<mysql host> mill.db.user=<username> mill.db.pass=<password> db.name=<ama db name> db.host=<mysql ama host> db.port=<mysql ama port> db.user=<username> db.pass=<password>
Add -Dduracloud.config.file=/any/path/to/duracloud.properties to your JAVA_OPTS or CATALINA_OPTS environment variables. You can also set these values in $CATALINA_HOME/bin/setenv.sh (linux,osx) or $CATALINA_HOME/bin/setenv.bat (windows). The duracloud.config.file system property can also refer to an Amazon S3 address using the s3://<bucket>/<path to file> syntax provided your tomcat instance is running on an instance with the appropriate AWS credentials. More information on AWS credentials management.
Start Tomcat
Code Block $CATALINA_HOME/bin/startup.sh
- Configure Maven3
Add tomcat user to $M2_HOME/conf/settings.xml. Make sure that the username and password used here match those included in the tomcat-users.xml file.
No Format <servers> <server> <id>tomcat-server</id> <username>[ANY-USERNAME]</username> <password>[ANY-PASSWORD]</password> </server> </servers>
- Build
From top of the source tree, execute (note that this build runs unit tests, but not integration tests):
Code Block mvn clean install -DskipIntTests
- Bonus, running Integration Tests
- Grab a copy of the file in the codebase under common-json/src/main/resources/test-config.json and place it somewhere on your system
- You'll need an account for each of the providers to be tested. Update the JSON file to include your credentials. These tests actually communicate with each storage provider and verify that the calls being made work properly
- Add an environment variable called DURACLOUD-TEST-CONFIG with the value being the full path to your updated credentials JSON file. A sample credential configuration file can be found in the baseline at <project root>/integration/src/test/resources/test-config.json
From the top of the source tree, execute
Code Block mvn clean install -pl integration
Test your installation
- Once all of the above steps have been completed, your DuraCloud should be ready to test.
- Go to http://localhost:8080/duradmin (change host or port as necessary).
- Log in using valid DuraCloud Management Console credentials.
- You should be able to view, add, update, and delete spaces and content in Spaces tab
- Congratulations! You now have a functional DuraCloud installation.
Optional items
SyncTool installers
- The installers for the Sync Tool (Windows, Mac, Linux) are built using BitRock InstallBuilder Enterprise, so this tool must be installed locally.
- Download and install BitRock InstallBuilder Enterprise version 15.1.0 or above
- Place the license file for InstallBuilder in the InstallBuilder installation directory
- Update the maven settngs.xml file ($M2_HOME/conf/settings.xml) to include the path to the installbuilder executableIf you plan on using Clover, the following element needs to be added to your maven 'settings.xml'
No Format Add a duracloud profile to include the InstallBuilder path, and include the duracloud profile in the set of active profiles
Code Block
<profiles> <profile>
<id>duracloud</id>
<properties>
<installbuilder.executable.path>[FULL-PATH-TO-BITROCK-INSTALLBUILDER-EXECUTABLE]</installbuilder.executable.path> </properties> </profile> </profiles> ... <activeProfiles> <activeProfile>duracloud</activeProfile>
</activeProfiles>
From the //synctoolui directory in the DuraCloud source tree, execute
Code Block
mvn
clean install -Pinstallers
- The installers can be found under the synctoolui/target directory
//target/site/clover/
Logging
- DuraCloud uses the SLF4j SLF4J logging framework backed by the LogBack implementation
- By adding either a logback.xml or logback-test.xml file on the classpath, logging configuration can be customized
DuraCloud internal tools
ServicesAdmin CLI
- This tool provides a commandline interface for interacting with the 'services-admin' installed in a running OSGi container (see notes above for starting the container)
- To build and run the CLI, from within the //servicesadminclient module
Code Block mvn assembly:assembly java -cp target/servicesadminclient-[VERSION]-cli.jar
Application initialization utility
- This utility takes a config file (example at //app-config/src/main/resources/init.props) and initializes an instance of duracloud
- Until the applications durastore and duraservice are initialized, they are non-functional
- To build and run the app-config utility, from within the //app-config module
Code Block mvn assembly:assembly java -jar target/app-config-1.0.0-driver.jar
StoreClient package
Building Java client packages
To
Tocreate a distributable zip of the storeclient
and itsor reportclient which includes their dependencies, from within the project directory (//storeclient, //reportclient) run
Code Block mvn install -Ppackage-client
- The packaged zip will be found at /storeclient/target/store-client.zip
Misc configuration/discussion
Services on Windows
The following services do not function in a Windows deployment environment
- WebAppUtilService
- HelloWebappWrapper
- J2KService
- ImageMagickService
If you would like to run the ImageConversionService, you must install ImageMagick and have its /bin directory in your PATH, which is essentially what the ImageMagickService does in a linux environment.
root user
application config
...
- under the project's target directory