Development¶
This document should help to setup a local environment for development.
Prepare local setup¶
-
Download the MNIST-dataset and place them anywhere
For testing the standard MNIST-dataset is used. Download the 4 files somewhere from the web:
wget https://storage.googleapis.com/cvdf-datasets/mnist/train-images-idx3-ubyte.gz wget https://storage.googleapis.com/cvdf-datasets/mnist/train-labels-idx1-ubyte.gz wget https://storage.googleapis.com/cvdf-datasets/mnist/t10k-images-idx3-ubyte.gz wget https://storage.googleapis.com/cvdf-datasets/mnist/t10k-labels-idx1-ubyte.gz gzip -d train-images-idx3-ubyte.gz gzip -d train-labels-idx1-ubyte.gz gzip -d t10k-images-idx3-ubyte.gz gzip -d t10k-labels-idx1-ubyte.gz
-
Copy example-config diretory to
/etc/
and make sure, that the current user has access to the directory -
In file
/etc/openhanami/hanami_testing.conf
update the path to the 4 MNIST files, so they point to the MNIST-files, which you downloaded eralier.
Run project locally for testing¶
-
Build the components of the project with the build-guide
-
For the initial run, environment-variables have to be set to initialize the sqlite-database and create the first admin-user:
export HANAMI_ADMIN_USER_ID=asdf export HANAMI_ADMIN_USER_NAME=asdf export HANAMI_ADMIN_PASSPHRASE=asdfasdf
These are the default testing-configs, to match with the test-confic
/etc/openhanami/hanami_testing.conf
. -
Exectute the binary without any flags. It uses by default the config of
/etc/openhanami/hanami.conf
and the values of the example-config are enough for testing. The SQLite-database-file/etc/openhanami/hanami_db
is automatically created by the initial start.
Testing¶
Run the compiled hanami
-binary.
Python-SDK-Test¶
There is a python-script, which uses the python-version fo the SDK to run basic tests against the API.
-
install python and protobuf:
-
go into the test-directory
cd OpenHanami/testing/python_sdk_api
-
create and prepare python-env and install packages
-
build proto-buffer messages
-
run tests
Go-CLI-Test¶
-
install go and protobuffer-compiler
-
go to the location
-
export environment-variables
export HANAMI_ADDRESS=http://127.0.0.1:11418 export HANAMI_USER=asdf export HANAMI_PASSPHRASE=asdfasdf export train_inputs=/tmp/train-images-idx3-ubyte export train_labels=/tmp/train-labels-idx1-ubyte export request_inputs=/tmp/t10k-images-idx3-ubyte export request_labels=/tmp/t10k-labels-idx1-ubyte
(of course update the values for your specific setup)
-
run script to build the cli and copy it to the current directory
-
run test-script