A story of auto-deploying without the chat
In order to cover requirements from @matthieu which is to deploy a test instance:
- Federated -> will use test6 and test8 for that
- WIth lots of datas -> users/projects to be generated through the available fixtures in the djangoldp tests directory
- With everything chat-related disabled (especially no initialization of converse)
I went to both update test6 which looked to be unused and deploy a new test8.
My first try was to remove the chat, projects and circles bloxes and the XMPP configurations from the yml file to get the following:
---
apps:
hosts:
test8:
graphics:
client: test8.startinblox.com
title: Another instance without chat
data:
api: api.test8.startinblox.com
services:
email:
matomo:
host: matomo.startinblox.com
xmpp:
host:
domain:
bloxes:
- type: international
- type: registering
- type: account
- type: notification
- type: admin
- type: about
- type: dashboard
- type: directory
- type: communities
title: NoChat
- type: job-board
route: job-offers
- type: events
- type: conversation
- type: uploader
- type: skill
- type: analytics
And launch the deployment script with the --skip-tags=prosody
from the command line.
That resulted on errors from djangoldp_community
models.py needing both djangoldp_project.models.Project
and djangoldp_circle.models.Circle
models to exist, giving that output:
{
"changed":true,
"cmd":[
"djangoldp",
"configure"
],
"delta":"0:00:01.173128",
"end":"2021-09-21 14:12:35.564792",
"msg":"non-zero return code",
"rc":1,
"start":"2021-09-21 14:12:34.391664",
"stderr":"Traceback (most recent call last):\n File \"/home/test6/startinblox/sibserver/manage.py\", line 25, in <module>\n execute_from_command_line(sys.argv)\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line\n utility.execute()\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/core/management/__init__.py\", line 357, in execute\n django.setup()\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/__init__.py\", line 24, in setup\n apps.populate(settings.INSTALLED_APPS)\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/apps/registry.py\", line 114, in populate\n app_config.import_models()\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/apps/config.py\", line 211, in import_models\n self.models_module = import_module(models_module_name)\n File \"/usr/alwaysdata/python/3.6.10/lib/python3.6/importlib/__init__.py\", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 955, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 665, in _load_unlocked\n File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/djangoldp_community/models.py\", line 16, in <module>\n from djangoldp_circle.models import Circle\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/djangoldp_circle/models.py\", line 37, in <module>\n class Circle(Model):\n File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/db/models/base.py\", line 111, in __new__\n \"INSTALLED_APPS.\" % (module, name)\nRuntimeError: Model class djangoldp_circle.models.Circle doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.",
"stderr_lines":[
"Traceback (most recent call last):",
" File \"/home/test6/startinblox/sibserver/manage.py\", line 25, in <module>",
" execute_from_command_line(sys.argv)",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line",
" utility.execute()",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/core/management/__init__.py\", line 357, in execute",
" django.setup()",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/__init__.py\", line 24, in setup",
" apps.populate(settings.INSTALLED_APPS)",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/apps/registry.py\", line 114, in populate",
" app_config.import_models()",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/apps/config.py\", line 211, in import_models",
" self.models_module = import_module(models_module_name)",
" File \"/usr/alwaysdata/python/3.6.10/lib/python3.6/importlib/__init__.py\", line 126, in import_module",
" return _bootstrap._gcd_import(name[level:], package, level)",
" File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import",
" File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load",
" File \"<frozen importlib._bootstrap>\", line 955, in _find_and_load_unlocked",
" File \"<frozen importlib._bootstrap>\", line 665, in _load_unlocked",
" File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module",
" File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/djangoldp_community/models.py\", line 16, in <module>",
" from djangoldp_circle.models import Circle",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/djangoldp_circle/models.py\", line 37, in <module>",
" class Circle(Model):",
" File \"/home/test6/startinblox/venv_20210921T141219/lib/python3.6/site-packages/django/db/models/base.py\", line 111, in __new__",
" \"INSTALLED_APPS.\" % (module, name)",
"RuntimeError: Model class djangoldp_circle.models.Circle doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS."
],
"stdout":"Configuration error: Command '['/home/test6/startinblox/venv_20210921T141219/bin/python', '/home/test6/startinblox/sibserver/manage.py', 'configure']' returned non-zero exit status 1.",
"stdout_lines":[
"Configuration error: Command '['/home/test6/startinblox/venv_20210921T141219/bin/python', '/home/test6/startinblox/sibserver/manage.py', 'configure']' returned non-zero exit status 1."
]
}
We should workaround that dependency between those models
When putting back those components into the yml configuration (anyway in my case projects were needed to test for lot of datas), I got another exception from the server configuration task which failed when running the create_subscription command because of the empty xmpp.domain
key in the configuration too:
{
"changed":true,
"cmd":[
"python",
"manage.py",
"create_subscriptions"
],
"delta":"0:00:01.575940",
"end":"2021-09-21 14:40:09.408036",
"msg":"non-zero return code",
"rc":1,
"start":"2021-09-21 14:40:07.832096",
"stderr":"Traceback (most recent call last):\n File \"manage.py\", line 25, in <module>\n execute_from_command_line(sys.argv)\n File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line\n utility.execute()\n File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/__init__.py\", line 375, in execute\n self.fetch_command(subcommand).run_from_argv(self.argv)\n File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/base.py\", line 323, in run_from_argv\n self.execute(*args, **cmd_options)\n File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/base.py\", line 364, in execute\n output = self.handle(*args, **options)\n File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/djangoldp_notification/management/commands/create_subscriptions.py\", line 13, in handle\n Subscription.objects.get_or_create(object=host+\"/circles/\", inbox=xmpp + \"/conference.\" + jabber_host + \"/happydev_muc_admin\", field=None)\nTypeError: must be str, not NoneType",
"stderr_lines":[
"Traceback (most recent call last):",
" File \"manage.py\", line 25, in <module>",
" execute_from_command_line(sys.argv)",
" File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line",
" utility.execute()",
" File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/__init__.py\", line 375, in execute",
" self.fetch_command(subcommand).run_from_argv(self.argv)",
" File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/base.py\", line 323, in run_from_argv",
" self.execute(*args, **cmd_options)",
" File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/django/core/management/base.py\", line 364, in execute",
" output = self.handle(*args, **options)",
" File \"/home/test6/startinblox/venv_20210921T143950/lib/python3.6/site-packages/djangoldp_notification/management/commands/create_subscriptions.py\", line 13, in handle",
" Subscription.objects.get_or_create(object=host+\"/circles/\", inbox=xmpp + \"/conference.\" + jabber_host + \"/happydev_muc_admin\", field=None)",
"TypeError: must be str, not NoneType"
],
"stdout":"",
"stdout_lines":[
]
}
This should be reworked too, to not execute that task if the given configuration key is not present
Then, after adding back a value on that one too, I got an error on the build of the front, related to the inexistence of the chat
component entry:
{
"changed":true,
"cmd":[
"npm",
"run",
"build"
],
"delta":"0:00:01.902007",
"end":"2021-09-21 15:29:40.088111",
"msg":"non-zero return code",
"rc":1,
"start":"2021-09-21 15:29:38.186104",
"stderr":"npm WARN lifecycle The node binary used for scripts is /usr/bin/node but npm is using /usr/alwaysdata/nodejs/14.17.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.\nNo component found for type chat\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! orbit@1.0.0 build: `cross-env NODE_ENV='production' node internal/parcel.js`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the orbit@1.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /home/test6/.npm/_logs/2021-09-21T13_29_40_082Z-debug.log",
"stderr_lines":[
"npm WARN lifecycle The node binary used for scripts is /usr/bin/node but npm is using /usr/alwaysdata/nodejs/14.17.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.",
"No component found for type chat",
"npm ERR! code ELIFECYCLE",
"npm ERR! errno 1",
"npm ERR! orbit@1.0.0 build: `cross-env NODE_ENV='production' node internal/parcel.js`",
"npm ERR! Exit status 1",
"npm ERR! ",
"npm ERR! Failed at the orbit@1.0.0 build script.",
"npm ERR! This is probably not a problem with npm. There is likely additional logging output above.",
"",
"npm ERR! A complete log of this run can be found in:",
"npm ERR! /home/test6/.npm/_logs/2021-09-21T13_29_40_082Z-debug.log"
],
"stdout":"\n> orbit@1.0.0 prebuild /home/test6/startinblox/client\n> rimraf build\n\n\n> orbit@1.0.0 build /home/test6/startinblox/client\n> cross-env NODE_ENV='production' node internal/parcel.js\n\nUsing config.json config file\nCreated manifest for Instance without chat\nCopied locales to dist folder\n🚨 /home/test6/startinblox/client/src/index.pug: Cannot read property 'route' of undefined\n at eval (eval at wrap (/home/test6/startinblox/client/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:459:60)\n at template (eval at wrap (/home/test6/startinblox/client/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:851:7)\n at PugAsset.generate (/home/test6/startinblox/client/node_modules/parcel-bundler/src/assets/PugAsset.js:36:12)\n at async PugAsset.process (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Asset.js:217:24)\n at async Pipeline.processAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Pipeline.js:46:7)\n at async Pipeline.process (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Pipeline.js:24:23)\n at async Object.run (/home/test6/startinblox/client/node_modules/parcel-bundler/src/worker.js:15:12)\n at async Bundler.loadAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Bundler.js:577:19)\n at async Bundler.processAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Bundler.js:557:5)\n at async PromiseQueue._runJob (/home/test6/startinblox/client/node_modules/parcel-bundler/src/utils/PromiseQueue.js:48:7)",
"stdout_lines":[
"",
"> orbit@1.0.0 prebuild /home/test6/startinblox/client",
"> rimraf build",
"",
"",
"> orbit@1.0.0 build /home/test6/startinblox/client",
"> cross-env NODE_ENV='production' node internal/parcel.js",
"",
"Using config.json config file",
"Created manifest for Instance without chat",
"Copied locales to dist folder",
"🚨 /home/test6/startinblox/client/src/index.pug: Cannot read property 'route' of undefined",
" at eval (eval at wrap (/home/test6/startinblox/client/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:459:60)",
" at template (eval at wrap (/home/test6/startinblox/client/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:851:7)",
" at PugAsset.generate (/home/test6/startinblox/client/node_modules/parcel-bundler/src/assets/PugAsset.js:36:12)",
" at async PugAsset.process (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Asset.js:217:24)",
" at async Pipeline.processAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Pipeline.js:46:7)",
" at async Pipeline.process (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Pipeline.js:24:23)",
" at async Object.run (/home/test6/startinblox/client/node_modules/parcel-bundler/src/worker.js:15:12)",
" at async Bundler.loadAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Bundler.js:577:19)",
" at async Bundler.processAsset (/home/test6/startinblox/client/node_modules/parcel-bundler/src/Bundler.js:557:5)",
" at async PromiseQueue._runJob (/home/test6/startinblox/client/node_modules/parcel-bundler/src/utils/PromiseQueue.js:48:7)"
]
}
The parcel build should not fail either if that key is not present, it should only ignore it
Because I had to add back all those keys I now have a working configuration of Hubl/Orbit including everything, so my initial requirements are not covered.
Ping @calummackervoy @jbpasquier @matthieu @plup for ideas/next steps.