featurebase/idk
souhailanoor 2bdf1f5081
FB-1597: unifying idk and featurebase (#2160)
* unifying idk and featurebase: first pass

* resolved conflict with master for gitignore & dockerignore

* deleted binaries that were accidentally pushed to git

* combined gitlab jobs for idk & featurebase

* run go fmt for idk

* updated ssh env variable, and made docker password variable in gitlab env variables

* fixed typo assigning variable name

* trying to fix docker login error

* trying a different solution for docker password

* pass registry

* fixed docker login

* updated paths for idk

* exclude idk tests from featurebase test run

* fix vendor error

* update certificates

* grpc needs to be in version 1.38
genproto, which is imported by big query updates the grpc version to 1.47.0
grpc 1.47.0 causes etcd to deadlock when calling etcd.Close()
the fix is to have a replace in go.mod to specify a specific grpc version

* run go mod tidy

* go mod

* run go mod tidy

* exclude bigquery since it is causing issues and undo grpc replace in go.mod

* fix grpc version

* fix formatting error

* update formatting

* attempt to fix formatting

* update path for code coverage

* update to use current branch binaries, not master

* fix for building idk - path updates

* udpate path for binaries

* update job dependecies

* update docker idk tests to use the current branch registry

* update stages for jobs

* updated job dependencies

* not allow idk s3 dump to fail since it is a dependency for integration tests

* update dependecy for idk tests

* update paths for idk build and code coverage

* download featurebase binary from s3

* pass branch name to all setup scripts

* change to current branch instead of master

* updated sonarcloud

* sonarcloud fix and branch name fix

* trying to speed up pipeline run time

* update stage

* branch name fix + sonar cloud

* sonarcloud
2022-07-28 17:23:16 -05:00
..
api FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
bankgen FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
cmd FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
common FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
csv FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
datagen FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
docker-sasl FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
fakeidp FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
idktest FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
internal FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
kafka FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
kafka_sasl FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
kafka_static FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
kafkagen FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
kinesis FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
sql FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
testdata FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
testenv/certs FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
.cloud-env.template FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
docker-compose.yml FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
Dockerfile FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
Dockerfile-fakeIDP FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
Dockerfile-test FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
Dockerfile-wait FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
dup.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
dup_arm64.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
file_with_line_delimited_values FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
header.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
header_test.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
idallocator.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
idallocator_test.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
ingest.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
ingest_test.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
interfaces.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
interfaces_test.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
Makefile FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
metrics.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
pilosa-sec-test.conf FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
postgres.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
progress.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
README.md FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
reingest_test.sh FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
sample.csv FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
test_postgres.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
tls.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
util.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
util_test.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
version.go FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00
wait.sh FB-1597: unifying idk and featurebase (#2160) 2022-07-28 17:23:16 -05:00

idk: Ingest Development Kit

Integration tests

To run the tests, you will need to install the following dependencies:

  1. Docker
  2. Docker Compose
  3. Certstrap

In addition to these dependancies, you will need to be added to the moleculacorp Dockerhub account.

First start the test environment. This is a docker-compose environment that includes pilosa and a confluent kafka stack. Run the following to start those services:

make startup

To build and run the integration tests, run:

make test-run

Then to shut down the test environment, run:

make shutdown

You can run all of the previous commands by calling test-all:

make test-all

The previous command is equivalent to running the following:

make startup
sleep 30 # wait for services to come up
make test-run
make shutdown

To run an individual test, you can run the command directly using docker-compose. Note that you must run docker-compose build idk-test for docker to run the latest code. Modify the following as needed:

make startup
docker-compose build idk-test
docker-compose run idk-test /usr/local/go/bin/go test -count=1 -mod=vendor -run=TestCmdMainOne ./kafka

To shutdown and reset the environment:

make clean

Running dependencies locally (rather than in docker) "make test-local"

This is for running the tests locally and not in Docker... so you have to be running a bunch of stuff natively on your machine.

Run Pilosa with default config:

pilosa server

Run another pilosa like

pilosa server --config=pilosa-sec-test.conf

which will run Pilosa with TLS using certs in testenv. (make testenv first if you haven't).

You also need to be running the Confluent stack which, after you've installed it from Confluent's site might look something like:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home
confluent local destroy && confluent local start schema-registry

Or it might not! You may not need the first line, but if you have the wrong Java version by default, that's how you set it. The second line may change depending on what version of the confluent stack you get. According to

confluent version

I'm running:

Version:     v0.212.0
Git Ref:     2b04985

Use the test-local make target:

make test-local

This sets a number of environment variables (which it prints when you run it), and should set them correctly if you follow the instructions above, but if you're running things on non-default ports you may need to tweak them.

CSV Ingester

  1. make sure you're running Pilosa (localhost:10101 for these instructions)

molecula-consumer-csv --primary-key-fields=asset_tag -i sample-index --files sample.csv

asset_tag__String,fan_time__RecordTime_2006-01-02,fan_val__String_F_YMD
ABCD,2019-01-02,70%
ABCD,2019-01-03,20%
ABCD,2019-01-04,30%
BEDF,2019-01-02,70%
BEDF,2019-01-05,90%
BEDF,2019-01-08,10%
BEDF,2019-01-08,20%
ABCD,2019-01-30,40%

Datagen

Datagen is an internal command-line tool to generate various application-specific datasets, and ingest them directly into Pilosa. After running make install, run datagen with no arguments to see a list of available "sources".

When running Datagen with local Docker stacks, make sure to add individual docker stacks to the /etc/hosts file:

127.0.0.1 kafka
127.0.0.1 pilosa
127.0.0.1 <docker stack>

ODBC Support

By default, the SQL ingester is not built with ODBC support. This is because it uses CGO with extra dependencies, and the resulting binaries are not portable. In order to build with ODBC support, it is necessary to install unixODBC to the system. Then run:

make bin/molecula-consumer-sql-odbc

Different Linux distros will store certain libraries in different locations. ODBC uses dynamic library loading to handle drivers, so full static linking of dependencies is not possible. It is therefore necessary to build on a system with the same distro and the same software versions as the target machine.