Project

General

Profile

Hacking Python SDK » History » Version 5

Tom Clegg, 07/04/2014 01:12 PM

1 1 Tom Clegg
h1. Hacking Python SDK
2
3
{{toc}}
4
5
h2. Prerequisites
6
7
<pre>
8
sudo apt-get install python python-pip python-dev python-virtualenv libyaml-dev
9
</pre>
10
11 4 Tom Clegg
Additional prerequisites for FUSE driver:
12
13
<pre>
14 5 Tom Clegg
sudo apt-get install libattr1-dev libfuse-dev pkg-config fuse
15
sudo adduser "$USER" fuse
16
sudo chmod g+rw /dev/fuse
17
sudo chown root:fuse /dev/fuse
18 1 Tom Clegg
</pre>
19 5 Tom Clegg
20
After installing @fuse@ and adding yourself to the @fuse@ group, you need to start a new login session. Make sure the @groups@ command reports that you're in the @fuse@ group.
21
22
23 4 Tom Clegg
24 1 Tom Clegg
h2. Get the source code
25
26
<pre>
27
cd
28
git clone https://github.com/curoverse/arvados.git
29
</pre>
30
31
h2. Run tests
32
33
Strategy:
34
# Install your local (possibly modified) client library to a virtualenv
35
# Run the client library test suite
36 3 Tom Clegg
# Build a client library package and install it to the virtualenv
37 1 Tom Clegg
# Install your local (possibly modified) FUSE driver to the same virtualenv
38
# Run the FUSE driver test suite
39 3 Tom Clegg
# Build a FUSE driver package and install it to the virtualenv
40 1 Tom Clegg
41 2 Tom Clegg
Note: The test suite brings up a Keep server and an API server to run tests against. For best results:
42
* Try [[Hacking Keep]] and [[Hacking API Server]] to make sure you have all the right dependencies for running the Keep and API servers.
43
* Make sure you have a blob_signing_key in services/api/config/application.yml
44 1 Tom Clegg
45
Script:
46
47
<pre>
48
VENVDIR=$(mktemp -d)
49
virtualenv --setuptools --system-site-packages "$VENVDIR"
50
51
cd ~/arvados/sdk/python
52 4 Tom Clegg
"$VENVDIR/bin/pip" install -r requirements.txt
53 1 Tom Clegg
"$VENVDIR/bin/pip" install -e .
54
GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests
55
56
"$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1
57
"$VENVDIR/bin/pip" install dist/arvados-python-client-0.1.*.tar.gz
58
59
cd ~/arvados/services/fuse
60 4 Tom Clegg
"$VENVDIR/bin/pip" install -r requirements.txt
61 1 Tom Clegg
"$VENVDIR/bin/pip" install -e .
62
GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests
63
64
"$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1
65
"$VENVDIR/bin/pip" install dist/arvados_fuse-0.1.*.tar.gz
66
</pre>