SlideShare uma empresa Scribd logo
APACHE SLING & FRIENDS TECH MEETUP
BERLIN, 25-27 SEPTEMBER 2017
Building an Apache Sling Rendering Farm
Bertrand Delacretaz
@bdelacretaz
Sling committer and PMC member

Principal Scientist, Adobe AEM team
slides revision 2017-09-25
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 2
What are we building?setting the stage
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 3
How is Sling used today?
Load

BalancingThe Web
Publishing Instances
Sling instances dedicated to single tenants or “friendly” tenants.
Rendering
+ Caching
Content

Repository
Rendering
+ Caching
Content

Repository
Rendering
+ Caching
Content

Repository
Rendering
+ Caching
Content

Repository
Content

Repository
Authoring
Content Distribution
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 4
A Massive Sling Rendering/Processing Farm?
Content

Repository
Resource

Resolution
Scripting +

Rendering
Resource

Resolution
Resource

Resolution
Resource

Resolution
Scripting +

Rendering
Scripting +

Rendering
Scripting +

Rendering
Load

Balancing
Load

Balancing
Elastic scaling at each stage
Multiple developers (“tenants”) see their own world only
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 5
Federated ServicesThis 2017 after all
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 6
Content

Repository
Resource

Resolver
Scripting and
Rendering
Script
Resolver
HTTP

front-end Sling Engine
Microservices!
Nice and trendy,
but will that
perform?
HTTP
HTTP
HTTP HTTP HTTP
HTTP
Each component is an independent HTTP-based service, aka “religious microservices”
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 7
The Sling PipelineFaithfully serving requests since 2007!
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 8
Content

Repository
Resource

Resolver
Scripting and
Rendering
Script
Resolver
Resource ScriptRequest Output
Sling Request Processing Pipeline
1 2 3 4
Conceptually, the request hits the repository first, to get the Resource.
Scripts and Servlets are equivalent, considering scripts only here.
All in-memory and in-process!
sling:include
5..N
content aggregation!
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 9
Content

Repository
Scripting and
Rendering
Script
Resolver
Scripts
Output
Federated Services Friendly?
Resource

Resolver
Content
Aggregator
Aggregated

Content
Request
Process boundaries
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 10
Reasonably Federated?Can we get isolation AND performance?
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 11
HTTP

front-end
Reasonably Federated Sling Rendering Farm?
Aggregated

Content
Content

Repository
Resource

Resolver
Content
Aggregator
Content Provider

Service
Content Rendering

Service
Scripting and
Rendering
Script
Resolver
Scripts

Repository
Output
It’s still mostly Sling, with the addition of a
(scripted?) content aggregation step.
Federated services provide more deployment and
scaling options.
Sandboxed
Execution
Isolated
Content
Sandboxed
Execution
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 12
Sandboxing & IsolationHow?
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 13
Sandboxing & Isolation?
Scripting and
Rendering
Sandboxed
Execution
Content

Repository
Isolated
Content
Content
Aggregator
Sandboxed
Execution
Repository Access Control
can work but require a dynamic
search path in Sling, see our
experiments. Impacts caching, and
mapping of incoming to resource
paths is needed.Tried and tested.
Repository jails look possible
with probable impact on Sling
internals. Same with multiple
SlingRepository services. New
and more like a blacklist.
Custom, restricted languages
are the safest? HTL (Use-API?),
Handlebars?
Sandboxing Nashorn
(JavaScript) looks possible but not
ideal, see our experiments.
Sandboxing Java is not realistic-
IBM canceled multi tenant JVM
project for example.
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 14
But it’s a VM, right?
Oak
Libraries Sling Engine
JavaVirtual Machine
content
Oak
Libraries Sling Engine
JavaVirtual Machine
content
Oak
Libraries Sling Engine
JavaVirtual Machine
content
Perfect isolation!
Java classes

memory space
Application

memory space
Java classes

memory space
Application

memory space
Java classes

memory space
Application

memory space
But suboptimal use of resources!
(and containers wouldn’t help)
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 15
Sandboxing scripting languages?
<%
var length = 0;
if (request.getRequestParameter("file") != null) {
var file = null;
// store file
var reqPara = request.getRequestParameter("file");
var is = reqPara.getInputStream();
file = Packages.java.io.File.createTempFile("posttest", ".txt");
var fout = new Packages.java.io.FileOutputStream(file);
var c;
while ((c = is.read()) != -1) {
fout.write(c);
}
fout.close();
// read length
length = file.length();
}
%>
OS
Resources
Infinite
Loops
Java classes
& services
Memory

Usage?
Many things need to be limited.

Whitelist approach is much safer -> custom languages?

HTL inherently sandboxed, except its Use-objects
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 16
Containers?
Oak
Libraries Sling Engine
OS container
content
Java classes

memory space
Application

memory space
SMALL!
Shared Memory
Pools, Caches etc.
memory
Oak
Libraries Sling Engine
OS container
content
Java classes

memory space
Application

memory space
SMALL!
Oak
Libraries Sling Engine
OS container
content
Java classes

memory space
Application

memory space
SMALL!
Same problem as multiple JVMs
Sharing caches, compiled scripts etc. can be a pragmatic solution.
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 17
What do we do?
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 18
Hybrid Sling Rendering Farm
Annotated
Aggregated
Content
HTTP

front-end
HTTP

routing
Scripting +
Rendering
Script
Resolver scripts
Shared Services
Custom
Code
Script
Resolver scripts
Tenant-Specific Services
servletscontent
Resource

Resolver
Content
Aggregator
Oak
Libraries
Shared Services
Sandboxed
Execution
New

Component
Content-driven
routing
Isolated

Content
Dynamic
Search Path
Provides the flexibility of Sling via tenant-specific services and dynamic routing.
Uses shared services for the common parts.
Allows for billable options depending on the actual routing.
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 19
Experimentsbuilding blocks that might be reusable
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 20
Resolving new types of scripts Experim
ent
Script
Resolver
Client

GET
Request
Wrapped

AGG
Request
Wrap the request to make it appear as an
AGG (*) request and pass that to the
Sling ServletResolver.
Adapt the return SlingScript to an
InputStream to read its text.
(*) or any other non-existent HTTP verb.
Content

Repository
/apps

/myapp
/AGG.js
AGG.js

script

text
Code at https://github.com/bdelacretaz/sling-adaptto-2017 (ContentBVP.java)
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 21
Resolving a SLING-CONTENT script Experim
ent
Code at https://github.com/bdelacretaz/sling-adaptto-2017 (ContentBVP.java)
String getAggregatorScript(SlingHttpServletRequest r) {
String result = null;
Servlet s =
servletResolver.resolveServlet(
new ChangeMethodRequestWrapper(r, "SLING-CONTENT"));
if(s instanceof SlingScript) {
InputStream is = ((SlingScript)s).getScriptResource()
.adaptTo(InputStream.class); }
if(is != null) {
result = IOUtils.toString(is)
}
}
return result;
}
adaptTo() Bonus Points!
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 22
Content Aggregation with Sling Query Experim
entvar $ = Packages.org.apache.sling.query.SlingQuery.$
var SearchStrategy =
Packages.org.apache.sling.query.api.SearchStrategy
var resourceResolver = resource.getResourceResolver()
var result = {
siblings : $(resource).siblings(),
rootChildren : $(resource).parents().last().children(),
queryResult :
$(resourceResolver)
.searchStrategy(SearchStrategy.QUERY)
.find("nt:base[title=foo]")
} Used in a BindingsValuesProvider?
Or in a custom json renderer servlet which runs this script.
Inherently sandboxed due to custom language.
https://sling.apache.org/documentation/bundles/sling-query.html
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 23
Dynamic scripts/servlet search path Experim
entif(dynamicServletResolver.canResolve(resource)) {
servlet = dynamicServletResolver.resolveServlet(request);
} else {
…existing resolver code
}
A fairly simple change to the SlingServletResolver - should evolve
into a real extension point if desired, and probably get the
request as well.
Tested in SLING-4386 - another multitenant experiment which
provides tenant-specific scripts but no real isolation.
Currently requires disabling the servlet resolution cache.
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 24
Nashorn (JavaScript) sandboxing (Java Delight) Experim
entNashornSandbox {
allow(final Class<?> clazz);
injectGlobalVariable(String variableName, Object object);
setMaxCPUTime(long limitMsec);
Object eval(final String javaScriptCode);
allowPrintFunctions(boolean v);
allowReadFunctions(boolean v);
...more allow functions
// $ARG, $ENV, $EXEC...
allowGlobalsObjects(final boolean v);
}
Uses Nashorn’s ClassFilter to block Java classes
Sandboxing rewrites standard methods + user code- > blacklisting, not ideal
https://github.com/javadelight/delight-nashorn-sandbox (Java Delight Suite)
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 25
CODAwhere to now?
Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 26
CODA
Thank you for attending!
I’m Bertrand Delacretaz (@bdelacretaz)
In-memory nature of Sling is an important
differentiator, in good and bad ways!
Hybrid Rendering Farm promising - do you need it?
Sandboxing is difficult, whitelisting much
preferred, custom languages?
Reusable

experiments?

Mais conteúdo relacionado

Mais procurados

Rh developers fat jar smackdown
Rh developers   fat jar smackdownRh developers   fat jar smackdown
Rh developers fat jar smackdown
Red Hat Developers
 
DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains  DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains
Docker, Inc.
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
kanedafromparis
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
Ideato
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
Docker, Inc.
 
Writing a Gem with native extensions
Writing a Gem with native extensionsWriting a Gem with native extensions
Writing a Gem with native extensions
Tristan Penman
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
Jonathan Giannuzzi
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Dana Luther
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
Giacomo Bagnoli
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
Ben Hall
 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHP
Chris Tankersley
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
Ben Hall
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
Schalk Cronjé
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
Larry Cai
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
Workhorse Computing
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
Przemyslaw Koltermann
 
Docker
DockerDocker
Docker
Cary Gordon
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
Dana Luther
 
Cloud hybridation leveraging on Docker 1.12
Cloud hybridation leveraging on Docker 1.12Cloud hybridation leveraging on Docker 1.12
Cloud hybridation leveraging on Docker 1.12
Ludovic Piot
 

Mais procurados (20)

Rh developers fat jar smackdown
Rh developers   fat jar smackdownRh developers   fat jar smackdown
Rh developers fat jar smackdown
 
DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains  DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Writing a Gem with native extensions
Writing a Gem with native extensionsWriting a Gem with native extensions
Writing a Gem with native extensions
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHP
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
Docker
DockerDocker
Docker
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Cloud hybridation leveraging on Docker 1.12
Cloud hybridation leveraging on Docker 1.12Cloud hybridation leveraging on Docker 1.12
Cloud hybridation leveraging on Docker 1.12
 

Semelhante a Building an Apache Sling Rendering Farm

ABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS GlueABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS Glue
Amazon Web Services
 
Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?
Bertrand Delacretaz
 
RESTful OSGi middleware for NoSQL databases with Docker
RESTful OSGi middleware for NoSQL databases with DockerRESTful OSGi middleware for NoSQL databases with Docker
RESTful OSGi middleware for NoSQL databases with Docker
Bertrand Delacretaz
 
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data EverywhereApache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Ganesh Raju
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Amazon Web Services
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
John Schneider
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
Sadayuki Furuhashi
 
Infra space talk on Apache Spark - Into to CASK
Infra space talk on Apache Spark - Into to CASKInfra space talk on Apache Spark - Into to CASK
Infra space talk on Apache Spark - Into to CASK
Rob Mueller
 
CRX Best practices
CRX Best practicesCRX Best practices
CRX Best practices
lisui0807
 
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Michael Mattsson
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
mfrancis
 
Building an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable ScaleBuilding an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable Scale
Merelda
 
H2O PySparkling Water
H2O PySparkling WaterH2O PySparkling Water
H2O PySparkling Water
Sri Ambati
 
Apache spark with java 8
Apache spark with java 8Apache spark with java 8
Apache spark with java 8
Janu Jahnavi
 
Apache spark with java 8
Apache spark with java 8Apache spark with java 8
Apache spark with java 8
Janu Jahnavi
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
Bertrand Delacretaz
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
Amazon Web Services
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
Amazon Web Services
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
Bertrand Delacretaz
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
rich fernandez
 

Semelhante a Building an Apache Sling Rendering Farm (20)

ABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS GlueABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS Glue
 
Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?
 
RESTful OSGi middleware for NoSQL databases with Docker
RESTful OSGi middleware for NoSQL databases with DockerRESTful OSGi middleware for NoSQL databases with Docker
RESTful OSGi middleware for NoSQL databases with Docker
 
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data EverywhereApache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Infra space talk on Apache Spark - Into to CASK
Infra space talk on Apache Spark - Into to CASKInfra space talk on Apache Spark - Into to CASK
Infra space talk on Apache Spark - Into to CASK
 
CRX Best practices
CRX Best practicesCRX Best practices
CRX Best practices
 
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
 
Building an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable ScaleBuilding an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable Scale
 
H2O PySparkling Water
H2O PySparkling WaterH2O PySparkling Water
H2O PySparkling Water
 
Apache spark with java 8
Apache spark with java 8Apache spark with java 8
Apache spark with java 8
 
Apache spark with java 8
Apache spark with java 8Apache spark with java 8
Apache spark with java 8
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
 

Mais de Bertrand Delacretaz

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?
Bertrand Delacretaz
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity
Bertrand Delacretaz
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaboration
Bertrand Delacretaz
 
Open Source Changes the World!
Open Source Changes the World!Open Source Changes the World!
Open Source Changes the World!
Bertrand Delacretaz
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...
Bertrand Delacretaz
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019
Bertrand Delacretaz
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?
Bertrand Delacretaz
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018
Bertrand Delacretaz
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)
Bertrand Delacretaz
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenches
Bertrand Delacretaz
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Bertrand Delacretaz
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache Way
Bertrand Delacretaz
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017
Bertrand Delacretaz
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017
Bertrand Delacretaz
 
Who needs meetings? Asynchronous Decision Making to the rescue
Who needs meetings? Asynchronous Decision Making to the rescueWho needs meetings? Asynchronous Decision Making to the rescue
Who needs meetings? Asynchronous Decision Making to the rescue
Bertrand Delacretaz
 
Simple software is hard...don't give up!
Simple software is hard...don't give up!Simple software is hard...don't give up!
Simple software is hard...don't give up!
Bertrand Delacretaz
 
I will NOT attend your meeting - I'm an Open Source person
I will NOT attend your meeting - I'm an Open Source personI will NOT attend your meeting - I'm an Open Source person
I will NOT attend your meeting - I'm an Open Source person
Bertrand Delacretaz
 
Open Development in the Enterprise, 19 minutes 2016 version
Open Development in the Enterprise, 19 minutes 2016 versionOpen Development in the Enterprise, 19 minutes 2016 version
Open Development in the Enterprise, 19 minutes 2016 version
Bertrand Delacretaz
 
Will the Apache Maturity Model save your project?
Will the Apache Maturity Model save your project?Will the Apache Maturity Model save your project?
Will the Apache Maturity Model save your project?
Bertrand Delacretaz
 
ApacheCon:Core EU 2015: State of the Feather
ApacheCon:Core EU 2015: State of the FeatherApacheCon:Core EU 2015: State of the Feather
ApacheCon:Core EU 2015: State of the Feather
Bertrand Delacretaz
 

Mais de Bertrand Delacretaz (20)

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaboration
 
Open Source Changes the World!
Open Source Changes the World!Open Source Changes the World!
Open Source Changes the World!
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenches
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache Way
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017
 
Who needs meetings? Asynchronous Decision Making to the rescue
Who needs meetings? Asynchronous Decision Making to the rescueWho needs meetings? Asynchronous Decision Making to the rescue
Who needs meetings? Asynchronous Decision Making to the rescue
 
Simple software is hard...don't give up!
Simple software is hard...don't give up!Simple software is hard...don't give up!
Simple software is hard...don't give up!
 
I will NOT attend your meeting - I'm an Open Source person
I will NOT attend your meeting - I'm an Open Source personI will NOT attend your meeting - I'm an Open Source person
I will NOT attend your meeting - I'm an Open Source person
 
Open Development in the Enterprise, 19 minutes 2016 version
Open Development in the Enterprise, 19 minutes 2016 versionOpen Development in the Enterprise, 19 minutes 2016 version
Open Development in the Enterprise, 19 minutes 2016 version
 
Will the Apache Maturity Model save your project?
Will the Apache Maturity Model save your project?Will the Apache Maturity Model save your project?
Will the Apache Maturity Model save your project?
 
ApacheCon:Core EU 2015: State of the Feather
ApacheCon:Core EU 2015: State of the FeatherApacheCon:Core EU 2015: State of the Feather
ApacheCon:Core EU 2015: State of the Feather
 

Último

办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 

Último (16)

办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 

Building an Apache Sling Rendering Farm

  • 1. APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Building an Apache Sling Rendering Farm Bertrand Delacretaz @bdelacretaz Sling committer and PMC member
 Principal Scientist, Adobe AEM team slides revision 2017-09-25
  • 2. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 2 What are we building?setting the stage
  • 3. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 3 How is Sling used today? Load
 BalancingThe Web Publishing Instances Sling instances dedicated to single tenants or “friendly” tenants. Rendering + Caching Content
 Repository Rendering + Caching Content
 Repository Rendering + Caching Content
 Repository Rendering + Caching Content
 Repository Content
 Repository Authoring Content Distribution
  • 4. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 4 A Massive Sling Rendering/Processing Farm? Content
 Repository Resource
 Resolution Scripting +
 Rendering Resource
 Resolution Resource
 Resolution Resource
 Resolution Scripting +
 Rendering Scripting +
 Rendering Scripting +
 Rendering Load
 Balancing Load
 Balancing Elastic scaling at each stage Multiple developers (“tenants”) see their own world only
  • 5. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 5 Federated ServicesThis 2017 after all
  • 6. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 6 Content
 Repository Resource
 Resolver Scripting and Rendering Script Resolver HTTP
 front-end Sling Engine Microservices! Nice and trendy, but will that perform? HTTP HTTP HTTP HTTP HTTP HTTP Each component is an independent HTTP-based service, aka “religious microservices”
  • 7. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 7 The Sling PipelineFaithfully serving requests since 2007!
  • 8. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 8 Content
 Repository Resource
 Resolver Scripting and Rendering Script Resolver Resource ScriptRequest Output Sling Request Processing Pipeline 1 2 3 4 Conceptually, the request hits the repository first, to get the Resource. Scripts and Servlets are equivalent, considering scripts only here. All in-memory and in-process! sling:include 5..N content aggregation!
  • 9. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 9 Content
 Repository Scripting and Rendering Script Resolver Scripts Output Federated Services Friendly? Resource
 Resolver Content Aggregator Aggregated
 Content Request Process boundaries
  • 10. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 10 Reasonably Federated?Can we get isolation AND performance?
  • 11. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 11 HTTP
 front-end Reasonably Federated Sling Rendering Farm? Aggregated
 Content Content
 Repository Resource
 Resolver Content Aggregator Content Provider
 Service Content Rendering
 Service Scripting and Rendering Script Resolver Scripts
 Repository Output It’s still mostly Sling, with the addition of a (scripted?) content aggregation step. Federated services provide more deployment and scaling options. Sandboxed Execution Isolated Content Sandboxed Execution
  • 12. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 12 Sandboxing & IsolationHow?
  • 13. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 13 Sandboxing & Isolation? Scripting and Rendering Sandboxed Execution Content
 Repository Isolated Content Content Aggregator Sandboxed Execution Repository Access Control can work but require a dynamic search path in Sling, see our experiments. Impacts caching, and mapping of incoming to resource paths is needed.Tried and tested. Repository jails look possible with probable impact on Sling internals. Same with multiple SlingRepository services. New and more like a blacklist. Custom, restricted languages are the safest? HTL (Use-API?), Handlebars? Sandboxing Nashorn (JavaScript) looks possible but not ideal, see our experiments. Sandboxing Java is not realistic- IBM canceled multi tenant JVM project for example.
  • 14. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 14 But it’s a VM, right? Oak Libraries Sling Engine JavaVirtual Machine content Oak Libraries Sling Engine JavaVirtual Machine content Oak Libraries Sling Engine JavaVirtual Machine content Perfect isolation! Java classes
 memory space Application
 memory space Java classes
 memory space Application
 memory space Java classes
 memory space Application
 memory space But suboptimal use of resources! (and containers wouldn’t help)
  • 15. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 15 Sandboxing scripting languages? <% var length = 0; if (request.getRequestParameter("file") != null) { var file = null; // store file var reqPara = request.getRequestParameter("file"); var is = reqPara.getInputStream(); file = Packages.java.io.File.createTempFile("posttest", ".txt"); var fout = new Packages.java.io.FileOutputStream(file); var c; while ((c = is.read()) != -1) { fout.write(c); } fout.close(); // read length length = file.length(); } %> OS Resources Infinite Loops Java classes & services Memory
 Usage? Many things need to be limited.
 Whitelist approach is much safer -> custom languages?
 HTL inherently sandboxed, except its Use-objects
  • 16. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 16 Containers? Oak Libraries Sling Engine OS container content Java classes
 memory space Application
 memory space SMALL! Shared Memory Pools, Caches etc. memory Oak Libraries Sling Engine OS container content Java classes
 memory space Application
 memory space SMALL! Oak Libraries Sling Engine OS container content Java classes
 memory space Application
 memory space SMALL! Same problem as multiple JVMs Sharing caches, compiled scripts etc. can be a pragmatic solution.
  • 17. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 17 What do we do?
  • 18. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 18 Hybrid Sling Rendering Farm Annotated Aggregated Content HTTP
 front-end HTTP
 routing Scripting + Rendering Script Resolver scripts Shared Services Custom Code Script Resolver scripts Tenant-Specific Services servletscontent Resource
 Resolver Content Aggregator Oak Libraries Shared Services Sandboxed Execution New
 Component Content-driven routing Isolated
 Content Dynamic Search Path Provides the flexibility of Sling via tenant-specific services and dynamic routing. Uses shared services for the common parts. Allows for billable options depending on the actual routing.
  • 19. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 19 Experimentsbuilding blocks that might be reusable
  • 20. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 20 Resolving new types of scripts Experim ent Script Resolver Client
 GET Request Wrapped
 AGG Request Wrap the request to make it appear as an AGG (*) request and pass that to the Sling ServletResolver. Adapt the return SlingScript to an InputStream to read its text. (*) or any other non-existent HTTP verb. Content
 Repository /apps
 /myapp /AGG.js AGG.js
 script
 text Code at https://github.com/bdelacretaz/sling-adaptto-2017 (ContentBVP.java)
  • 21. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 21 Resolving a SLING-CONTENT script Experim ent Code at https://github.com/bdelacretaz/sling-adaptto-2017 (ContentBVP.java) String getAggregatorScript(SlingHttpServletRequest r) { String result = null; Servlet s = servletResolver.resolveServlet( new ChangeMethodRequestWrapper(r, "SLING-CONTENT")); if(s instanceof SlingScript) { InputStream is = ((SlingScript)s).getScriptResource() .adaptTo(InputStream.class); } if(is != null) { result = IOUtils.toString(is) } } return result; } adaptTo() Bonus Points!
  • 22. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 22 Content Aggregation with Sling Query Experim entvar $ = Packages.org.apache.sling.query.SlingQuery.$ var SearchStrategy = Packages.org.apache.sling.query.api.SearchStrategy var resourceResolver = resource.getResourceResolver() var result = { siblings : $(resource).siblings(), rootChildren : $(resource).parents().last().children(), queryResult : $(resourceResolver) .searchStrategy(SearchStrategy.QUERY) .find("nt:base[title=foo]") } Used in a BindingsValuesProvider? Or in a custom json renderer servlet which runs this script. Inherently sandboxed due to custom language. https://sling.apache.org/documentation/bundles/sling-query.html
  • 23. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 23 Dynamic scripts/servlet search path Experim entif(dynamicServletResolver.canResolve(resource)) { servlet = dynamicServletResolver.resolveServlet(request); } else { …existing resolver code } A fairly simple change to the SlingServletResolver - should evolve into a real extension point if desired, and probably get the request as well. Tested in SLING-4386 - another multitenant experiment which provides tenant-specific scripts but no real isolation. Currently requires disabling the servlet resolution cache.
  • 24. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 24 Nashorn (JavaScript) sandboxing (Java Delight) Experim entNashornSandbox { allow(final Class<?> clazz); injectGlobalVariable(String variableName, Object object); setMaxCPUTime(long limitMsec); Object eval(final String javaScriptCode); allowPrintFunctions(boolean v); allowReadFunctions(boolean v); ...more allow functions // $ARG, $ENV, $EXEC... allowGlobalsObjects(final boolean v); } Uses Nashorn’s ClassFilter to block Java classes Sandboxing rewrites standard methods + user code- > blacklisting, not ideal https://github.com/javadelight/delight-nashorn-sandbox (Java Delight Suite)
  • 25. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 25 CODAwhere to now?
  • 26. Building an Apache Sling Rendering Farm - Bertrand Delacretaz, adaptTo 2017 26 CODA Thank you for attending! I’m Bertrand Delacretaz (@bdelacretaz) In-memory nature of Sling is an important differentiator, in good and bad ways! Hybrid Rendering Farm promising - do you need it? Sandboxing is difficult, whitelisting much preferred, custom languages? Reusable
 experiments?