SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Europe's leading AEM Developer Conference


28 - 30 SEPTEMBER 2020


Paving the way to a native Sling


Radu Cotescu, Karl Pauls - Adobe
rev. 4.20200916
2
Mr. Scripting
3
▪ Computer Scientist @ Adobe, Basel, Switzerland


▪ Member of the Apache Software Foundation


▪ Apache Sling PMC member


▪ Maintainer of HTL for Apache Sling
Mr. Classloader
4
▪ Computer Scientist @ Adobe, Basel, Switzerland


▪ Member of the Apache Software Foundation


▪ Apache Sling and Apache Felix PMC (VP) member


▪ Co-Author of OSGi in Action
5
Episode VI*. The end.
* we’re happy you know your Star Wars episodes
Why the end?
6
2018 - we presented a novel approach towards script bundling and
pre-compilation, based on OSGi capabilities [1]


2019 - based on our previous year’s work, we then showed the
bigger picture: running Apache Sling as a distributed rendering
service [2]


2020 - support for precompiled bundled scripts is now production
ready
These two core bundles now provide full support for packing scripts (resource types) into bundles.


Scripts can be interpreted or precompiled (HTL and JSP for now). However, any script engine can be
used.


Specific tooling helps developers for both precompiling their scripts and generating the required
metadata.
Servlets Resolver & Scripting Core
7
Bundle headers (Provide-Capability, Require-Capability) can be generated with:


<plugin>


<groupId>org.apache.sling</groupId>


<artifactId>scriptingbundle-maven-plugin</artifactId>


<version>0.2.2</version>


<executions>


<execution>


<phase>prepare-package</phase>


<goals>


<goal>metadata</goal>


</goals>


</execution>


</executions>


</plugin>
With a little help from…
8
And then use the following two properties in your favourite OSGi bundle plugin:


${org.apache.sling.scriptingbundle.maven.plugin.Provide-Capability}


${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}


You’ll also need the following requirement:


osgi.extender;filter:="(&amp;(osgi.extender=sling.scripting)(version>=1.0.0)(!
(version>=2.0.0)))"
With a little help from…
9
If you precompile HTL (assuming your scripts are in src/main/scripts):


<plugin>


<groupId>org.apache.sling</groupId>


<artifactId>htl-maven-plugin</artifactId>


<version>2.0.0-1.4.0</version>


<executions>


<execution>


<id>validate-htl-scripts</id>


<goals>


<goal>validate</goal>


</goals>


<phase>generate-sources</phase>


<configuration>


<generateJavaClasses>true</generateJavaClasses>


</configuration>


</execution>


</executions>


</plugin>


With a little help from…
10
If you precompile JSP (assuming your scripts are in src/main/scripts):


<plugin>


<groupId>org.apache.sling</groupId>


<artifactId>jspc-maven-plugin</artifactId>


<version>2.2.2</version>


<executions>


<execution>


<goals>


<goal>jspc</goal>

</goals>


</execution>


</executions>


</plugin>


With a little help from…
11
12
Can we precompile Composum?
✓ Faster startup of the web application


✓ Leaner instances


✓ Explicit dependencies


✓ Resource type versioning


✓ Ahead of time verification


✓ Native compilation (in the not so distant future)
Why change something that works?
13
14
What about AEM?
We’re glad you asked.
15
The AEMaaCS SDK already provides the AEM resource types
(/libs) as precompiled Java classes via the aem-precompiled-
scripts bundle.


The available resource types are exposed via the Provided-
Capabilities bundle header.
16
Precompiling scripts for AEM
Existing applications will need a tool to help with migration, which will be made available soon:


• help repack scripts from content packages and precompile them into bundles


• provide build-time checks

Explore OSGi Connect and Native images as a way to deploy applications.
Next steps
	
17
18
Q&A
[1] – https://adapt.to/2018/en/schedule/apache-sling-scripting-reloaded.html


[2] – https://adapt.to/2019/en/schedule/from-0-to-hero-in-under-10-seconds.html


[3] – https://github.com/apache/sling-org-apache-sling-servlets-resolver


[4] – https://github.com/apache/sling-org-apache-sling-scripting-bundle-tracker-it


[5] – https://github.com/raducotescu/adaptTo2020-demo


Assets licensed from https://stock.adobe.com/
Resources
19

Contenu connexe

Tendances

Docker + Microservices in Production
Docker + Microservices in ProductionDocker + Microservices in Production
Docker + Microservices in Production
Patrick Mizer
 

Tendances (20)

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
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
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
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
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
 
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on KubernetesDCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Docker + Microservices in Production
Docker + Microservices in ProductionDocker + Microservices in Production
Docker + Microservices in Production
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD Platform
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
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)
 

Similaire à Paving the way to a native Sling

Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
WSO2
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
Jean-Sebastien Delfino
 

Similaire à Paving the way to a native Sling (20)

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
 
Using OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache SlingUsing OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache Sling
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
 
Modern Web Applications with Sightly
Modern Web Applications with SightlyModern Web Applications with Sightly
Modern Web Applications with Sightly
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)
 
maXbox Starter87
maXbox Starter87maXbox Starter87
maXbox Starter87
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
 
Apache Sling Scripting Reloaded
Apache Sling Scripting ReloadedApache Sling Scripting Reloaded
Apache Sling Scripting Reloaded
 
What’s new in cas 4.2
What’s new in cas 4.2 What’s new in cas 4.2
What’s new in cas 4.2
 
AWS CodeDeploy - basic intro
AWS CodeDeploy - basic introAWS CodeDeploy - basic intro
AWS CodeDeploy - basic intro
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
NYC_2016_slides
NYC_2016_slidesNYC_2016_slides
NYC_2016_slides
 
Tutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of IndiaTutorial to setup OpenStreetMap tileserver with customized boundaries of India
Tutorial to setup OpenStreetMap tileserver with customized boundaries of India
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)
 
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
 
Introduction to Groovy Monkey
Introduction to Groovy MonkeyIntroduction to Groovy Monkey
Introduction to Groovy Monkey
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
HTL Compilers and Tooling
HTL Compilers and ToolingHTL Compilers and Tooling
HTL Compilers and Tooling
 
OpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaKOpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaK
 

Dernier

Dernier (20)

From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
 
Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insights
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 

Paving the way to a native Sling

  • 1. Europe's leading AEM Developer Conference 28 - 30 SEPTEMBER 2020 Paving the way to a native Sling Radu Cotescu, Karl Pauls - Adobe rev. 4.20200916
  • 2. 2
  • 3. Mr. Scripting 3 ▪ Computer Scientist @ Adobe, Basel, Switzerland ▪ Member of the Apache Software Foundation ▪ Apache Sling PMC member ▪ Maintainer of HTL for Apache Sling
  • 4. Mr. Classloader 4 ▪ Computer Scientist @ Adobe, Basel, Switzerland ▪ Member of the Apache Software Foundation ▪ Apache Sling and Apache Felix PMC (VP) member ▪ Co-Author of OSGi in Action
  • 5. 5 Episode VI*. The end. * we’re happy you know your Star Wars episodes
  • 6. Why the end? 6 2018 - we presented a novel approach towards script bundling and pre-compilation, based on OSGi capabilities [1] 2019 - based on our previous year’s work, we then showed the bigger picture: running Apache Sling as a distributed rendering service [2] 2020 - support for precompiled bundled scripts is now production ready
  • 7. These two core bundles now provide full support for packing scripts (resource types) into bundles. Scripts can be interpreted or precompiled (HTL and JSP for now). However, any script engine can be used. Specific tooling helps developers for both precompiling their scripts and generating the required metadata. Servlets Resolver & Scripting Core 7
  • 8. Bundle headers (Provide-Capability, Require-Capability) can be generated with: <plugin> <groupId>org.apache.sling</groupId> <artifactId>scriptingbundle-maven-plugin</artifactId> <version>0.2.2</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>metadata</goal> </goals> </execution> </executions> </plugin> With a little help from… 8
  • 9. And then use the following two properties in your favourite OSGi bundle plugin: ${org.apache.sling.scriptingbundle.maven.plugin.Provide-Capability} ${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability} You’ll also need the following requirement: osgi.extender;filter:="(&amp;(osgi.extender=sling.scripting)(version>=1.0.0)(! (version>=2.0.0)))" With a little help from… 9
  • 10. If you precompile HTL (assuming your scripts are in src/main/scripts): <plugin> <groupId>org.apache.sling</groupId> <artifactId>htl-maven-plugin</artifactId> <version>2.0.0-1.4.0</version> <executions> <execution> <id>validate-htl-scripts</id> <goals> <goal>validate</goal> </goals> <phase>generate-sources</phase> <configuration> <generateJavaClasses>true</generateJavaClasses> </configuration> </execution> </executions> </plugin> With a little help from… 10
  • 11. If you precompile JSP (assuming your scripts are in src/main/scripts): <plugin> <groupId>org.apache.sling</groupId> <artifactId>jspc-maven-plugin</artifactId> <version>2.2.2</version> <executions> <execution> <goals> <goal>jspc</goal> </goals> </execution> </executions> </plugin> With a little help from… 11
  • 12. 12 Can we precompile Composum?
  • 13. ✓ Faster startup of the web application ✓ Leaner instances ✓ Explicit dependencies ✓ Resource type versioning ✓ Ahead of time verification ✓ Native compilation (in the not so distant future) Why change something that works? 13
  • 15. We’re glad you asked. 15 The AEMaaCS SDK already provides the AEM resource types (/libs) as precompiled Java classes via the aem-precompiled- scripts bundle. The available resource types are exposed via the Provided- Capabilities bundle header.
  • 17. Existing applications will need a tool to help with migration, which will be made available soon: • help repack scripts from content packages and precompile them into bundles • provide build-time checks Explore OSGi Connect and Native images as a way to deploy applications. Next steps 17
  • 19. [1] – https://adapt.to/2018/en/schedule/apache-sling-scripting-reloaded.html [2] – https://adapt.to/2019/en/schedule/from-0-to-hero-in-under-10-seconds.html [3] – https://github.com/apache/sling-org-apache-sling-servlets-resolver [4] – https://github.com/apache/sling-org-apache-sling-scripting-bundle-tracker-it [5] – https://github.com/raducotescu/adaptTo2020-demo Assets licensed from https://stock.adobe.com/ Resources 19