Merge branch 'feature/SEARCH-1783_ModelDeployment' into 'master'

Enable custom model deployments for repository and custom forms deployments to Share.

See merge request search_discovery/insightengine!123
This commit is contained in:
Angel Borroy
2019-08-07 10:36:34 +01:00
12 changed files with 126 additions and 13 deletions

View File

@@ -27,20 +27,32 @@ generators/app/templates/
│   ├── alfresco
│   │   ├── Dockerfile
│   │   └── model
│   │   ├── empty
│   │   ├── sharding-content-model-context.xml
│   │   └── sharding-content-model.xml
│   ├── search
│   │   └── Dockerfile
│   ├── share
│   │   ├── Dockerfile
│   │   └── model
│   │   ├── empty.xml
│   │   └── sharding-share-config-custom.xml
│   └── zeppelin
│   └── Dockerfile
└── keystores
├── alfresco
├── client
├── solr
└── zeppelin
```
* `.env` includes default values for Docker Compose environment variables
* `docker-compose-ce.yml` is the base Docker Compose Template for Alfresco Community deployment (for ACS 6.2 and ACS 6.1)
* `docker-compose-ee.yml` is the base Docker Compose Template for Alfresco Enterprise deployment (for ACS 6.2 and ACS 6.1)
* `alfresco` includes a Dockerfile template to start Alfresco Repository
* `model` includes a default content model for Sharding Explicit Routing
* `model` includes a default content model (Sharding Explicit Routing or empty). This `empty` file is required for Dockerfile to work, so it should not be deleted.
* `share` includes a Dockerfile template to start Share Web Application
* `model` includes a default forms model (Sharding Explicit Routing or empty)
* `search` includes a Dockerfile template to start Search Services and Insight Engine
* `zeppelin` includes a Dockerfile template to start Zeppelin with SSL
* `keystores` includes every truststore and keystore required for SSL configuration
@@ -136,6 +148,30 @@ Custom content model is deployed to provide a property, named `shard:shardId`, h
This default configuration can be changed in the generated `docker-compose.yml` template.
## Deploying custom content models and forms
Custom content models and Share Form configurations can be added to deployment folders.
**Content models**
Custom content models can be copied to Repository deployment folder by using bootstrap approach.
Following XML files must be created in `alfresco/model/` folder in the Docker Compose template generated:
* `content-model.xml` including an XML Alfresco Content Model file. Sample model is available in [images/alfresco/model/sharding-content-model.xml](generators/app/templates/images/alfresco/model/sharding-content-model.xml)
* `content-model-context.xml` including an XML Spring Bean file with the `dictionaryBootstrap` bean. Sample Spring Bean declaration is available in [images/alfresco/model/sharding-content-model-context.xml](generators/app/templates/images/alfresco/model/sharding-content-model-context.xml)
If *Sharding* is selected, these files will be available in deployment folder.
**Share forms**
Custom content forms can be added to Share configuration by modifying `share/model/share-config-custom-dev.xml` file in the Docker Compose template generated.
Sample configuration is available in [images/share/model/sharding-share-config-custom.xml](generators/app/templates/images/share/model/sharding-share-config-custom.xml)
If *Sharding* is selected, a default `share-config-custom-dev.xml` file with required forms configuration for Sharding custom model will be available in deployment folder. Add your configuration to this file.
## Configuration catalog
| Version | Comms | Replication | Sharding | Explicit | Insight | Zeppelin |

View File

@@ -193,8 +193,7 @@ module.exports = class extends Generator {
searchPath: searchBasePath,
zeppelin: (this.props.zeppelin ? "true" : "false"),
sharding: (this.props.sharding ? "true" : "false"),
shardingMethod: (this.props.shardingMethod),
shareImage: shareImageName
shardingMethod: (this.props.shardingMethod)
}
);
@@ -209,10 +208,37 @@ module.exports = class extends Generator {
sharding: (this.props.sharding ? "true" : "false")
}
);
// Copy Sharding Content Model or an empty file to allow model deployments
if (this.props.sharding) {
this.fs.copy(
this.templatePath(imagesDirectory + '/alfresco/model'),
this.destinationPath('alfresco/model')
this.templatePath(imagesDirectory + '/alfresco/model/*.xml'),
this.destinationPath('alfresco/model/')
)
} else {
this.fs.copy(
this.templatePath(imagesDirectory + '/alfresco/model/empty'),
this.destinationPath('alfresco/model/empty')
)
}
// Copy Docker Image for Share applying configuration
this.fs.copyTpl(
this.templatePath(imagesDirectory + '/share/Dockerfile'),
this.destinationPath('share/Dockerfile'),
{
shareImage: shareImageName
}
);
// Copy Sharding Content Forms or an empty file to allow forms deployments
if (this.props.sharding) {
this.fs.copy(
this.templatePath(imagesDirectory + '/share/model/sharding-share-config-custom.xml'),
this.destinationPath('share/model/share-config-custom-dev.xml')
)
} else {
this.fs.copy(
this.templatePath(imagesDirectory + '/share/model/empty.xml'),
this.destinationPath('share/model/share-config-custom-dev.xml')
)
}

View File

@@ -124,7 +124,10 @@ services:
<% } %>
share:
image: <%=shareImage%>:${SHARE_TAG}
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"

View File

@@ -264,7 +264,10 @@ services:
- shared-file-store-volume:/tmp/Alfresco/sfs
share:
image: <%=shareImage%>:${SHARE_TAG}
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"

View File

@@ -178,7 +178,10 @@ services:
- 8094:8090
share:
image: alfresco/alfresco-share:${SHARE_TAG}
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"

View File

@@ -287,7 +287,10 @@ services:
- shared-file-store-volume:/tmp/Alfresco/sfs
share:
image: alfresco/alfresco-share:${SHARE_TAG}
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"

View File

@@ -48,7 +48,5 @@ RUN if [ "$SOLR_COMMS" == "https" ] ; then \
<\/Connector>/g" ${TOMCAT_DIR}/conf/server.xml; \
fi
<% if (sharding == 'true') { %>
# Explicit Routing Sharding content model (useless when not using this feature)
COPY model/sharding-content-model*.xml $TOMCAT_DIR/shared/classes/alfresco/extension/
<% } %>
# Copy custom content model to deployment folder
COPY model/* $TOMCAT_DIR/shared/classes/alfresco/extension/

View File

@@ -13,9 +13,11 @@
<aspects>
<aspect name="shard:sharding">
<title>Sharding</title>
<properties>
<!-- Shard number to index this content -->
<property name="shard:shardId">
<title>Shard Id</title>
<type>d:text</type>
</property>
</properties>

View File

@@ -0,0 +1,7 @@
ARG SHARE_TAG
FROM <%=shareImage%>:${SHARE_TAG}
ARG TOMCAT_DIR=/usr/local/tomcat
# Copy custom content forms to deployment folder
COPY model/* $TOMCAT_DIR/shared/classes/alfresco/web-extension/

View File

@@ -0,0 +1,5 @@
<alfresco-config>
<!-- Add custom configuration -->
</alfresco-config>

View File

@@ -0,0 +1,27 @@
<alfresco-config>
<!-- Add custom configuration -->
<config evaluator="string-compare" condition="DocumentLibrary">
<aspects>
<visible>
<aspect name="shard:sharding"/>
</visible>
<addable>
</addable>
<removeable>
</removeable>
</aspects>
</config>
<config evaluator="aspect" condition="shard:sharding">
<forms>
<form>
<field-visibility>
<show id="shard:shardId" />
</field-visibility>
</form>
</forms>
</config>
</alfresco-config>