Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Merge Test to Stable #737

Merged
merged 128 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
660d3da
add error handling to migration 27 in case of missing syke.csv file
Nov 9, 2020
1468980
split settings with django-split-settings, enable root logger, add .e…
Nov 9, 2020
e732a85
split settings with django-split-settings, enable root logger, add .e…
Nov 9, 2020
a5d9424
replace redis client with new implementation, replace yml file with s…
Nov 10, 2020
8329595
integrate refdata loading as a task
Nov 10, 2020
07063bd
disable simplexquery library
Nov 10, 2020
f622574
remove unnecessary 403 error on flush_records
Nov 10, 2020
4b29382
remove the yaml loading blocks
Nov 10, 2020
2f82f95
replace configs with env variables
Nov 10, 2020
4f0f288
fix some unnecessary asserts in tests
Nov 10, 2020
c4ef44d
remove unnecessary request logging logic
Nov 10, 2020
8126e57
update .gitignore, deps, and travis. Create .env.template
Nov 10, 2020
83b0945
delete settings.py
Nov 10, 2020
c41ff42
update readme
Nov 10, 2020
533bc29
format readme to look more clear
Nov 10, 2020
51b060f
fix readme typo
Nov 10, 2020
ad15f4a
fix more readme typo
Nov 10, 2020
1ea7b4a
fix ENV_VARS instructions
Nov 10, 2020
1eb2c74
fix typos in ENV_VARS.md, add Mac instructions to Docker-Engine in re…
Nov 10, 2020
d98cfae
fix typos in ENV_VARS.md, add Mac instructions to Docker-Engine in re…
Nov 10, 2020
3056c0c
fix instructions on env variables
Nov 10, 2020
54e90f6
fix mkcerts 20.20.20 host to 20.20.20.20
Nov 10, 2020
c62bc74
fix .certs folder location in readme
Nov 10, 2020
301f0ab
fix env var file locations in readme
Nov 10, 2020
a11e9aa
Update Initial setup commands in readme
Nov 11, 2020
957b8e7
CSCFAIRADM-375: [ADD] instructions for mac and for db creation (#679)
tompulli Nov 11, 2020
3a3e8bd
add error handling to migration 27 in case of missing syke.csv file
Nov 9, 2020
54500c1
split settings with django-split-settings, enable root logger, add .e…
Nov 9, 2020
2a10f88
split settings with django-split-settings, enable root logger, add .e…
Nov 9, 2020
716ef53
replace redis client with new implementation, replace yml file with s…
Nov 10, 2020
098a92a
integrate refdata loading as a task
Nov 10, 2020
b198d54
disable simplexquery library
Nov 10, 2020
804fea4
remove unnecessary 403 error on flush_records
Nov 10, 2020
7241b72
remove the yaml loading blocks
Nov 10, 2020
c856e92
replace configs with env variables
Nov 10, 2020
7280fb7
fix some unnecessary asserts in tests
Nov 10, 2020
16a4f32
remove unnecessary request logging logic
Nov 10, 2020
7078347
update .gitignore, deps, and travis. Create .env.template
Nov 10, 2020
f27feff
delete settings.py
Nov 10, 2020
cfd38bd
update readme
Nov 10, 2020
d595680
format readme to look more clear
Nov 10, 2020
7c7e741
fix readme typo
Nov 10, 2020
8f4bf9f
fix more readme typo
Nov 10, 2020
5ffae9d
fix ENV_VARS instructions
Nov 10, 2020
297d4b7
fix typos in ENV_VARS.md, add Mac instructions to Docker-Engine in re…
Nov 10, 2020
460d5b9
fix typos in ENV_VARS.md, add Mac instructions to Docker-Engine in re…
Nov 10, 2020
e29e167
fix instructions on env variables
Nov 10, 2020
c038b02
fix mkcerts 20.20.20 host to 20.20.20.20
Nov 10, 2020
b0e38a7
fix .certs folder location in readme
Nov 10, 2020
4287c65
fix env var file locations in readme
Nov 10, 2020
c695c49
Update Initial setup commands in readme
Nov 11, 2020
6bb2c5f
CSCFAIRADM-375: [ADD] instructions for mac and for db creation (#679)
tompulli Nov 11, 2020
fe489c6
edit new settings based on rebase test
Nov 11, 2020
e962d9d
Merge remote-tracking branch 'origin/CSCFAIRADM-375-local-env' into C…
Nov 11, 2020
63dd312
try to fix travis error, make local env setup more clear based on fee…
Nov 11, 2020
bfc1d2c
disable raise exception if no cache on startup
Nov 12, 2020
6a2f629
more env vars with sensible defaults, add portainer templates, make r…
Nov 13, 2020
82d4b36
fix folder env default values
Nov 13, 2020
1a445c3
add watchman system monitoring, bind elasticsearch hosts to env
Nov 13, 2020
c803478
fix redis status check bug
Nov 16, 2020
cdb95fe
disable tests testing file permissions, make elasticsearch take its h…
Nov 16, 2020
abe38de
update initial setup commands section, fix error in redis container s…
Nov 17, 2020
cf52474
typography
Nov 17, 2020
f579409
remove not required env vars from .env.template, add create log direc…
Nov 17, 2020
b7100f5
ic ENV on startup
Nov 17, 2020
2cbd123
Fix unhandled error in checks, run system checks on startup
Nov 18, 2020
92986bd
Allow all hosts if environment is local
Nov 18, 2020
847cad0
Increase logging on redis and rabbitmq connections, fix rabbitmq retr…
Nov 18, 2020
a9a3d6e
expose extra port for testing, fix docker env access issues
Nov 18, 2020
d3f0dd2
rewrite auth handling in flush_records endpoint
Nov 19, 2020
0a6c860
disable incorrectly working unit-tests
Nov 19, 2020
17d33b1
enable simplexquery functionality
Nov 19, 2020
3fa90a4
add xqilla deps to Dockerfile, metax container now removes itself whe…
Nov 19, 2020
dc36d1a
add xqilla deps to Dockerfile, metax container now removes itself whe…
Nov 19, 2020
c095134
paint it black
Nov 19, 2020
7be045a
update .env.template, one more blacked file
Nov 19, 2020
e30c7a0
optimize imports
Nov 19, 2020
0f22b33
CSCFAIRADM-375: [FIX] typos in variables and ignore log directory
tompulli Nov 25, 2020
7e1c63a
Merge pull request #686 from CSCfi/CSCFAIRADM-375-fixes
tompulli Dec 1, 2020
45f51f4
CSCFAIRMETA-701: [FIX] crash on v2 dataset rpc api
tompulli Dec 1, 2020
a9a91aa
CSCFAIRMETA-701: trigger travis
tompulli Dec 1, 2020
6322e55
Update-test-db-with-migrations
Dec 7, 2020
680dae5
Update-test-db-with-migrations
Dec 7, 2020
335f8c5
Merge pull request #712 from CSCfi/Update-test-db-with-migrations
katrite Dec 8, 2020
7d22609
Merge pull request #704 from CSCfi/CSCFAIRMETA-701-bug-v2-create-new-…
tompulli Dec 8, 2020
9281466
fix filepermissions, test tweaks
Dec 8, 2020
a148d5d
Merge remote-tracking branch 'origin/CSCFAIRADM-375-local-env' into C…
Dec 8, 2020
887c52b
merge test
Dec 9, 2020
a3fb782
Bump django from 3.1.2 to 3.1.4
dependabot[bot] Dec 9, 2020
abad8e1
Modify-JYU-catalog-logo
Dec 10, 2020
b07e557
Merge branch 'test' into Modify-JYU-catalog-logo
katrite Dec 10, 2020
e29299e
Merge pull request #721 from CSCfi/Modify-JYU-catalog-logo
katrite Dec 10, 2020
a05aece
Document env vars (#720)
Dec 10, 2020
66d96cb
add OAI env vars OAI_REPOSITORY_NAME, OAI_ETSIN_URL_TEMPLATE and OAI_…
Dec 15, 2020
2129527
Add env var to control if rabbitmq should use vhost. Change RabbitMQ …
Dec 16, 2020
09f8bde
CSCFAIRMETA-799-RabbitMQ-TTV (#722)
katrite Dec 17, 2020
c861558
CSCFAIRMETA-799-RabbitMQ-TTV-fix-settings (#728)
katrite Dec 17, 2020
a369ddb
Add-files-to-att-dataset (#732)
katrite Jan 5, 2021
feee471
travis changes
Nov 19, 2020
8572624
remove branches only conf
Nov 19, 2020
4a4c749
see what causes the pipe fail
Nov 20, 2020
6e18b1b
change command to see if it is flake8
Nov 20, 2020
391b997
Delete old settings file since it is not used anymore
tompulli Dec 21, 2020
feaafea
Add ENVs to travis.yml and fixed related settings
tompulli Jan 4, 2021
1e4645e
linting and removed unnecessary setting variable
tompulli Jan 4, 2021
9014841
fix flake8 problems and ones that are consequent
tompulli Jan 4, 2021
eab00cd
add directory for logs during travis before_script
tompulli Jan 4, 2021
de5c837
add rabbitmq hosts to default env
tompulli Jan 4, 2021
c6a1fc6
start using real redis in travis
tompulli Jan 5, 2021
34acfd4
fix typos, logging and remove deploy from travis
tompulli Jan 5, 2021
10cfe93
further clean logging and fix rems related tests
tompulli Jan 5, 2021
e8f4505
"final" logging clean
tompulli Jan 5, 2021
81f35b6
Merge pull request #684 from CSCfi/travis_update
tompulli Jan 8, 2021
f6a8d08
Add-files-to-att-dataset (#734)
katrite Jan 8, 2021
1df5a96
Att test dataset (#736)
katrite Jan 8, 2021
2958946
Cscfairmeta 847 relax draft validation (#740)
tompulli Jan 19, 2021
8f89fd2
CSCFAIRMETA-890-DOI-as-pref-identifier (#741)
katrite Jan 19, 2021
1a86864
CSCFAIRMETA-776: [ADD] Bulk delete (#725)
genie9 Jan 22, 2021
e9c16b9
CSCFAIRMETA-847: [FIX] bug where files could not be added to drafts
tompulli Jan 20, 2021
663520b
Merge pull request #742 from CSCfi/CSCFAIRMETA-847-fix-draft-validation
tompulli Jan 25, 2021
b5ce639
Api endpoints env (#743)
Jan 27, 2021
c8ee105
Merge branch 'test' into dependabot/pip/django-3.1.4
Jan 27, 2021
d43b073
remove test comparing datetimes down to seconds as not needed (#744)
Jan 27, 2021
5cd20ad
Bump djangorestframework from 3.12.1 to 3.12.2 (#718)
dependabot[bot] Jan 27, 2021
acee27d
update deps
Jan 27, 2021
f5531ba
Bump lxml from 4.6.1 to 4.6.2 (#733)
dependabot[bot] Jan 27, 2021
35c1778
Bump pytz from 2020.1 to 2020.5 (#730)
dependabot[bot] Jan 27, 2021
7cd79b3
Merge branch 'stable' into test
Jan 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified .flake8
100644 → 100755
Empty file.
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
ubuntu-xenial-16.04-cloudimg-console.log
.ropeproject/
.venv_metax/
.env
.env.*
!.env.template
*.pem
/src/log
60 changes: 42 additions & 18 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,63 @@ dist: trusty
language: python
python: 3.6

branches:
only:
- test
- stable

cache: pip

addons:
apt:
packages:
- xqilla
- libxqilla-dev
postgresql: '9.6'

services:
- postgresql
- postgresql
- redis-server

before_install:
- openssl aes-256-cbc -K $encrypted_62ed3fb8af4c_key -iv $encrypted_62ed3fb8af4c_iv -in deploy-key.enc -out deploy-key -d
- rm deploy-key.enc
- chmod 600 deploy-key
- mv deploy-key ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- sudo apt-get install xqilla libxqilla-dev
env:
global:
- AUTH_SERVER_LOGOUT_URL=http://logout
- DATACITE_PREFIX=10.12345
- DATACITE_URL=http://mockurl.com
- DATACITE_ETSIN_URL_TEMPLATE=http://mockurl.com/%s
- DATACITE_PASSWORD=not_set
- DATACITE_USERNAME=not_set
- DEBUG=false
- DJANGO_ENV=travis
- DJANGO_SECRET_KEY=lxpRfm8.JOUa7K.eOxZGtL*o+.zt.ybj
- DRAFT_ENABLED=true
- ELASTIC_SEARCH_HOSTS=https://metax.fd-test.csc.fi/es
- ELASTIC_SEARCH_USE_SSL=true
- METAX_DATABASE=metax_db_test
- METAX_DATABASE_PASSWORD=
- METAX_DATABASE_USER=metax_test
- OAI_BASE_URL=http://mockurl.com
- OAI_ETSIN_URL_TEMPLATE=http://mockurl.com/%s
- [email protected]
- REMS_ENABLED=true
- REMS_API_KEY=not_set
- REMS_BASE_URL=http://mockurl.com
- REMS_ETSIN_URL_TEMPLATE=http://mockurl.com/%s
- REMS_METAX_USER=not_set
- REMS_REPORTER_USER=not_set
- REMS_AUTO_APPROVER=not_set
- REMS_FORM_ID=99
- ENABLE_V1_ENDPOINTS=true
- ENABLE_V2_ENDPOINTS=true

install:
- pip install -r requirements.txt
- sudo service postgresql restart

before_script:
- psql -U postgres < resources/sql/init_test.sql
- sudo mkdir /var/log/metax-api
- sudo chown -R $USER:$USER /var/log/metax-api
- sudo mkdir -p src/log
- sudo chown -R $USER:$USER src/log

script:
- cd src && flake8 . && python manage.py migrate metax_api && coverage run --source="." manage.py test metax_api && COVERALLS_REPO_TOKEN=$coveralls_token coveralls && $TRAVIS_BUILD_DIR/.travis-deploy.sh
- cd src && flake8 .
- python manage.py migrate metax_api
- coverage run --source="." manage.py test metax_api
- COVERALLS_REPO_TOKEN=$coveralls_token coveralls

notifications:
flowdock:
Expand Down
Empty file modified AUTHORS
100644 → 100755
Empty file.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3.6

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

WORKDIR /code

COPY requirements.txt /code/

RUN apt-get update && apt install xqilla libxerces-c-dev build-essential libssl-dev libffi-dev python-dev libxqilla-dev -y

RUN pip install --upgrade pip wheel
RUN pip install -r requirements.txt

EXPOSE 8008
EXPOSE 8006

ARG METAX_DATABASE_HOST
ARG REDIS_HOST
ARG RABBITMQ_HOST
ARG RABBIT_MQ_PASSWORD=guest
ARG RABBIT_MQ_USER=guest
ARG ELASTIC_SEARCH_HOST

ENV METAX_DATABASE_HOST $METAX_DATABASE_HOST
ENV REDIS_HOST $REDIS_HOST
ENV RABBIT_MQ_HOSTS $RABBITMQ_HOST
ENV RABBIT_MQ_PASSWORD $RABBIT_MQ_PASSWORD
ENV RABBIT_MQ_USER $RABBIT_MQ_USER
ENV ELASTIC_SEARCH_HOSTS $ELASTIC_SEARCH_HOST

# CMD ["python", "/code/manage.py", "runserver", "0.0.0.0:8008"]
CMD ["python", "manage.py", "runsslserver", "--certificate", ".certs/cert.pem","--key", ".certs/key.pem", "0.0.0.0:8008"]
62 changes: 62 additions & 0 deletions ENV_VARS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Required environmental variables

copy .env.template to .env and fill the required values from below table. Required column tells if you have to have the variable in the .env file

| Name | Required | Default | Description |
| ------------------------------ | -------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ADDITIONAL_USER_PROJECTS_PATH | unknown | "" | No clue if this is important |
| ALLOWED_HOSTS | no | | defines which IP-addresses are allowed to access metax, DJANGO_ENV=local overrides this |
| AUTH_SERVER_LOGOUT_URL | unknown | | Requires testing if this is needed |
| DATACITE_ETSIN_URL_TEMPLATE | yes | |
| DATACITE_PASSWORD | yes | |
| DATACITE_PREFIX | yes | |
| DATACITE_URL | yes | |
| DATACITE_USERNAME | yes | |
| DEBUG | no | False |
| DJANGO_ENV | no | local | Specifies the environment, corresponds with the environments found in src/metax_api/settings/environments/ |
| DJANGO_SECRET_KEY | yes | |
| DRAFT_ENABLED | no | |
| ELASTIC_SEARCH_HOSTS | yes | | Elastic Search instance IP and port |
| ELASTIC_SEARCH_PORT | no | 9200 | Is not used currently, but should be in the future |
| ELASTIC_SEARCH_USE_SSL | yes | | Should Elastic Search queries use https |
| ERROR_FILES_PATH | no | src/log/errors | Error file folder |
| ES_CONFIG_DIR | no | src/metax_api/tasks/refdata/refdata_indexer/resources/es-config | metax-ops compatibility |
| LOCAL_REF_DATA_FOLDER | no | src/metax_api/tasks/refdata/refdata_indexer/resources/local-refdata | metax-ops compatibility |
| LOGGING_DEBUG_HANDLER_FILE | no | src/log/metax_api.log | metax-ops compatibility |
| LOGGING_GENERAL_HANDLER_FILE | no | src/log/metax_api.log | metax-ops compatibility |
| LOGGING_JSON_FILE_HANDLER_FILE | no | src/log/metax_api.json.log | metax-ops compatibility |
| METAX_API_ROOT | yes | | Metax internal variable, must be https |
| METAX_DATABASE | yes | | Postgres database name |
| METAX_DATABASE_PASSWORD | yes | | Postgres database password |
| METAX_DATABASE_PORT | no | 5432 | Postgres instance exposed port |
| METAX_DATABASE_USER | yes | | Postgres user which owns the database |
| METAX_ENV | no | local_development | Used by Metax internally, should be replaced with DJANGO_ENV in the future |
| OAI_BASE_URL | yes | |
| ORG_FILE_PATH | yes | src/metax_api/tasks/refdata/refdata_indexer/resources/organizations/organizations.csv | metax-ops compatibility |
| RABBIT_MQ_HOSTS | yes | | RabbitMQ instance IP |
| RABBIT_MQ_PASSWORD | no | guest |
| RABBIT_MQ_PORT | no | 5672 |
| RABBIT_MQ_TTV_ENABLED | no | |
| RABBIT_MQ_USER | no | guest |
| RABBIT_MQ_VHOST | no | |
| RABBIT_MQ_VHOST_TTV | no | |
| REDIS_HOST | yes | | Redis instance IP |
| REDIS_LOCALHOST_PORT | unknown | 6379 | Not sure if all references to this are gone |
| REDIS_PASSWORD | no | |
| REDIS_PORT | no | 6379 |
| REDIS_TEST_DB | yes | | Pick a number, any number |
| REDIS_USE_PASSWORD | no | false |
| REMS_API_KEY | no |
| REMS_AUTO_APPROVER | no |
| REMS_BASE_URL | no |
| REMS_ENABLED | no |
| REMS_ETSIN_URL_TEMPLATE | yes | |
| REMS_FORM_ID | yes | |
| REMS_METAX_USER | no |
| REMS_REPORTER_USER | no |
| SERVER_DOMAIN_NAME | no |
| TRAVIS | no | false | Metax internal used to figure out if Metax is running on Travis virtual machine |
| V1_ENABLED | no | |
| V2_ENABLED | no | |
| VALIDATE_TOKEN_URL | yes | |
| WKT_FILENAME | no | src/metax_api/tasks/refdata/refdata_indexer/resources/uri_to_wkt.json |
Empty file modified LICENSE
100644 → 100755
Empty file.
123 changes: 123 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,126 @@ License
Copyright (c) 2018-2020 Ministry of Education and Culture, Finland

Licensed under [GNU GPLv2 License](LICENSE)


## Setting up local development environment

### Prerequisites

#### Docker-Engine

Install Docker-Engine either following instructions below or looking up your platform specific instructions [from docs.docker.com][1]

##### Linux

`$ curl -fsSL https://get.docker.com -o get-docker.sh`

`$ sudo sh get-docker.sh`

`$ sudo usermod -aG docker $USER`

Log out and back in to activate non-sudo docker capabilities

##### Mac

https://docs.docker.com/docker-for-mac/install/

#### Portainer (Optional)

We will use portainer container management tool for monitoring various development dependencies. Command below will start portainer on every system startup.

`$ docker volume create portainer_data` (optional for mac)

`$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce`

Finish the Portainer setup by logging in at http://localhost:9000, create a local endpoint from the Portainer interface.

#### Docker commands

__NOTICE If you want to start the services everytime your computer boots, replace `--restart=unless-stopped` with `--restart=always`__

Run the following docker commands to start services:

##### Redis

`docker run -d -p 6379:6379 --name metax-redis -v metax-redis:/data --restart=unless-stopped redis`

##### Postgres

`docker run -d -p 5432:5432 --name metax-postgres -v metax-postgres:/var/lib/postgresql96/data -e POSTGRES_USER=metax_db_user -e POSTGRES_PASSWORD=YMDLekQMqrVKcs3 -e POSTGRES_DB=metax_db --restart=unless-stopped postgres:9`

__NOTICE: copy values of `POSTGRES_USER`, `POSTGRES_PASSWORD` and `POSTGRES_DB` into your `.env` files as `METAX_DATABASE_USER`, `METAX_DATABASE_PASSWORD` and `METAX_DATABASE`__

##### Elasticsearch

`docker run -d -p 9200:9200 -p 9300:9300 -v metax-es:/usr/share/elasticsearch/data --name metax-es -e discovery.type=single-node --restart=unless-stopped elasticsearch:7.9.2`

##### RabbitMQ

`docker run -d -p 5671:5671 -p 5672:5672 -p 15672:15672 -v metax-rabbitmq:/var/lib/rabbitmq --name metax-rabbitmq --restart=unless-stopped rabbitmq:3-management`

#### mkcerts

Install [mkcerts][2] and run `mkcert -install` and after it the following command:
`mkcert -cert-file cert.pem -key-file key.pem 0.0.0.0 localhost 127.0.0.1 ::1 metax.csc.local 20.20.20.20`
Move the `cert.pem` and `key.pem` to `src/.certs` folder (create the folder if not present).

### Required environmental variables

copy `src/metax_api/settings/.env.template` as `src/metax_api/settings/.env` and fill required variables, you can find examples in ENV_VARS.md

### Create log directory

`mkdir -p src/log/errors`

### Run Metax inside a container (Optional)

Check the IP addresses of Redis, RabbitMQ, ElasticSearch and Postgres:9 either from Portainer container list (click the link in the container name to see all attributes) or by going to portainer network tab or by typing `docker container ps` followed by `docker network inspect bridge`

Build new docker image from repository root with this command (change ip-addresses to real ones:

`docker build -t metax-api:latest --build-arg METAX_DATABASE_HOST=xxx.xx.x.x --build-arg REDIS_HOST=xxx.xx.x.x --build-arg RABBITMQ_HOST=xxx.xx.x.x --build-arg ELASTIC_SEARCH_HOST=xxx.xx.x.x:xxxx .`

Run the built container with command:

`docker run -it --name metax-web --mount type=bind,source="$(pwd)"/src,target=/code -p 8008:8008 --rm metax-api:latest`

You should see metax-server starting at port 8008 with hot reload enabled

### Initial setup commands
docker network inspect bridge
IF you configured metax-container, access the command line of the container with `docker exec -it metax-web bash`

__NOTICE: Skip activating virtualenv and navigating to src folder if you have metax running on container__

Activate your python 3.6 virtualenv, `cd` into `src` folder and run following commands:

setup the database with migrate command:

`python manage.py migrate`

__NOTICE: Skip following steps if your running metax on container and have terminal open in the container__

start the development server with:
`python manage.py runsslserver --certificate .certs/cert.pem --key .certs/key.pem 8008`

Open another terminal and `cd` into `src`, and load the initial data with following commands:

__These commands must be run in both setups (container/not-container metax)__

`python manage.py index_refdata`

`python manage.py reload_refdata_cache`

`python manage.py loadinitialdata`

`python manage.py loaddata metax_api/tests/testdata/test_data.json`

run the tests with command `DJANGO_ENV=test python manage.py test --failfast --keepdb -v 0`

Metax api is available from your browser at https://localhost:8008


[1]: https://docs.docker.com/engine/install/
[2]: https://github.com/FiloSottile/mkcert

Loading