Quickstart#
This example allows to quickly deploy dataClay and run all commands from the User Guide.
Prerequisits#
Have docker engine installed.
Hava dataClay installed:
python3 -m pip install dataclay
Clone the repository:
git clone https://github.com/bsc-dom/dataclay.git
Deployment#
Navigate to the
quickstart
folder:cd dataclay/examples/quickstart
The folder should contain the following files:
quickstart
├── model
│ └── company.py
├── docker-compose.yml
└── client.py
Deploy dataClay with
docker compose
:docker compose up -d
Execution#
Run the client.py in a python interactive shell:
python3 -i client.py
The client.py will only import the Employee and Company classes,
and start a new client session that should connect to the dataClay instance
that was deployed with docker compose
.
client.py#
from model.company import Company, Employee
from dataclay import Client
client = Client(host="127.0.0.1", username="testuser", password="s3cret", dataset="testdata")
client.start()
Now we can start executing the User Guide commands:
>>> employee = Employee("John", 1000.0)
>>> employee.make_persistent()
Don’t forget to stop the dataClay instance when you are done:
$ docker compose down