CGSpace Technical Overview
Alan Orth
IITA/AfricaRice CGSpace Training
Ibadan, Nigeria, 19 October 2015
What is DSpace?
Java!
Relies heavily on XML and XSL
Web interfaces are written in XSLT and CSS (or
JSP, but eww!)
Build process uses maven and ant
Roughly follows semantic versioning (aka semver),
aka: MAJOR.MINOR
Current version is 5.3, with 5.4 coming soon
CGSpace Technology Stack
NGINX HTTP server
●TLS termination, SPDY, redirects, virtual hosts
Tomcat servlet engine
●Runs DSpace, bound to localhost
PostgreSQL database server
Ubuntu 14.04 GNU/Linux OS
●Long-term support release, good mix of stable / new
CGSpace Technology Stack
NGINX
Tomcat
https://cgspace.cgiar.org
http://localhost
PostgreSQLhttp://localhost
HTTP, virtual
hosting, redirects
Java application
server
Metadata, users,
etc
Nginx (“Engine X”)
●High-performance web server
●Much easier to do things like redirects, set HTTP
headers, virtual hosting (domains, ports, etc)
●Provides more robust TLS (HTTPS) support
●Gives us SPDY/HTTP2!
●Serves static files like CSS, JS, and images directly
from the disk—so we can send file modified time
and gzip compress!
Nginx Configuration
●Nginx from official nginx.org repository (distro
version is too old)
●Config is in /etc/nginx
●Strong TLS cipher suites ("forward secret")
●Redirect almost all requests to TLS (except RSS,
because Google Feedburner is lame)
Tomcat Configuration
Latest Tomcat 7 in Ubuntu 14.04
Config in /etc/tomcat7
JAVA_OPTS are in /etc/default/tomcat7
(memory settings!)
Runs as tomcat7 user
Bind on localhost interfaces only (security and
peace of mind)
Get all requests from nginx with Host header
intact
Upstream Git Branches
master
Development on
master branch
Once a year a new
major release is
branched (eg, 5_x)
New minor releases
are tagged on
branches (eg, 5.4)
CGSpace Git Branches
Don’t worry about upstream master!
We base 5_x-prod on the 5_x branch
We merge point releases into 5_x-prod
Develop in “topic” branches, ie 5_x-iita-theme
Short-lived 5_x-dev branch for testing all changes
5_X
5.1
5.2
5.3
5.4
“CGSpace”
nginx 1.8
Runs 5_x-prod branch
8GB RAM, 6CPU
Production and Development
“DSpace Test”
nginx 1.9
Runs 5_x-dev branch
4GB RAM, 4CPU
All changes tested on DSpace Test first,
deployed on CGSpace every 1–2 weeks
https://github.com/ilri/DSpace
Open Source Workflow on GitHub
Open Source Workflow on GitHub
Keep your 5_x-prod 100% in sync with ILRI
Develop your changes in topic branches
Push code to your fork on GitHub
Make “Pull Requests” against ILRI’s 5_x-prod
Preparation
Sign up for GitHub
Fork the ILRI DSpace repository:
https://github.com/ilri/DSpace
Setup VirtualBox Appliance
Install 64-bit VirtualBox
Import DSpace 5 appliance
Boot it
Wait a minute or two for Tomcat to start
Check DSpace:
http://dspace.127.0.0.1.nip.io:8080
This presentation has a Creative Commons licence. You are free to re-use or distribute this work for non-commercial purposes,
provided credit is given to ILRI.
better lives through livestock
ilri.org
Box 30709, Nairobi 00100, Kenya
Phone +254 20 422 3000
Fax +254 20 422 3001
Email ilri-kenya@cgiar.org
ilri.org
better lives through livestock
ILRI is a member of the CGIAR consortium
ILRI has offices in:
Central America • East Africa
South Asia • Southeast and East Asia
Southern Africa • West Africa

CGSpace technical overview

  • 1.
    CGSpace Technical Overview AlanOrth IITA/AfricaRice CGSpace Training Ibadan, Nigeria, 19 October 2015
  • 2.
    What is DSpace? Java! Reliesheavily on XML and XSL Web interfaces are written in XSLT and CSS (or JSP, but eww!) Build process uses maven and ant Roughly follows semantic versioning (aka semver), aka: MAJOR.MINOR Current version is 5.3, with 5.4 coming soon
  • 3.
    CGSpace Technology Stack NGINXHTTP server ●TLS termination, SPDY, redirects, virtual hosts Tomcat servlet engine ●Runs DSpace, bound to localhost PostgreSQL database server Ubuntu 14.04 GNU/Linux OS ●Long-term support release, good mix of stable / new
  • 4.
  • 5.
    Nginx (“Engine X”) ●High-performanceweb server ●Much easier to do things like redirects, set HTTP headers, virtual hosting (domains, ports, etc) ●Provides more robust TLS (HTTPS) support ●Gives us SPDY/HTTP2! ●Serves static files like CSS, JS, and images directly from the disk—so we can send file modified time and gzip compress!
  • 6.
    Nginx Configuration ●Nginx fromofficial nginx.org repository (distro version is too old) ●Config is in /etc/nginx ●Strong TLS cipher suites ("forward secret") ●Redirect almost all requests to TLS (except RSS, because Google Feedburner is lame)
  • 7.
    Tomcat Configuration Latest Tomcat7 in Ubuntu 14.04 Config in /etc/tomcat7 JAVA_OPTS are in /etc/default/tomcat7 (memory settings!) Runs as tomcat7 user Bind on localhost interfaces only (security and peace of mind) Get all requests from nginx with Host header intact
  • 8.
    Upstream Git Branches master Developmenton master branch Once a year a new major release is branched (eg, 5_x) New minor releases are tagged on branches (eg, 5.4)
  • 9.
    CGSpace Git Branches Don’tworry about upstream master! We base 5_x-prod on the 5_x branch We merge point releases into 5_x-prod Develop in “topic” branches, ie 5_x-iita-theme Short-lived 5_x-dev branch for testing all changes 5_X 5.1 5.2 5.3 5.4
  • 10.
    “CGSpace” nginx 1.8 Runs 5_x-prodbranch 8GB RAM, 6CPU Production and Development “DSpace Test” nginx 1.9 Runs 5_x-dev branch 4GB RAM, 4CPU All changes tested on DSpace Test first, deployed on CGSpace every 1–2 weeks
  • 11.
  • 12.
    Open Source Workflowon GitHub Keep your 5_x-prod 100% in sync with ILRI Develop your changes in topic branches Push code to your fork on GitHub Make “Pull Requests” against ILRI’s 5_x-prod
  • 13.
    Preparation Sign up forGitHub Fork the ILRI DSpace repository: https://github.com/ilri/DSpace
  • 14.
    Setup VirtualBox Appliance Install64-bit VirtualBox Import DSpace 5 appliance Boot it Wait a minute or two for Tomcat to start Check DSpace: http://dspace.127.0.0.1.nip.io:8080
  • 15.
    This presentation hasa Creative Commons licence. You are free to re-use or distribute this work for non-commercial purposes, provided credit is given to ILRI. better lives through livestock ilri.org Box 30709, Nairobi 00100, Kenya Phone +254 20 422 3000 Fax +254 20 422 3001 Email ilri-kenya@cgiar.org ilri.org better lives through livestock ILRI is a member of the CGIAR consortium ILRI has offices in: Central America • East Africa South Asia • Southeast and East Asia Southern Africa • West Africa

Editor's Notes

  • #4 Mention clean URLS, :8080 and /xmlui?
  • #11 Mention that changes are tested on DSpace Test, make pull requests against prod!
  • #12 Issues, pull requests, branches, commits. 100% public workflow.