🚀Teaser
"provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes."
Let's see how vendir
, which is one of these tools can help deploy things easier, even if you don't work with kubernetes.
📑Introduction
Neo4J is a very nice way to play with a Graph Database.
Is is delivered as packages, as a Service and as a Docker image.
Neo4J features can be extended thanks to plugins, one of them is APOC :
neo4j-contrib / neo4j-apoc-procedures
Awesome Procedures On Cypher for Neo4j - codenamed "apoc" If you like it, please ★ above ⇧
Awesome Procedures for Neo4j 4.4.x
Introduction
Neo4j 3.x introduced the concept of user-defined procedures and functions Those are custom implementations of certain functionality, that can’t be (easily) expressed in Cypher itself. They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.
The APOC library consists of many (about 450) procedures and functions to help with many different tasks in areas like data integration, graph algorithms or data conversion.
License
Apache License 2.0
"APOC" Name history
Apoc was the technician and driver on board of the Nebuchadnezzar in the Matrix movie. He was killed by Cypher.
APOC was also the first bundled A Package Of Component for Neo4j in 2009.
APOC also stands for "Awesome Procedures On Cypher"
Installation: With Neo4j Desktop
APOC Full can be installed with Neo4j Desktop, after creating your database, by going to the Manage
…
Here are some features APOC adds to Neo4J :
-
Import
csv
,json
and evenxls
files - Connect to any jdbc driver to we can query any external datasource
- Natural Language Processing (NLP)
- Run http queries so we can load datas by calling REST services
- Provide ready to use graph algorithms
- Generate documentation thanks to graph introspection
- ...
All you have to get done do is :
- Download the APOC library
- Drop the plugin in a specific directory
🎁Distribution flavors
Let's focus on two specific flavors :
- The GUI mode
- The docker mode
GUI mode
The GUI mode is very helpful and packages all install operations in a very smooth way, perfect to perform demos, explain each step, but requires a quite important amount of clicks. Also, you get wizard to install APOC library the proper way.
This mode is very well suited for live demos as it provide nice visuals that make it easier for you to explain concepts while playing with them.
🐳Docker mode
This mode makes it possible to run everything from the code. Still, you have to perform some additional an eventually manual tasks :
- Download the APOC jar
- Put the
jar
in the right directory and give the proper privileges
👉The aim of this post is to document this to make things even easier with a tool called CARVEL vendir
CARVEL vendir
The aim of vendir
is to declaratively state directory's contents.
You can :
"Sync any number of data sources into a consistent structure by writing a YAML definition. Share the definition or generated lockfile and ensure that your whole team is working under the same expectations."
carvel-dev / vendir
Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
vendir
- Website: https://carvel.dev/vendir
- Slack: #carvel in Kubernetes slack
- Docs with example workflow and other details
- Install: Grab prebuilt binaries from the Releases page or Homebrew Carvel tap
- Backlog: See what we're up to.
vendir
allows you to declaratively state what should be in a directory. It can be used for vendoring software.
$ vendir sync # from a directory that contains vendir.yml
Features:
- Various sources
- pull Git repositories (examples/git, semver tag resolution in examples/versionselection)
- including tag semver selection, GPG verification
- pull Github releases (examples/github-release, semver tag resolution in examples/versionselection)
- pull HTTP asset (examples/http)
- pull Docker image contents (examples/image)
- pull Helm chart contents (examples/helm-chart)
- ...let us know sources you'd like to see
- pull Git repositories (examples/git, semver tag resolution in examples/versionselection)
- Keep only particular portions of pulled content via includePaths/excludePaths or newRootPath
- Override specific directory with a local directory source for quick development
- State which directories are…
Doing the whole thing from the shell
First, install vendir
:
On linux :
brew tap vmware-tanzu/carvel
brew install vendir
On Windows :
choco install vendir
Next, create vendir.yml
file with the following contents :
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: plugins/
contents:
- path: .
githubRelease:
slug: neo4j-contrib/neo4j-apoc-procedures
tag: 4.3.0.0
disableAutoChecksumValidation: true
assetNames: ["apoc-*-all.jar"]
Let's assume you have the following directory hierarchy :
vendir.yml
|__plugins
🎆Next, let vendir
do the job :
vendir sync
Finally, run the docker image and enjoy a fully operational (customize the volumes mapping) Neo4J instance with pre-installed APOC :
docker run \
--name vendir-loves-neo4j \
-p7474:7474 -p7687:7687 \
-d \
-v $HOME/neo4j/data:/data \
-v $HOME/neo4j/logs:/logs \
-v /vagrant/import:/var/lib/neo4j/import \
-v /vagrant/plugins:/plugins \
--env NEO4J_AUTH=neo4j/S3CR37 \
--env NEO4J_dbms_security_procedures_unrestricted=apoc.\\\* \
neo4j:latest
You're done and the installation process is totally automated and of course self-documented.
Now you can enjoy APOC extension. For an example, check how to import PostgreSQL relational model in Neo4J to run cypher queries and create nice looking Gephi graphs.
Conclusion
Hopefully this post has helped you make install process smoother, smarter, and made you discover CARVEL tools.
carvel-dev / carvel
Carvel provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes. This repo contains information regarding the Carvel open-source community.
Carvel
Carvel provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes.
This is a list of repos associated with the Carvel project.
- ytt - Template and overlay Kubernetes configuration via YAML structures, not text documents
- kapp - Install, upgrade, and delete multiple Kubernetes resources as one "application"
- kbld - Build or reference container images in Kubernetes configuration in an immutable way
- imgpkg - Bundle and relocate application configuration (with images) via Docker registries
- kapp-controller - Capture application deployment workflow in App CRD. Reliable GitOps experience powered by kapp.
- vendir - Declaratively state what files should be in a directory.
- secretgen-controller - Provides CRDs to specify what secrets need to be on a cluster (generated or not).
Experimental:
Installation:
Plugins:
Examples:
- simple-app-on-kubernetes
- ytt-library-for-kubernetes
- ytt-library-for-kubernetes-demo
- guestbook-example-on-kubernetes
See what's planned in our backlog.
Top comments (3)
Another great way to achieve this : neo4j.com/docs/operations-manual/c...