1- # PY_VER=3.8 MYSQL_VER=5.7 DISTRO=alpine MINIO_VER=RELEASE.2022-08-11T04-37-28Z HOST_UID=$(id -u) docker compose -f local-docker-compose.yml up --build
1+ # MYSQL_VER=5.7 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml up --build
22version : ' 2.4'
3- x-net : &net
3+ x-net :
4+ &net
45 networks :
5- - main
6+ - main
67services :
78 db :
89 << : *net
@@ -28,23 +29,29 @@ services:
2829 # - ./minio/config:/root/.minio
2930 command : server --address ":9000" /data
3031 healthcheck :
31- test : ["CMD", "curl", "--fail", "http://minio:9000/minio/health/live"]
32+ test :
33+ [
34+ " CMD" ,
35+ " curl" ,
36+ " --fail" ,
37+ " http://minio:9000/minio/health/live"
38+ ]
3239 timeout : 5s
3340 retries : 60
3441 interval : 1s
3542 fakeservices.datajoint.io :
3643 << : *net
3744 image : datajoint/nginx:v0.2.4
3845 environment :
39- - ADD_db_TYPE=DATABASE
40- - ADD_db_ENDPOINT=db:3306
41- - ADD_minio_TYPE=MINIO
42- - ADD_minio_ENDPOINT=minio:9000
43- - ADD_minio_PORT=80 # allow unencrypted connections
44- - ADD_minio_PREFIX=/datajoint
45- - ADD_browser_TYPE=MINIOADMIN
46- - ADD_browser_ENDPOINT=minio:9000
47- - ADD_browser_PORT=80 # allow unencrypted connections
46+ - ADD_db_TYPE=DATABASE
47+ - ADD_db_ENDPOINT=db:3306
48+ - ADD_minio_TYPE=MINIO
49+ - ADD_minio_ENDPOINT=minio:9000
50+ - ADD_minio_PORT=80 # allow unencrypted connections
51+ - ADD_minio_PREFIX=/datajoint
52+ - ADD_browser_TYPE=MINIOADMIN
53+ - ADD_browser_ENDPOINT=minio:9000
54+ - ADD_browser_PORT=80 # allow unencrypted connections
4855 ports :
4956 - " 80:80"
5057 - " 443:443"
@@ -55,59 +62,5 @@ services:
5562 condition : service_healthy
5663 minio :
5764 condition : service_healthy
58- app :
59- << : *net
60- image : datajoint/djtest:py${PY_VER}-${DISTRO}
61- depends_on :
62- fakeservices.datajoint.io :
63- condition : service_healthy
64- environment :
65- - DJ_HOST=fakeservices.datajoint.io
66- - DJ_USER=root
67- - DJ_PASS=simple
68- - DJ_TEST_HOST=fakeservices.datajoint.io
69- - DJ_TEST_USER=datajoint
70- - DJ_TEST_PASSWORD=datajoint
71- # If running tests locally, make sure to add entry in /etc/hosts for 127.0.0.1 fakeservices.datajoint.io
72- - S3_ENDPOINT=fakeservices.datajoint.io
73- - S3_ACCESS_KEY=datajoint
74- - S3_SECRET_KEY=datajoint
75- - S3_BUCKET=datajoint.test
76- - PYTHON_USER=dja
77- - JUPYTER_PASSWORD=datajoint
78- - DISPLAY
79- working_dir : /src
80- command :
81- - sh
82- - -c
83- - |
84- set -e
85- pip install --user nose nose-cov
86- pip install -e .
87- pip list --format=freeze | grep datajoint
88- ## You may run the below tests once sh'ed into container i.e. docker exec -it datajoint-python_app_1 sh
89- # nosetests -vsw tests; #run all tests
90- # nosetests -vs --tests=tests.test_external_class:test_insert_and_fetch; #run specific basic test
91- # nosetests -vs --tests=tests.test_fetch:TestFetch.test_getattribute_for_fetch1; #run specific Class test
92- # flake8 datajoint --count --select=E9,F63,F7,F82 --show-source --statistics
93- # flake8 --ignore=E203,E722,W503 datajoint --count --max-complexity=62 --max-line-length=127 --statistics
94- # black datajoint --check -v
95- ## Remote debugger
96- set +e
97- while true
98- do
99- python -m ptvsd --host 0.0.0.0 --port 5678 --wait .
100- sleep 2
101- done
102- ports :
103- - " 8888:8888"
104- - " 5678:5678"
105- user : ${HOST_UID}:anaconda
106- volumes :
107- - .:/src
108- - /tmp/.X11-unix:/tmp/.X11-unix:rw
109- # Additional mounted notebooks may go here
110- # - ./notebook:/home/dja/notebooks
111- # - ../dj-python-101/ch1:/home/dja/tutorials
11265networks :
11366 main :
0 commit comments