diff --git a/.env b/.env index 8f82c01..da7dc52 100644 --- a/.env +++ b/.env @@ -3,8 +3,15 @@ DATADIR=./data ######################################################################## # APP ######################################################################## -APP_CLUSTERCOCKPIT_INIT=true -APP_ENVIRONMENT=prod +APP_CLUSTERCOCKPIT_INIT=false +APP_ENVIRONMENT=dev + +######################################################################## +# PHP +######################################################################## +PHP_XDEBUG_MODE=develop,debug +PHP_XDEBUG_CLIENT_PORT=9003 +PHP_XDEBUG_CLIENT_HOST=host.docker.internal ######################################################################## # MySQL @@ -22,6 +29,13 @@ INFLUXDB_PORT=8086 INFLUXDB_PASSWORD=2RPJpkrduLgkpfQCpcBe1jYv INFLUXDB_ADMIN_TOKEN=egLfcf7fx0FESqFYU3RpAAbj +######################################################################## +# LDAP +######################################################################## +LDAP_ADMIN_PASSWORD=mashup +LDAP_ORGANISATION=NHR@FAU +LDAP_DOMAIN=rrze.uni-erlangen.de + ######################################################################## # PHPMyAdmin ######################################################################## diff --git a/data/init.sh b/data/init.sh index d95f3e6..0600a85 100755 --- a/data/init.sh +++ b/data/init.sh @@ -1,5 +1,21 @@ #!/usr/bin/env bash +if [ -d symfony ]; then + echo "Data already initialized!" + echo -n "Perform a fresh initialisation? Answer yes to proceed and no to exit. " + read -r answer + if [ "$answer" == "yes" ]; then + echo "Cleaning directories ..." + rm -rf symfony + sudo rm -rf job-archive + rm -rf influxdb/data/* + echo "done." + else + echo "Aborting ..." + exit + fi +fi + mkdir symfony wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive.tar.xz tar xJf job-archive.tar.xz diff --git a/data/sql-source/ClusterCockpit-dev.sql b/data/sql-source/ClusterCockpit-dev.sql index 324b5aa..36cfa9c 100644 --- a/data/sql-source/ClusterCockpit-dev.sql +++ b/data/sql-source/ClusterCockpit-dev.sql @@ -41,7 +41,7 @@ CREATE TABLE `configuration` ( LOCK TABLES `configuration` WRITE; /*!40000 ALTER TABLE `configuration` DISABLE KEYS */; -INSERT INTO `configuration` VALUES (1,'plot_view_showRoofline','true','default','Show roofline plot','true|false',NULL,'Enter true or false'),(2,'plot_view_showPolarplot','true','default','Show polar plot','true|false',NULL,'Enter true or false'),(3,'plot_view_showStatTable','true','default','Show stat table','true|false',NULL,'Enter true or false'),(4,'plot_view_plotsPerRow','3','default','Plots per row in job view','[0-9]+',NULL,'Enter a positive integer'),(8,'plot_general_colorscheme','Accent','default','Plot color scheme','',NULL,''),(9,'plot_general_interactive','false','default','Interactive plots in job view','true|false',NULL,'Enter true or false'),(10,'plot_general_lineWidth','1','default','Line width for plots','[0-9]+',NULL,'Enter a positive integer'),(11,'plot_general_colorBackground','true','default','Color plot background','true|false',NULL,'Enter true or false'),(21,'general_user_scramble','false','default','Anonymize user names','',NULL,''),(22,'general_user_emailbase','@mail.de','default','Email base adress used in user imports','',NULL,''),(23,'plot_list_selectedMetrics','[\"cpu_load\",\"flops_any\",\"mem_bw\",\"mem_used\"]','default','Metrics to show in job list','',NULL,'Enter a JSON list'),(24,'plot_list_selectedMetrics','[\"cpu_load\",\"flops_any\",\"mem_bw\",\"mem_used\"]','admin','Metrics to show in job list','',NULL,'Enter a JSON list'),(25,'analysis_view_histogramMetrics','[\"cpu_load\",\"mem_used\",\"flops_any\",\"mem_bw\",\"cpi\",\"clock\"]','admin','Metrics to show in histograms in analysis view','',NULL,'Enter a JSON list'),(30,'job_view_nodestats_selectedMetrics','[\"flops_any\",\"mem_bw\",\"mem_used\",\"cpu_load\",\"clock\"]','admin','Metrics to show in stats table in job view','',NULL,'Enter a JSON list'),(31,'job_view_selectedMetrics','[\"flops_any\",\"mem_bw\",\"mem_used\",\"cpu_load\",\"cpi\",\"clock\",\"rapl_power\"]','admin','Metrics to show as plots in job view','',NULL,'Enter a JSON list'),(32,'analysis_view_scatterPlotMetrics','[[\"flops_any\",\"mem_bw\"],[\"flops_any\",\"cpu_load\"],[\"mem_bw\",\"cpu_load\"]]','admin','Metrics to show in scatter plots in analysis view','',NULL,'Enter a JSON list of metric pairs'); +INSERT INTO `configuration` VALUES (1,'plot_view_showRoofline','true','default','Show roofline plot','true|false',NULL,'Enter true or false'),(2,'plot_view_showPolarplot','true','default','Show polar plot','true|false',NULL,'Enter true or false'),(3,'plot_view_showStatTable','true','default','Show stat table','true|false',NULL,'Enter true or false'),(4,'plot_view_plotsPerRow','4','default','Plots per row in job view','[0-9]+',NULL,'Enter a positive integer'),(8,'plot_general_colorscheme','Accent','default','Plot color scheme','',NULL,''),(9,'plot_general_interactive','false','default','Interactive plots in job view','true|false',NULL,'Enter true or false'),(10,'plot_general_lineWidth','1','default','Line width for plots','[0-9]+',NULL,'Enter a positive integer'),(11,'plot_general_colorBackground','true','default','Color plot background','true|false',NULL,'Enter true or false'),(21,'general_user_scramble','false','default','Anonymize user names','',NULL,''),(22,'general_user_emailbase','@mail.de','default','Email base adress used in user imports','',NULL,''),(23,'plot_list_selectedMetrics','[\"cpu_load\",\"flops_any\",\"mem_bw\",\"mem_used\"]','default','Metrics to show in job list','',NULL,'Enter a JSON list'),(24,'plot_list_selectedMetrics','[\"cpu_load\",\"flops_any\",\"mem_bw\",\"mem_used\"]','admin','Metrics to show in job list','',NULL,'Enter a JSON list'),(25,'analysis_view_histogramMetrics','[\"cpu_load\",\"mem_used\",\"flops_any\",\"mem_bw\",\"cpi\",\"clock\"]','admin','Metrics to show in histograms in analysis view','',NULL,'Enter a JSON list'),(30,'job_view_nodestats_selectedMetrics','[\"flops_any\",\"mem_bw\",\"mem_used\",\"cpu_load\",\"clock\"]','admin','Metrics to show in stats table in job view','',NULL,'Enter a JSON list'),(31,'job_view_selectedMetrics','[\"flops_any\",\"mem_bw\",\"mem_used\",\"cpu_load\",\"cpi\",\"clock\",\"rapl_power\"]','admin','Metrics to show as plots in job view','',NULL,'Enter a JSON list'),(32,'analysis_view_scatterPlotMetrics','[[\"flops_any\",\"mem_bw\"],[\"flops_any\",\"cpu_load\"],[\"mem_bw\",\"cpu_load\"]]','admin','Metrics to show in scatter plots in analysis view','',NULL,'Enter a JSON list of metric pairs'),(34,'plot_list_jobsPerPage','25','default','Jobs per page in job list','',NULL,'Enter a positive integer'); /*!40000 ALTER TABLE `configuration` ENABLE KEYS */; UNLOCK TABLES; diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 5ec75c9..af25d19 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -1,33 +1,47 @@ services: - db: - volumes: - - ${DATADIR}/sqldata:/var/lib/mysql + db: + volumes: + - ${DATADIR}/sqldata:/var/lib/mysql - influxdb: - container_name: cc-influxdb - image: influxdb - command: ["--reporting-disabled"] - environment: - DOCKER_INFLUXDB_INIT_MODE: setup - DOCKER_INFLUXDB_INIT_USERNAME: symfony - DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD} - DOCKER_INFLUXDB_INIT_ORG: ClusterCockpit - DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit - DOCKER_INFLUXDB_INIT_RETENTION: 100w - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN} - ports: - - "127.0.0.1:${INFLUXDB_PORT}:8086" - volumes: - - ${DATADIR}/influxdb/data:/var/lib/influxdb2 - - ${DATADIR}/influxdb/config:/etc/influxdb2 + influxdb: + container_name: cc-influxdb + image: influxdb + command: ["--reporting-disabled"] + environment: + DOCKER_INFLUXDB_INIT_MODE: setup + DOCKER_INFLUXDB_INIT_USERNAME: symfony + DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD} + DOCKER_INFLUXDB_INIT_ORG: ClusterCockpit + DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit + DOCKER_INFLUXDB_INIT_RETENTION: 100w + DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN} + ports: + - "127.0.0.1:${INFLUXDB_PORT}:8086" + volumes: + - ${DATADIR}/influxdb/data:/var/lib/influxdb2 + - ${DATADIR}/influxdb/config:/etc/influxdb2 - phpmyadmin: - container_name: cc-phpmyadmin - image: phpmyadmin - environment: - - PMA_HOST=cc-db - - PMA_USER=root - - PMA_PASSWORD=${MYSQL_ROOT_PASSWORD} - ports: - - "127.0.0.1:${PHPMYADMIN_PORT}:80" - restart: always + openldap: + container_name: cc-ldap + image: osixia/openldap:1.5.0 + command: --copy-service --loglevel debug + environment: + - LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD} + - LDAP_ORGANISATION=${LDAP_ORGANISATION} + - LDAP_DOMAIN=${LDAP_DOMAIN} + volumes: + - ${DATADIR}/ldap:/container/service/slapd/assets/config/bootstrap/ldif/custom + ports: + - "127.0.0.1:389:389" + - "127.0.0.1:636:636" + + phpmyadmin: + container_name: cc-phpmyadmin + image: phpmyadmin + environment: + - PMA_HOST=cc-db + - PMA_USER=root + - PMA_PASSWORD=${MYSQL_ROOT_PASSWORD} + ports: + - "127.0.0.1:${PHPMYADMIN_PORT}:80" + restart: always diff --git a/docker-compose.yml b/docker-compose.yml index 0a0ee11..55e4904 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,10 +27,14 @@ services: build: context: ./php-fpm args: + PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE} + PHP_XDEBUG_CLIENT_PORT: ${PHP_XDEBUG_CLIENT_PORT} + PHP_XDEBUG_CLIENT_HOST: ${PHP_XDEBUG_CLIENT_HOST} SYMFONY_CLI_VERSION: 4.23.2 MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} + LDAP_PASSWORD: ${LDAP_ADMIN_PASSWORD} INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD} INFLUXDB_PORT: ${INFLUXDB_PORT} INFLUXDB_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN} @@ -55,6 +59,7 @@ services: APP_ENVIRONMENT: ${APP_ENVIRONMENT} ports: - "127.0.0.1:${NGINX_PORT}:80" + - "127.0.0.1:${PHP_XDEBUG_CLIENT_PORT}:${PHP_XDEBUG_CLIENT_PORT}" depends_on: - php environment: