1 unstable release

0.5.1 Aug 19, 2020

#12 in #zeromq

48 downloads per month
Used in 2 crates

MIT license

63KB
1.5K SLoC

rust-datastreamcorelib

Rust version of https://gitlab.com/advian-oss/python-datastreamcorelib

Docker

Remember to add any new system packages you install via the devel_shell to the Dockerfile too. Easy way to check if you remembered everything is to rebuild the test image and run it (see below).

SSH agent forwarding

We need buildkit:

export DOCKER_BUILDKIT=1

And also the exact way for forwarding agent to running instance is different on OSX:

export DOCKER_SSHAGENT="-v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock"

and Linux:

export DOCKER_SSHAGENT="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK"

Creating the container

Build image, create container and start it:

docker build --ssh default --target devel_shell -t rustdatastreamcorelib:devel_shell .
docker create --name rustdatastreamcorelib_devel -v `pwd`":/app" -it `echo $DOCKER_SSHAGENT` rustdatastreamcorelib:devel_shell
docker start -i rustdatastreamcorelib_devel

This will give you a shell with system level dependencies installed, you should do any shell things (like run tests, pre-commit checks etc) there.

pre-commit considerations

If working in Docker instead of native env you need to run the pre-commit checks in docker too:

docker exec -i rustdatastreamcorelib_devel /bin/bash -c "pre-commit install"
docker exec -i rustdatastreamcorelib_devel /bin/bash -c "pre-commit run --all-files"

You need to have the container running, see above. Or alternatively use the docker run syntax but using the running container is faster:

docker run --rm -v `pwd`":/app" rustdatastreamcorelib:devel_shell -c "pre-commit run --all-files"

Test suite

You can use the devel shell to run py.test when doing development, for CI use the "test" target in the Dockerfile:

docker build --ssh default --target test -t rustdatastreamcorelib:test .
docker run --rm -v `pwd`":/app" `echo $DOCKER_SSHAGENT` rustdatastreamcorelib:test

Dependencies

~3–4.5MB
~81K SLoC