Jdouglas has uploaded a new change for review. https://gerrit.wikimedia.org/r/204669
Change subject: Add a mechanism to bundle for distribution ...................................................................... Add a mechanism to bundle for distribution Fixes #T96148 This adds a new subproject that bundles everything into a nice little package. It also avoids the need to *mvn install* anything, as it gets all its project references from the build, rather than from the local Maven repo. This makes redundant (and likely deprecates) the similar infrastructure in *tools* which extracts the Blazegraph war, copies in the project artifacts, and the shell scripts. I've left that stuff alone for now, since I'm not 100% certain it's no longer needed. Either way, we can prune it later as appropriate. Change-Id: I144ecf4433c05e9223f208d7dec31d511eca13e5 --- A dist/README.md A dist/pom.xml A dist/src/assembly/dist.xml A dist/src/script/RWStore.properties A dist/src/script/runBlazegraph.sh A dist/src/script/runUpdate.sh M pom.xml 7 files changed, 191 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf refs/changes/69/204669/1 diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 0000000..4a0431c --- /dev/null +++ b/dist/README.md @@ -0,0 +1,26 @@ +# Wikibase RDF Query Service + +## Installation + +To create a distributable artifact, tell Maven to package the parent project: + +``` +cd <wikidata/query/rdf> +mvn package +``` + +This handles all the prerequisites, and creates a distributable *.zip* package in *./dist/target/service-<version>.zip*. This package contains Blazegraph, Wikidata RDF Query extensions and libraries, and scripts to run both Blazegraph and the updater tool: + +``` +service-<version> +├── blazegraph/ +├── lib/ +├── jetty-runner-9.2.9.v20150224.jar +├── runBlazegraph.sh +├── runUpdate.sh +└── RWStore.properties +``` + +Extract this package somewhere, and fire up Blazegraph with `runBlazegraph.sh`. + +Optionally extract this package somwhere else, and launch the updater tool via `./runUpdater.sh`. diff --git a/dist/pom.xml b/dist/pom.xml new file mode 100644 index 0000000..7ab554b --- /dev/null +++ b/dist/pom.xml @@ -0,0 +1,66 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.wikidata.query.rdf</groupId> + <artifactId>parent</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>service</artifactId> + <packaging>pom</packaging> + + <name>Wikibase RDF Query Service</name> + <description>Service to host Wikidata RDF Query Service.</description> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + + <dependencies> + <dependency> + <groupId>com.bigdata</groupId> + <artifactId>bigdata</artifactId> + <version>1.5.1</version> + <type>war</type> + </dependency> + <dependency> + <groupId>org.wikidata.query.rdf</groupId> + <artifactId>common</artifactId> + <version>${project.parent.version}</version> + </dependency> + <dependency> + <groupId>org.wikidata.query.rdf</groupId> + <artifactId>blazegraph</artifactId> + <version>${project.parent.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-runner</artifactId> + <version>9.2.9.v20150224</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptor>src/assembly/dist.xml</descriptor> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/dist/src/assembly/dist.xml b/dist/src/assembly/dist.xml new file mode 100644 index 0000000..398676e --- /dev/null +++ b/dist/src/assembly/dist.xml @@ -0,0 +1,59 @@ +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + + <id>dist</id> + + <baseDirectory>${project.artifactId}-${pom.version}</baseDirectory> + + <formats> + <format>zip</format> + </formats> + + <fileSets> + + <fileSet> + <outputDirectory></outputDirectory> + <directory>${project.basedir}/src/script</directory> + </fileSet> + + <fileSet> + <outputDirectory>lib</outputDirectory> + <directory>${project.basedir}/../tools/target</directory> + <includes> + <include>wikidata-query-tools-0.0.1-SNAPSHOT-jar-with-dependencies.jar</include> + </includes> + </fileSet> + + </fileSets> + + <dependencySets> + + <dependencySet> + <outputDirectory>blazegraph</outputDirectory> + <unpack>true</unpack> + <includes> + <include>com.bigdata:bigdata:war</include> + </includes> + <useProjectArtifact>false</useProjectArtifact> + </dependencySet> + + <dependencySet> + <outputDirectory>blazegraph/WEB-INF/lib</outputDirectory> + <includes> + <include>${project.groupId}:*:jar</include> + </includes> + <useProjectArtifact>false</useProjectArtifact> + </dependencySet> + + <dependencySet> + <outputDirectory></outputDirectory> + <includes> + <include>org.eclipse.jetty:jetty-runner:jar</include> + </includes> + <useProjectArtifact>false</useProjectArtifact> + </dependencySet> + + </dependencySets> + +</assembly> diff --git a/dist/src/script/RWStore.properties b/dist/src/script/RWStore.properties new file mode 100644 index 0000000..a41de06 --- /dev/null +++ b/dist/src/script/RWStore.properties @@ -0,0 +1,27 @@ +# Dump data in target. +com.bigdata.journal.AbstractJournal.file=blazegraph.jnl +com.bigdata.journal.AbstractJournal.bufferMode=DiskRW +com.bigdata.service.AbstractTransactionService.minReleaseAge=1 +com.bigdata.btree.writeRetentionQueue.capacity=4000 +com.bigdata.btree.BTree.branchingFactor=128 + +# Small (2M) initial extent for small test data. +com.bigdata.journal.AbstractJournal.initialExtent=2097152 +com.bigdata.journal.AbstractJournal.maximumExtent=2097152 + +# Use RDR mode just in case we use it. +com.bigdata.rdf.store.AbstractTripleStore.quads=false +com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=true + +# Don't use truth maintenance right yet. +com.bigdata.rdf.sail.truthMaintenance=false +com.bigdata.rdf.store.AbstractTripleStore.textIndex=false +com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.NoAxioms + +# Use the default vocabulary for now. +com.bigdata.rdf.store.AbstractTripleStore.vocabularyClass=com.bigdata.rdf.vocab.DefaultBigdataVocabulary +com.bigdata.rdf.store.AbstractTripleStore.extensionFactoryClass=org.wikidata.query.rdf.blazegraph.WikibaseExtensionFactory + +# These seem to be ubiquitous overwrites. Not sure why they aren't the default but it works. +com.bigdata.namespace.kb.lex.com.bigdata.btree.BTree.branchingFactor=400 +com.bigdata.namespace.kb.spo.com.bigdata.btree.BTree.branchingFactor=1024 diff --git a/dist/src/script/runBlazegraph.sh b/dist/src/script/runBlazegraph.sh new file mode 100755 index 0000000..e2169dc --- /dev/null +++ b/dist/src/script/runBlazegraph.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +java -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=RWStore.properties \ + -Dorg.eclipse.jetty.server.Request.maxFormContentSize=20000000 \ + -jar jetty-runner*.jar \ + --port 9999 \ + --path /bigdata \ + blazegraph diff --git a/dist/src/script/runUpdate.sh b/dist/src/script/runUpdate.sh new file mode 100755 index 0000000..f979094 --- /dev/null +++ b/dist/src/script/runUpdate.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +java -cp lib/wikidata-query-tools-0.0.1-SNAPSHOT-jar-with-dependencies.jar org.wikidata.query.rdf.tool.Update --sparqlUrl http://localhost:9999/bigdata/namespace/kb/sparql + diff --git a/pom.xml b/pom.xml index 10c2ecf..3c2e386 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,7 @@ <module>common</module> <module>blazegraph</module> <module>tools</module> + <module>dist</module> </modules> <licenses> -- To view, visit https://gerrit.wikimedia.org/r/204669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I144ecf4433c05e9223f208d7dec31d511eca13e5 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/rdf Gerrit-Branch: master Gerrit-Owner: Jdouglas <jdoug...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits