mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
- Standardize docker-compose workflow
- Change docker-compose version to 2.1
- why one might ask? because compose version
3.0 does not support depends on and inherits
like we want to and is more aimed towards migration to using
`docker stack`, for our current strategy `2.1` is a better choice.
- change `bdb` service `bigchaindb` service
- why? Introduced a new proxy service `bdb` which is just a dummy
`busybox` image.
- why? because this ensure via healthcheck of bigchaindb that BigchainDB
has started properly and makes a `curl` to ensure HTTP API server is up
and running.
- why? Because we have had scenarios where BigchainDB is not started
via docker compose and user has to check out the logs to find out what
the problem might be. This ensure that bigchaindb is up and running.
- Does this change deployment workflow? No.
- The only thing change is that if you want to run commands inside a bigchaindb
container e.g. `pytest` now you have to run the following command:
`docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb`
as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb`
- Remove env variable `BIGCHAINDB_START_TENDERMINT`
- Remove TENDERMINT_INTEGRATION.rst and move to the new docs
- Change mdb -> mongodb because the other services were named with
full name.
- Add example to run specific tests or from a file
- Update config.toml for tendermint to use `bigchaindb` as proxy app
instead of `bdb`
- Remove `network` directory because it is deprecated
- Add comment about why PYTHONBUFFERED is used
1.6 KiB
1.6 KiB
Setup development environment
Setting up a single node development environment with docker-compose
You can also use Docker Compose to run all the tests.
$ docker-compose build bigchaindb
$ docker-compose up -d bdb
The above command will launch all 3 main required services/processes:
mongodbtendermintbigchaindb
To follow the logs of the tendermint service:
$ docker-compose logs -f tendermint
To follow the logs of the bigchaindb service:
$ docker-compose logs -f bigchaindb
To follow the logs of the mongodb service:
$ docker-compose logs -f mdb
Simple health check:
$ docker-compose up curl-client
Post and retrieve a transaction -- copy/paste a driver basic example of a
CREATE transaction:
$ docker-compose -f docker-compose.yml run --rm bdb-driver ipython
TODO: A python script to post and retrieve a transaction(s).
Running Tests
Run all the tests using:
$ docker-compose run --rm --no-deps bigchaindb pytest -v
Run tests from a file:
$ docker-compose run --rm --no-deps bigchaindb pytest /path/to/file -v
Run specific tests:
$ docker-compose run --rm --no-deps bigchaindb pytest /path/to/file -k "<test_name>" -v
Building Docs
You can also develop and build the BigchainDB docs using docker-compose:
$ docker-compose build bdocs
$ docker-compose up -d bdocs
The docs will be hosted on port 33333, and can be accessed over localhost, 127.0.0.1 OR http:/HOST_IP:33333.