That is Arenadata Cluster Manager Project aka Chapelnik
All standard Django commands are available.
Run dev server for the first time with these commands:
manage.py migrate
init_db.py
manage.py upgraderole
manage.py runserver --insecure
Re-run them when needed/applicable.
- assemble - information about the way we build product
- python - core django modules and python functions
- docs
- go - golang part of application. There is a status server here now.
- test
- spec - specification in form of Sphinx RST
- adcm-web - UI source
There is a Makefile in repo. It could be used for building application.
You have to have GNU Make on your host and Docker daemon accessible for a user. Also, you have to have access to ci.arenadata.io
# Clone repo
git clone https://github.com/arenadata/adcm
cd adcm
# Run build process for current architecture
make build
That will be an image hub.adsw.io/adcm/adcm:<branch_name> as a result of the operation above.
Makefile has self-documented help message. Just type.
$ make
buildbaseimage Build base image for ADCM's container. That is alpine with all packages.
build Build final docker image and all depended targets except baseimage.
buildjs Build client side js/html/css in directory wwwroot
buildss Build status server
clean Cleanup. Just a cleanup.
describe Create .version file with output of describe
help Shows that help
build2js For new design and api v2: Build client side js/html/css in directory wwwroot
build2 For new design and api v2: Build final docker image and all depended targets except baseimage
And check out the description for every operation available.
We are using black, pylint and pre-commit to care about code formatting and linting.
So you have to install pre-commit hook before you do something with code.
pip install pre-commit # Or do it with your preffered way to install pip packages
pre-commit install
After this you will see invocation of black and pylint on every commit.
-
Start container:
docker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data --name adcm hub.arenadata.io/adcm/adcm:latest
Use
-v /opt/adcm:/adcm/data:Z
for SELinux
PostgreSQL must be version 11 or newer - JSONB field used
- Start container:
Use
docker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data -e DB_HOST="DATABASE_HOSTNAME_OR_IP_ADDRESS" -e DB_PORT="DATABASE_TCP_PORT" -e DB_USER="DATABASE_USERNAME" -e DB_NAME="DATABASE_NAME" -e DB_PASS="DATABASE_USER_PASSWORD" --name adcm hub.arenadata.io/adcm/adcm:latest
-v /opt/adcm:/adcm/data:Z
for SELinux Target PostgreSQL DB must not have DB with nameDATABASE_NAME
NOTE:
adcm
is the ADCM's container name.
- Dump SQLite DB to file:
docker exec -it adcm /adcm/python/manage.py dumpdata --natural-foreign --natural-primary -o /adcm/data/var/data.json
- Stop container:
docker stop adcm docker rm adcm
- Start container in
MIGRATION_MODE
:Usedocker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data -e DB_HOST="DATABASE_HOSTNAME_OR_IP_ADDRESS" -e DB_PORT="DATABASE_TCP_PORT" -e DB_USER="DATABASE_USERNAME" -e DB_NAME="DATABASE_NAME" -e DB_PASS="DATABASE_USER_PASSWORD" -e MIGRATION_MODE=1 --name adcm hub.arenadata.io/adcm/adcm:latest
-v /opt/adcm:/adcm/data:Z
for SELinux Target PostgreSQL DB must not have DB with nameDATABASE_NAME
- Load dumped SQLite DB data to PostgreSQL
docker exec -it adcm /adcm/python/manage.py loaddata /adcm/data/var/data.json
- Stop container:
docker stop adcm docker rm adcm
- Start container:
docker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data -e DB_HOST="DATABASE_HOSTNAME_OR_IP_ADDRESS" -e DB_PORT="DATABASE_TCP_PORT" -e DB_USER="DATABASE_USERNAME" -e DB_NAME="DATABASE_NAME" -e DB_PASS="DATABASE_USER_PASSWORD" -e MIGRATION_MODE=0 --name adcm hub.arenadata.io/adcm/adcm:latest
-
add
-e
option todocker run
command:docker run ... -e LOG_LEVEL="INFO"
valid choices are:
DEBUG
,INFO
,WARNING
,ERROR
,CRITICAL
defaults to
ERROR