diff --git a/README.md b/README.md index 9b6a3969..14bd7faa 100644 --- a/README.md +++ b/README.md @@ -131,3 +131,54 @@ BEAGLE_AUTH_LDAP_SERVER_URI ``` Beagle can run without these, but it will not be able to access SMILE and LDAP server for authentication. + +# Development Instance using Podman + +In macOS: + +``` +brew install podman +podman machine init +sudo /opt/homebrew/Cellar/podman/5.7.1/bin/podman-mac-helper install # installs system helper to use default Docker API socket +podman machine start +``` + +Run with + +``` +podman compose -f compose.dev.yml down && podman compose -f compose.dev.yml up +``` + +## Initial configuration of the database is required. + +``` +python3 manage.py loaddata \ + beagle_etl.operator.json \ + file_system.filegroup.json \ + file_system.filetype.json \ + file_system.storage.json \ + runner.pipeline.json + +python3 manage.py createsuperuser # use prompts to create a super user for dev admin panel + +mkdir static +python3 manage.py collectstatic # for django admin panel themes +``` + +## Basic podman commands + +``` +podman ps # see running podman containers +podman exec -it /bin/bash # enter podman container + +# While in beagle container_id +python3 manage.py # run tests and other manage.py commands +``` + +By default, admin panel for dev env is accessible at http://localhost:5007/admin + +## TODO + +This is for basic, local development only. No connection to SMILE or RIDGEBACK services yet. + +Useful for developing new Django apps and running local tests for operators. Database entries beyond what's included above are left up to the developer. diff --git a/compose.dev.yml b/compose.dev.yml new file mode 100644 index 00000000..dd17ce04 --- /dev/null +++ b/compose.dev.yml @@ -0,0 +1,107 @@ +services: + api: + init: true + image: mskcc/beagle:2.2.0 + networks: + - beagle_net + build: + context: . + working_dir: /app + command: python manage.py runserver 0:5007 --noreload + volumes: + - .:/app:z + environment: + BEAGLE_DB_URL: db + BEAGLE_DB_NAME: beagle + BEAGLE_DB_USERNAME: beagle + BEAGLE_DB_PASSWORD: beagle + DJANGO_SETTINGS_MODULE: beagle.settings + BEAGLE_RABBITMQ_USERNAME: BEAGLE + BEAGLE_RABBITMQ_PASSWORD: beagle + BEAGLE_RABBITMQ_URL: rabbitmq:5672 + ports: + - "5007:5007" + depends_on: + - db + - rabbitmq + - memcached + + worker: + build: + context: . + working_dir: /app + networks: + - beagle_net + command: celery -A beagle_etl worker -l info + volumes: + - .:/app:z + environment: + DJANGO_SETTINGS_MODULE: beagle.settings + BEAGLE_DB_NAME: beagle + BEAGLE_DB_USERNAME: beagle + BEAGLE_DB_PASSWORD: beagle + CELERY_BROKER_URL: amqp://BEAGLE:beagle@rabbitmq:5672// + depends_on: + - rabbitmq + - db + + beat: + build: + context: . + working_dir: /app + networks: + - beagle_net + command: celery -A beagle_etl beat -l info + volumes: + - .:/app:z + environment: + DJANGO_SETTINGS_MODULE: beagle.settings + BEAGLE_DB_NAME: beagle + BEAGLE_DB_USERNAME: beagle + BEAGLE_DB_PASSWORD: beagle + CELERY_BROKER_URL: amqp://BEAGLE:beagle@rabbitmq:5672// + depends_on: + - rabbitmq + - db + + db: + image: postgres:16 + working_dir: /app + networks: + - beagle_net + environment: + POSTGRES_DB: beagle + POSTGRES_USER: beagle + POSTGRES_PASSWORD: beagle + BEAGLE_DB_NAME: beagle + BEAGLE_DB_USERNAME: beagle + BEAGLE_DB_PASSWORD: beagle + ports: + - "5433:5432" + volumes: + - pgdata:/var/lib/postgresql/data:z + - .:/app:z + + rabbitmq: + image: rabbitmq:3-management + networks: + - beagle_net + environment: + RABBITMQ_DEFAULT_USER: BEAGLE + RABBITMQ_DEFAULT_PASS: beagle + ports: + - "5672:5672" + - "15672:15672" # management UI + + memcached: + image: memcached:1.6 + networks: + - beagle_net + ports: + - "11211:11211" + +volumes: + pgdata: + +networks: + beagle_net: