Skip to content

Instantly share code, notes, and snippets.

View pvillard31's full-sized avatar

Pierre Villard pvillard31

View GitHub Profile
@pvillard31
pvillard31 / keypairs
Last active July 2, 2019 12:54
Generate SSH key pairs
$ ssh-keygen -t rsa -b 4096 -m PEM -C "NiFi Registry"
Generating public/private rsa key pair.
Enter file in which to save the key (~/.ssh/id_rsa): ~/temp/id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ~/temp/id_rsa.
Your public key has been saved in ~/temp/id_rsa.pub.
The key fingerprint is:
SHA256:/hu6FZLvcvDigP4ixPFPEGzfpY1RHOoTRytjqYOoYHo NiFi Registry
#! /bin/bash
# This script is used when starting a docker image based GCE instance
# of the NiFi Registry. It is intended to configure the NiFi Registry
# so that the persistence provider is the Google Cloud Source Repo.
# Docker volumes (directory type)
# /tmp/config => /home/nifi/.ssh - Read only
# /tmp/ssh/id_rsa => /id_rsa - Read only
# /tmp/nifi-flow-repository => /nifi-flow-repository - Read/Write
gcloud beta compute instances create-with-container my-nifi-instance --tags=nifi --container-image=apache/nifi
gcloud compute firewall-rules create allow-nifi-unsecured --action=ALLOW --rules=tcp:8080 --target-tags=nifi
git clone https://github.com/pvillard31/nifi-gcp-terraform.git
cd nifi-gcp-terraform/gcp-single-secured-nifi-oidc/
terraform init
terraform apply
git clone https://github.com/pvillard31/nifi-gcp-terraform.git
cd nifi-gcp-terraform/gcp-cluster-secured-nifi-oidc
/bin/sh deploy.sh <gcp-project-id> <gcs-bucket>
pvillard@cloudshell:~/nifi-gcp-terraform/gcp-cluster-secured-nifi-oidc (nifi-dev-project)$ /bin/sh deploy.sh nifi-dev-project nifi_bin
Updated property [core/project].
Initializing the backend...
Initializing provider plugins...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
@Test
public void testNoMatchingRecords() throws InitializationException {
TestRunner runner = getRunner();
final JsonTreeReader jsonReader = new JsonTreeReader();
runner.addControllerService("reader", jsonReader);
runner.setProperty(jsonReader, SchemaAccessUtils.SCHEMA_ACCESS_STRATEGY, SchemaInferenceUtil.INFER_SCHEMA);
final JsonRecordSetWriter jsonWriter = new JsonRecordSetWriter();
runner.addControllerService("writer", jsonWriter);
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.3">
<description></description>
<groupId>2e083aef-0162-1000-80bc-8c6bbfc00ca8</groupId>
<name>FTP-UTF8-Test</name>
<snippet>
<processGroups>
<id>3982c999-cd5f-3ac7-0000-000000000000</id>
<parentGroupId>16e377d4-8369-3464-0000-000000000000</parentGroupId>
<position>
@pvillard31
pvillard31 / syncDataFlow.sh
Created December 24, 2021 19:29
Script to be used with the NiFi Registry Event Script Hook for automatic sync with the Cloudera DataFlow Catalog
#!/bin/sh
set -e
# This script is used to automatically sync new flows into the DataFlow Catalog
# It assumes that the CDP CLI has been installed first. See:
# https://docs.cloudera.com/dataflow/cloud/cli/index.html
# It also assumes that the NiFi CLI has been properly configured to interact with the NiFi Registry instance. See:
# https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#nifi_CLI
NIFICLI="/opt/cloudera/parcels/CFM/TOOLKIT/bin/cli.sh"
@pvillard31
pvillard31 / sidecar-example.yml
Created February 1, 2022 14:05
sidecar-example.yml for MiNiFi and NiFi
apiVersion: v1
data:
# TODO: replace with own minifi properties
minifi.properties: |
# Core Properties #
nifi.version=0.11.0
nifi.flow.configuration.file=./conf/config.yml
nifi.administrative.yield.duration=30 sec
# If a component has no work to do (is "bored"), how long should we wait before checking again for work?
nifi.bored.yield.duration=100 millis