[GH-ISSUE #323] Ways to improve WVC #209

Open
opened 2026-02-27 15:57:46 +03:00 by kerem · 80 comments
Owner

Originally created by @Real-Gecko on GitHub (Jun 15, 2020).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/323

Hey there! I think we need to discuss some things about development of WVC to avoid confusion with further development. Things to discuss are:

  • code formatting
  • test coverage
  • migrations squashing
  • installation script
  • views functionality split
  • django-guardian

Feel free to suggest some other things to discuss in terms of development.

Originally created by @Real-Gecko on GitHub (Jun 15, 2020). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/323 Hey there! I think we need to discuss some things about development of WVC to avoid confusion with further development. Things to discuss are: - [x] code formatting - [ ] test coverage - [ ] migrations squashing - [ ] installation script - [ ] views functionality split - [ ] django-guardian Feel free to suggest some other things to discuss in terms of development.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

I use VS Code for development and I use yapf with following settings:

    "python.formatting.yapfArgs": [
        "--style",
        "{based_on_style: pep8, column_limit: 127}"
    ],

I also use VS Code feature "Sort imports" for sorting imports of python libs. That's why you may see a lot of code shifting in my PRs without actual change in functionality. To avoid confusion I suggest we decide which formatter we use, to keep code same for all devs.

<!-- gh-comment-id:643944468 --> @Real-Gecko commented on GitHub (Jun 15, 2020): I use VS Code for development and I use yapf with following settings: ```json "python.formatting.yapfArgs": [ "--style", "{based_on_style: pep8, column_limit: 127}" ], ``` I also use VS Code feature "Sort imports" for sorting imports of python libs. That's why you may see a lot of code shifting in my PRs without actual change in functionality. To avoid confusion I suggest we decide which formatter we use, to keep code same for all devs.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

Test coverage the thing I'm currently working on, slowly but surely we're getting there.

<!-- gh-comment-id:643944703 --> @Real-Gecko commented on GitHub (Jun 15, 2020): Test coverage the thing I'm currently working on, slowly but surely we're getting there.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

I think we need to perform either migration squashing or redo migrations from scratch in the end of current dev cycle, when all changes will be settled, cause we're currently getting a lot of them.
We can also try and create a way to migrate from older version of WVC to newer, maybe with management command.

<!-- gh-comment-id:643946116 --> @Real-Gecko commented on GitHub (Jun 15, 2020): I think we need to perform either migration squashing or redo migrations from scratch in the end of current dev cycle, when all changes will be settled, cause we're currently getting a lot of them. We can also try and create a way to migrate from older version of WVC to newer, maybe with management command.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

We may create shell script for new installations and move all pre install tasks to there, like creation of admin user, maybe add ability to set some settings without actually editing settings.py etc.

<!-- gh-comment-id:643947094 --> @Real-Gecko commented on GitHub (Jun 15, 2020): We may create shell script for new installations and move all pre install tasks to there, like creation of `admin` user, maybe add ability to set some settings without actually editing `settings.py` etc.
Author
Owner

@catborise commented on GitHub (Jun 15, 2020):

hi @Real-Gecko i am a system engineer more than software developer. I never worked with a developer team, because of that i am not experienced with team working. but i prefer/tend to experience it. i can follow your guidance.

<!-- gh-comment-id:643960063 --> @catborise commented on GitHub (Jun 15, 2020): hi @Real-Gecko i am a system engineer more than software developer. I never worked with a developer team, because of that i am not experienced with team working. but i prefer/tend to experience it. i can follow your guidance.
Author
Owner

@catborise commented on GitHub (Jun 15, 2020):

migration squashing with after some period will be fine.(i did it with python2-->3 conversion.)

i moved setttings to appsettings page. for now settings.py is slimmed down.

i move them to appsettings but i think your admin app will be more suitable for that configs. it can be moved... (i am creating settings with setting.objects.using(db_alias).bulk_create migration but there should be more suitable way. i need help with that :) )

<!-- gh-comment-id:643962965 --> @catborise commented on GitHub (Jun 15, 2020): migration squashing with after some period will be fine.(i did it with python2-->3 conversion.) i moved setttings to appsettings page. for now settings.py is slimmed down. i move them to appsettings but i think your admin app will be more suitable for that configs. it can be moved... (i am creating settings with setting.objects.using(db_alias).bulk_create migration but there should be more suitable way. i need help with that :) )
Author
Owner

@catborise commented on GitHub (Jun 15, 2020):

We may create shell script for new installations and move all pre install tasks to there, like creation of admin user, maybe add ability to set some settings without actually editing settings.py etc.

after the lastest updates this approach(moving all pre install tasks) may be more suitable way.

i have never write coverage tests, i do not now how to... i should work on it.. i need time.

<!-- gh-comment-id:643965198 --> @catborise commented on GitHub (Jun 15, 2020): > We may create shell script for new installations and move all pre install tasks to there, like creation of `admin` user, maybe add ability to set some settings without actually editing `settings.py` etc. after the lastest updates this approach(moving all pre install tasks) may be more suitable way. i have never write coverage tests, i do not now how to... i should work on it.. i need time.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

i am a system engineer more than software developer

What IDE do you use? Does it integrate with YAPF if so than everything is easy. I created conf/requirements-dev.txt, it adds yapf, coverage and django-debug-toolbar to existing requirements.

YAPF is used by me to auto format source files on save, really helps to keep code readable. However other devs may prefer other ways to format code, that's why I decided to discuss the issue. Settings for yapf I use ar in post 2. Try it out.

Coverage is used to run tests with coverage info, really helps to see what parts of your code are not tested. I use following command to run tests:

venv/bin/coverage run --source '.' --omit 'venv/*' manage.py test

And this one to see the results:

venv/bin/coverage html && firefox ${workspaceFolder}/htmlcov/index.html

You can use any browser you want instead of FF.

And finally Debug Toolbar really helps too. Installation and set up is pretty easy too.

<!-- gh-comment-id:643970909 --> @Real-Gecko commented on GitHub (Jun 15, 2020): > i am a system engineer more than software developer What IDE do you use? Does it integrate with [YAPF](https://github.com/google/yapf) if so than everything is easy. I created `conf/requirements-dev.txt`, it adds `yapf`, `coverage` and `django-debug-toolbar` to existing requirements. YAPF is used by me to auto format source files on save, really helps to keep code readable. However other devs may prefer other ways to format code, that's why I decided to discuss the issue. Settings for yapf I use ar in post 2. Try it out. Coverage is used to run tests with coverage info, really helps to see what parts of your code are not tested. I use following command to run tests: ```shell venv/bin/coverage run --source '.' --omit 'venv/*' manage.py test ``` And this one to see the results: ```shell venv/bin/coverage html && firefox ${workspaceFolder}/htmlcov/index.html ``` You can use any browser you want instead of FF. And finally [Debug Toolbar](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html) really helps too. Installation and set up is pretty easy too.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

i moved setttings to appsettings page. for now settings.py is slimmed down.

Yeah, that's cool, ability to change settings on the fly is always better than messing with settings.py.

i move them to appsettings but i think your admin app will be more suitable for that configs. it can be moved...

Well that's not hard to do: one view, one model, one template. Let's do this

i am creating settings with setting.objects.using(db_alias).bulk_create migration but there should be more suitable way. i need help with that :)

Populating data with migrations is acceptable, but Django devs recommend using fixtures, imo it's more flexible way, it will require some work during testing, but that's not something I would worry about.

<!-- gh-comment-id:643974387 --> @Real-Gecko commented on GitHub (Jun 15, 2020): > i moved setttings to appsettings page. for now settings.py is slimmed down. Yeah, that's cool, ability to change settings on the fly is always better than messing with settings.py. > i move them to appsettings but i think your admin app will be more suitable for that configs. it can be moved... Well that's not hard to do: one view, one model, one template. Let's do this > i am creating settings with setting.objects.using(db_alias).bulk_create migration but there should be more suitable way. i need help with that :) Populating data with migrations is acceptable, but Django devs recommend [using fixtures](https://docs.djangoproject.com/en/2.2/howto/initial-data/), imo it's more flexible way, it will require some work during testing, but that's not something I would worry about.
Author
Owner

@Real-Gecko commented on GitHub (Jun 15, 2020):

i have never write coverage tests, i do not now how to... i should work on it.. i need time.

It sounds harder than it actually is. If you read tests I created you'll see they're pretty simple, but help a lot. Here's computes index page test:

    def test_index(self):
        response = self.client.get(reverse('computes'))
        self.assertEqual(response.status_code, 200)

Simply GET index page and check that response status is 200.

<!-- gh-comment-id:643976921 --> @Real-Gecko commented on GitHub (Jun 15, 2020): > i have never write coverage tests, i do not now how to... i should work on it.. i need time. It sounds harder [than it actually is](https://docs.djangoproject.com/en/2.2/topics/testing/overview/). If you read tests I created you'll see they're pretty simple, but help a lot. Here's computes index page test: ```python def test_index(self): response = self.client.get(reverse('computes')) self.assertEqual(response.status_code, 200) ``` Simply `GET` index page and check that response status is 200.
Author
Owner

@catborise commented on GitHub (Jun 15, 2020):

before that i was using pycharm, it is really nice ide for python(license is over and community edition lack of some capabilities).
Now i started using vscode. i can add yapf settings for sync.

<!-- gh-comment-id:644017186 --> @catborise commented on GitHub (Jun 15, 2020): before that i was using pycharm, it is really nice ide for python(license is over and community edition lack of some capabilities). Now i started using vscode. i can add yapf settings for sync.
Author
Owner

@Real-Gecko commented on GitHub (Jun 16, 2020):

I see a lot of views doing more than one task which makes them hard to maintain and test. I think we need to split views functionality like so: one view - one task. For example list users is one view, create user is another, update is another etc.

<!-- gh-comment-id:644519510 --> @Real-Gecko commented on GitHub (Jun 16, 2020): I see a lot of views doing more than one task which makes them hard to maintain and test. I think we need to split views functionality like so: one view - one task. For example list users is one view, create user is another, update is another etc.
Author
Owner

@catborise commented on GitHub (Jun 16, 2020):

i do not know why retspen choose that approach but it is useful to slim down urls.
for me, it is fine to seperate small ones but instances/views.py can be painful to split :)

<!-- gh-comment-id:644538507 --> @catborise commented on GitHub (Jun 16, 2020): i do not know why retspen choose that approach but it is useful to slim down urls. for me, it is fine to seperate small ones but instances/views.py can be painful to split :)
Author
Owner

@Real-Gecko commented on GitHub (Jun 16, 2020):

urls.py is just like route map user request can take to receive required answer, so it's ok for it to be big, but big views that do more than one job is bad imo.

I'm currently working on computes where I've already split some functionality to smaller views. Instances are on the way.

<!-- gh-comment-id:644540274 --> @Real-Gecko commented on GitHub (Jun 16, 2020): `urls.py` is just like route map user request can take to receive required answer, so it's ok for it to be big, but big views that do more than one job is bad imo. I'm currently working on computes where I've already split some functionality to smaller views. Instances are on the way.
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

Correct me if I'm wrong: we establish new connection to libvirt host every time there's any operation on instance. Am I right?

<!-- gh-comment-id:645763674 --> @Real-Gecko commented on GitHub (Jun 18, 2020): Correct me if I'm wrong: we establish new connection to libvirt host every time there's any operation on instance. Am I right?
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

Never mind, look like I've figured it out.

<!-- gh-comment-id:645776138 --> @Real-Gecko commented on GitHub (Jun 18, 2020): Never mind, look like I've figured it out.
Author
Owner

@catborise commented on GitHub (Jun 18, 2020):

i think yes it starts new connection everytime but with the help of keep alive protocol, connections are cached. libvirt service on the host keep up open the connection to serve requests fastly...

<!-- gh-comment-id:645777022 --> @catborise commented on GitHub (Jun 18, 2020): i think yes it starts new connection everytime but with the help of keep alive protocol, connections are cached. libvirt service on the host keep up open the connection to serve requests fastly...
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

Yep, there's wvmConnectionManager class that pools all connections. I was just confused by wvmInstance close method.

<!-- gh-comment-id:645777845 --> @Real-Gecko commented on GitHub (Jun 18, 2020): Yep, there's wvmConnectionManager class that pools all connections. I was just confused by wvmInstance close method.
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

I'm currently working on instances app, some serious optimizations in progress. Please avoid any work in this app, to prevent source code clashing during PR.

<!-- gh-comment-id:645892736 --> @Real-Gecko commented on GitHub (Jun 18, 2020): I'm currently working on instances app, some serious optimizations in progress. Please avoid any work in this app, to prevent source code clashing during PR.
Author
Owner

@catborise commented on GitHub (Jun 18, 2020):

👍
currently i am not working on webvirtcloud master..
be careful instances app is a behemoth. :)

<!-- gh-comment-id:645895732 --> @catborise commented on GitHub (Jun 18, 2020): 👍 currently i am not working on webvirtcloud master.. be careful instances app is a behemoth. :)
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

Yep, but it's worth it, unoptimized compute instances view: more than 5 seconds to response, 41 database requests.
Screenshot_20200618_153108

Optimized: 1.5 seconds, 2 database queries.
Screenshot_20200618_153143

<!-- gh-comment-id:645903695 --> @Real-Gecko commented on GitHub (Jun 18, 2020): Yep, but it's worth it, unoptimized compute instances view: more than 5 seconds to response, 41 database requests. ![Screenshot_20200618_153108](https://user-images.githubusercontent.com/2231969/85004399-539a4600-b179-11ea-9baa-abc43e6a8390.png) Optimized: 1.5 seconds, 2 database queries. ![Screenshot_20200618_153143](https://user-images.githubusercontent.com/2231969/85004459-657be900-b179-11ea-9aac-c5beea61c720.png)
Author
Owner

@catborise commented on GitHub (Jun 18, 2020):

wow 41 queries... it should be max five or six queries. 1. get compute 2.get instances, 3.update records, 4.check duplicates, 5.add missings, something must be out of control.

i found it: def refresh_instance_database(comp, inst_name, info) loops for all instances and updates all of them. that causes making queries relative to instance count.
i am wondering how to solve that.

<!-- gh-comment-id:645936256 --> @catborise commented on GitHub (Jun 18, 2020): wow 41 queries... it should be max five or six queries. 1. get compute 2.get instances, 3.update records, 4.check duplicates, 5.add missings, something must be out of control. i found it: def refresh_instance_database(comp, inst_name, info) loops for all instances and updates all of them. that causes making queries relative to instance count. i am wondering how to solve that.
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

Currently I replaced it with this code:

def refr(compute):
    domains = compute.proxy.wvm.listAllDomains()
    domain_names = [d.name() for d in domains]
    # Delete instances that're not on host
    Instance.objects.filter(compute=compute).exclude(name__in=domain_names).delete()
    # Create instances that're not in DB
    names = Instance.objects.filter(compute=compute).values_list('name', flat=True)
    for domain in domains:
        if domain.name() not in names:
            Instance(compute=compute, name=domain.name(), uuid=domain.UUIDString()).save()

But I don't like it too, cause it does not connect instances from WVM with domains on host.
If we try to connect 'em will get query hell again. So currently I think about workaround.

One solution is to get Instance objects from DB and work with it, but that way we don't get VM status on host.

<!-- gh-comment-id:645952604 --> @Real-Gecko commented on GitHub (Jun 18, 2020): Currently I replaced it with this code: ```python def refr(compute): domains = compute.proxy.wvm.listAllDomains() domain_names = [d.name() for d in domains] # Delete instances that're not on host Instance.objects.filter(compute=compute).exclude(name__in=domain_names).delete() # Create instances that're not in DB names = Instance.objects.filter(compute=compute).values_list('name', flat=True) for domain in domains: if domain.name() not in names: Instance(compute=compute, name=domain.name(), uuid=domain.UUIDString()).save() ``` But I don't like it too, cause it does not connect instances from WVM with domains on host. If we try to connect 'em will get query hell again. So currently I think about workaround. One solution is to get Instance objects from DB and work with it, but that way we don't get VM status on host.
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

OK, I think I know what to do with VM status. I added wvmInstance to Instance model that we can use to get info about domain directly via libvirt:

    @cached_property
    def proxy(self):
        return wvmInstance(
            self.compute.hostname,
            self.compute.login,
            self.compute.password,
            self.compute.type,
            self.name,
        )

Result is looking good:

>>> i = Instance.objects.get(name='test')
>>> i.proxy.instance.info()
[5, 4194304, 4194304, 2, 0]
>>> 
<!-- gh-comment-id:645958694 --> @Real-Gecko commented on GitHub (Jun 18, 2020): OK, I think I know what to do with VM status. I added `wvmInstance` to `Instance` model that we can use to get info about domain directly via libvirt: ```python @cached_property def proxy(self): return wvmInstance( self.compute.hostname, self.compute.login, self.compute.password, self.compute.type, self.name, ) ``` Result is looking good: ```python >>> i = Instance.objects.get(name='test') >>> i.proxy.instance.info() [5, 4194304, 4194304, 2, 0] >>> ```
Author
Owner

@catborise commented on GitHub (Jun 18, 2020):

i think you will seperate allinstances and host only intances list refreshing.

there is not need to check duplicate uuid and names on one host. but we should handle that among other hosts.
duplicate instance definition on other hosts could cause unwanted problems.

proxy with @cached_property is a nice approach. i like it.

<!-- gh-comment-id:645962538 --> @catborise commented on GitHub (Jun 18, 2020): i think you will seperate allinstances and host only intances list refreshing. there is not need to check duplicate uuid and names on one host. but we should handle that among other hosts. duplicate instance definition on other hosts could cause unwanted problems. proxy with @cached_property is a nice approach. i like it.
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

duplicate instance definition on other hosts could cause unwanted problems.

Actually I think no, even if there will two VMs with same UUID, but on different hosts it will not cause trouble. Cause this VMs are well on different hosts :D

But current code definitely troublesome:

    instances = Instance.objects.filter(name=inst_name)
    if instances.count() > 1:
        for i in instances:
            user_instances_count = UserInstance.objects.filter(instance=i).count()
            if user_instances_count == 0:
                addlogmsg(request.user.username, i.name, _("Deleting due to multiple(Instance Name) records."))
                i.delete()

As it does not take into account the fact that there could be instances with the same name on different computes.

<!-- gh-comment-id:645964885 --> @Real-Gecko commented on GitHub (Jun 18, 2020): > duplicate instance definition on other hosts could cause unwanted problems. Actually I think no, even if there will two VMs with same UUID, but on different hosts it will not cause trouble. Cause this VMs are well on different hosts :D But current code definitely troublesome: ```python instances = Instance.objects.filter(name=inst_name) if instances.count() > 1: for i in instances: user_instances_count = UserInstance.objects.filter(instance=i).count() if user_instances_count == 0: addlogmsg(request.user.username, i.name, _("Deleting due to multiple(Instance Name) records.")) i.delete() ``` As it does not take into account the fact that there could be instances with the same name on different computes.
Author
Owner

@catborise commented on GitHub (Jun 18, 2020):

yes same name could cause confusion but doesn't same uuid cause migration prevention?

you are right unique name and uuid can be provided efficiently only within a cluster. these actions not a complete solution but only trivial checking

<!-- gh-comment-id:645973165 --> @catborise commented on GitHub (Jun 18, 2020): yes same name could cause confusion but doesn't same uuid cause migration prevention? you are right unique name and uuid can be provided efficiently only within a cluster. these actions not a complete solution but only trivial checking
Author
Owner

@Real-Gecko commented on GitHub (Jun 18, 2020):

yes same name could cause confusion but doesn't same uuid cause migration prevention?

Yep it's possible even though possibility of UUID clashing is really low, however I think in this case libvirt will throw some kind of error we will show to user, and then that's admin's task to deal with this tricky situation. In our case it's important to keep our DB in sync with hosts.

<!-- gh-comment-id:645977394 --> @Real-Gecko commented on GitHub (Jun 18, 2020): > yes same name could cause confusion but doesn't same uuid cause migration prevention? Yep it's possible even though possibility of UUID clashing is really low, however I think in this case libvirt will throw some kind of error we will show to user, and then that's admin's task to deal with this tricky situation. In our case it's important to keep our DB in sync with hosts.
Author
Owner

@Real-Gecko commented on GitHub (Jun 19, 2020):

I've pushed my WIP Instances branch into forked repo for testing and fun. Anyone willing to test and suggest is free to do so.
WARNING: heavy WIP, not for production use.

<!-- gh-comment-id:646618827 --> @Real-Gecko commented on GitHub (Jun 19, 2020): I've pushed my [WIP Instances branch](https://github.com/Real-Gecko/webvirtcloud/tree/instances) into forked repo for testing and fun. Anyone willing to test and suggest is free to do so. WARNING: heavy WIP, not for production use.
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

I base.html to contain this:

    {% include 'navbar.html' %}

    <div role="main" class="container">
      <div class"row">
        <div class="col-sm-12">
          <div class="float-right">
            {% block page_header_extra %}
            {% endblock page_header_extra %}
          </div>
          <h3 class="page-header">
            {% block page_header %}
            {% endblock page_header %}
          </h3>
        </div>
      </div>
      {% bootstrap_messages %}
      {% block content %}{% endblock %}
    </div>

So there will be no need to write page header in every template, things like search bar can go to page_header_extra and all messages added by django.contrib.messages framework will go below page header.

{% block page_header %}{% trans "Instances" %}{% endblock page_header %}

{% block page_header_extra %}
{% if request.user.is_superuser %}
    {% include 'create_inst_block.html' %}
{% endif %}
{% if all_host_vms or all_user_vms %}
    <input id="filter" class="form-control" type="text" placeholder="{% trans 'Search' %}">
{% endif %}
{% endblock page_header_extra %}

{% block content %}
...
<!-- gh-comment-id:647279649 --> @Real-Gecko commented on GitHub (Jun 22, 2020): I `base.html` to contain this: ```html {% include 'navbar.html' %} <div role="main" class="container"> <div class"row"> <div class="col-sm-12"> <div class="float-right"> {% block page_header_extra %} {% endblock page_header_extra %} </div> <h3 class="page-header"> {% block page_header %} {% endblock page_header %} </h3> </div> </div> {% bootstrap_messages %} {% block content %}{% endblock %} </div> ``` So there will be no need to write page header in every template, things like search bar can go to `page_header_extra` and all messages added by `django.contrib.messages` framework will go below page header. ```html {% block page_header %}{% trans "Instances" %}{% endblock page_header %} {% block page_header_extra %} {% if request.user.is_superuser %} {% include 'create_inst_block.html' %} {% endif %} {% if all_host_vms or all_user_vms %} <input id="filter" class="form-control" type="text" placeholder="{% trans 'Search' %}"> {% endif %} {% endblock page_header_extra %} {% block content %} ... ```
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

although effort or code length does not much change, if alignment problems does not occur, this way is more elegant than current. i like it

<!-- gh-comment-id:647287467 --> @catborise commented on GitHub (Jun 22, 2020): although effort or code length does not much change, if alignment problems does not occur, this way is more elegant than current. i like it
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

although effort or code length does not much change, if alignment problems does not occur, this way is more elegant than current. i like it

This is just an example how things can be optimized, not a final version, anyone willing to suggest improvements is free to do so.

<!-- gh-comment-id:647288045 --> @Real-Gecko commented on GitHub (Jun 22, 2020): > although effort or code length does not much change, if alignment problems does not occur, this way is more elegant than current. i like it This is just an example how things can be optimized, not a final version, anyone willing to suggest improvements is free to do so.
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

as far as i see grouped view for index page is removed, practically.
group view:
image
nongrouped view:
image

all_host_vms = Instance.objects.all().prefetch_related('userinstance_set') does not contain host info, doesn't it?
what do you think about that?

<!-- gh-comment-id:647302047 --> @catborise commented on GitHub (Jun 22, 2020): as far as i see grouped view for index page is removed, practically. group view: ![image](https://user-images.githubusercontent.com/1725643/85253413-c7349f80-b466-11ea-8337-f3ebe5ff0d97.png) nongrouped view: ![image](https://user-images.githubusercontent.com/1725643/85253491-f3e8b700-b466-11ea-9172-a861be526a76.png) ` all_host_vms = Instance.objects.all().prefetch_related('userinstance_set')` does not contain host info, doesn't it? what do you think about that?
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

I think replacing it with either accordion or tabs which will contain tables with instances. Current implementation does not work right anyway, try sorting the table by name or RAM you'll see what I mean.

<!-- gh-comment-id:647309046 --> @Real-Gecko commented on GitHub (Jun 22, 2020): I think replacing it with either [accordion](https://getbootstrap.com/docs/4.5/components/collapse/#accordion-example) or tabs which will contain tables with instances. Current implementation does not work right anyway, try sorting the table by name or RAM you'll see what I mean.
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

Accordion does not look bad IMO

Screenshot_20200622_124223

<!-- gh-comment-id:647320640 --> @Real-Gecko commented on GitHub (Jun 22, 2020): Accordion does not look bad IMO ![Screenshot_20200622_124223](https://user-images.githubusercontent.com/2231969/85256545-3c639d00-b486-11ea-9d80-7d7495084c2c.png)
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

i added grouped view because there is not any info about host usage. especially ram usage. This info very valuable to get idea host load. other than that already nongrouped view is like that.

<!-- gh-comment-id:647331281 --> @catborise commented on GitHub (Jun 22, 2020): i added grouped view because there is not any info about host usage. especially ram usage. This info very valuable to get idea host load. other than that already nongrouped view is like that.
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

I'll commit soon to instances branch, you'll see how it looks

<!-- gh-comment-id:647331919 --> @Real-Gecko commented on GitHub (Jun 22, 2020): I'll commit soon to instances branch, you'll see how it looks
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

I've pushed changes de20f810a27ab528aff6699a33ab7fbb607be4bf, not the best looking for right now, but you get the idea, most important is the optimization of templates and DB queries.

<!-- gh-comment-id:647359695 --> @Real-Gecko commented on GitHub (Jun 22, 2020): I've pushed changes de20f810a27ab528aff6699a33ab7fbb607be4bf, not the best looking for right now, but you get the idea, most important is the optimization of templates and DB queries.
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

i think, database queries not criitical. query delay impact is very low compare to libvirt calls. focusing on queries would not affect very much.

<!-- gh-comment-id:647404174 --> @catborise commented on GitHub (Jun 22, 2020): i think, database queries not criitical. query delay impact is very low compare to libvirt calls. focusing on queries would not affect very much.
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

Actually, as far as I can tell from testing rewritten views DB queries impact is huge :)

<!-- gh-comment-id:647405069 --> @Real-Gecko commented on GitHub (Jun 22, 2020): Actually, as far as I can tell from testing rewritten views DB queries impact is huge :)
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

i cannot run your branch. gives error
always i get that error

image

<!-- gh-comment-id:647407464 --> @catborise commented on GitHub (Jun 22, 2020): i cannot run your branch. gives error always i get that error ![image](https://user-images.githubusercontent.com/1725643/85273228-fdcde280-b485-11ea-9740-516a007d33f0.png)
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

Is it the same error as in 2c8f092992bf657977c268e806a300cee3e30fce? If so, try commenting out 'webvirtcloud.middleware.ExceptionMiddleware', in your settings.py and see where error is.

<!-- gh-comment-id:647408817 --> @Real-Gecko commented on GitHub (Jun 22, 2020): Is it the same error as in 2c8f092992bf657977c268e806a300cee3e30fce? If so, try commenting out `'webvirtcloud.middleware.ExceptionMiddleware',` in your `settings.py` and see where error is.
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

not reachable host caueses, i think. trying to get cpu from host info causes that.
image

other problem in instances.html:
{% widthratio vm.proxy.instance.info.1 1024 1 %} MiB</td>(Exception has occurred: VariableDoesNotExist
Failed lookup for key [vm] in) i think this should be instance

and other in in instance_actions.html

<form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %}
    <input type="hidden" name="name" value="{{ inst }}" />

(Exception has occurred: VariableDoesNotExist
Failed lookup for key [inst] in)

<!-- gh-comment-id:647434081 --> @catborise commented on GitHub (Jun 22, 2020): not reachable host caueses, i think. trying to get cpu from host info causes that. ![image](https://user-images.githubusercontent.com/1725643/85278141-3329fe80-b48d-11ea-9e67-013f302d8d12.png) other problem in instances.html: `{% widthratio vm.proxy.instance.info.1 1024 1 %} MiB</td>`(Exception has occurred: VariableDoesNotExist Failed lookup for key [vm] in) i think this should be instance and other in in instance_actions.html ``` <form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %} <input type="hidden" name="name" value="{{ inst }}" /> ``` (Exception has occurred: VariableDoesNotExist Failed lookup for key [inst] in)
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

not reachable host caueses, i think. trying to get cpu from host info causes that.

Hmm, I cannot reproduce, can you remove problematic compute and retry.

<!-- gh-comment-id:647492158 --> @Real-Gecko commented on GitHub (Jun 22, 2020): > not reachable host caueses, i think. trying to get cpu from host info causes that. Hmm, I cannot reproduce, can you remove problematic compute and retry.
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

other problem in instances.html:
{% widthratio vm.proxy.instance.info.1 1024 1 %} MiB</td>(Exception has occurred: VariableDoesNotExist
Failed lookup for key [vm] in) i think this should be instance

and other in in instance_actions.html

Fixed those.

<!-- gh-comment-id:647497882 --> @Real-Gecko commented on GitHub (Jun 22, 2020): > other problem in instances.html: > `{% widthratio vm.proxy.instance.info.1 1024 1 %} MiB</td>`(Exception has occurred: VariableDoesNotExist > Failed lookup for key [vm] in) i think this should be instance > > and other in in instance_actions.html Fixed those.
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

add a compute with fake name ip pass user. it accepts

<!-- gh-comment-id:647503148 --> @catborise commented on GitHub (Jun 22, 2020): add a compute with fake name ip pass user. it accepts
Author
Owner

@Real-Gecko commented on GitHub (Jun 22, 2020):

I tried, I do not get the error you describe, but instead I get another one :D

<!-- gh-comment-id:647503943 --> @Real-Gecko commented on GitHub (Jun 22, 2020): I tried, I do not get the error you describe, but instead I get another one :D
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

after instance_action.html fix, click show console.: negative token generation :)
image

<!-- gh-comment-id:647507131 --> @catborise commented on GitHub (Jun 22, 2020): after instance_action.html fix, click show console.: negative token generation :) ![image](https://user-images.githubusercontent.com/1725643/85290802-3ed3f000-b4a2-11ea-9abb-988f24821c7e.png)
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

forceoff power off powercycle does not work...

<!-- gh-comment-id:647509089 --> @catborise commented on GitHub (Jun 22, 2020): forceoff power off powercycle does not work...
Author
Owner

@catborise commented on GitHub (Jun 22, 2020):

you are a good backender :)
image
i am crying :)

wouldnt be nice implementation like this, if we could...
7AE25FCC-DCEF-49BC-9A4E-4B849F391238

<!-- gh-comment-id:647519299 --> @catborise commented on GitHub (Jun 22, 2020): you are a good backender :) ![image](https://user-images.githubusercontent.com/1725643/85292900-434dd800-b4a5-11ea-9c57-e9789dc7d4f1.png) i am crying :) wouldnt be nice implementation like this, if we could... ![7AE25FCC-DCEF-49BC-9A4E-4B849F391238](https://user-images.githubusercontent.com/1725643/85322917-c4ba6000-b4cf-11ea-8185-f964136d3641.jpeg)
Author
Owner

@Real-Gecko commented on GitHub (Jun 23, 2020):

wouldnt be nice implementation like this, if we could...

Of course it's better, but how does act during sorting and filtering? Can you try and implement it?

<!-- gh-comment-id:647882045 --> @Real-Gecko commented on GitHub (Jun 23, 2020): > wouldnt be nice implementation like this, if we could... Of course it's better, but how does act during sorting and filtering? Can you try and implement it?
Author
Owner

@Real-Gecko commented on GitHub (Jun 23, 2020):

I made grouped instances index look like before 2be76c07e401d4a2875af35403ca55d550972460, but it definitely needs a rework.
Screenshot_20200623_105735

<!-- gh-comment-id:647908977 --> @Real-Gecko commented on GitHub (Jun 23, 2020): I made grouped instances index look like before 2be76c07e401d4a2875af35403ca55d550972460, but it definitely needs a rework. ![Screenshot_20200623_105735](https://user-images.githubusercontent.com/2231969/85362722-00d9d900-b541-11ea-9f52-af1a2c3145c5.png)
Author
Owner

@catborise commented on GitHub (Jun 24, 2020):

did you make any changes with console app?
i am going to work on some bugs and featues,

<!-- gh-comment-id:648589863 --> @catborise commented on GitHub (Jun 24, 2020): did you make any changes with console app? i am going to work on some bugs and featues,
Author
Owner

@Real-Gecko commented on GitHub (Jun 24, 2020):

Nope.

<!-- gh-comment-id:648612302 --> @Real-Gecko commented on GitHub (Jun 24, 2020): Nope.
Author
Owner

@Real-Gecko commented on GitHub (Jun 24, 2020):

i cannot run your branch. gives error
always i get that error

Try latest commit c2e001290587344c62025e5c08689b134797935c and see if error still exists.

<!-- gh-comment-id:648720736 --> @Real-Gecko commented on GitHub (Jun 24, 2020): > i cannot run your branch. gives error > always i get that error Try latest commit c2e001290587344c62025e5c08689b134797935c and see if error still exists.
Author
Owner

@catborise commented on GitHub (Jun 24, 2020):

still some errors happens not working yet because of some other errors:
image

<!-- gh-comment-id:648741560 --> @catborise commented on GitHub (Jun 24, 2020): still some errors happens not working yet because of some other errors: ![image](https://user-images.githubusercontent.com/1725643/85540522-c5620c00-b61f-11ea-8c16-1a7f25cf7bd4.png)
Author
Owner

@Real-Gecko commented on GitHub (Jun 24, 2020):

Ah yes, storages/views.py, will commit that.

<!-- gh-comment-id:648779874 --> @Real-Gecko commented on GitHub (Jun 24, 2020): Ah yes, `storages/views.py`, will commit that.
Author
Owner

@Real-Gecko commented on GitHub (Jun 24, 2020):

b8db11f66f1dcc997c741854cdd2b9488bac9551 grab this one.
I finally started to add instances tests and with only three of them increased overall coverage from 36 to 41 percent which is goooood :D

<!-- gh-comment-id:648781724 --> @Real-Gecko commented on GitHub (Jun 24, 2020): b8db11f66f1dcc997c741854cdd2b9488bac9551 grab this one. I finally started to add instances tests and with only three of them increased overall coverage from 36 to 41 percent which is goooood :D
Author
Owner

@catborise commented on GitHub (Jun 24, 2020):

yea it runs
but view not good. it should not show in the table

image

<!-- gh-comment-id:648787140 --> @catborise commented on GitHub (Jun 24, 2020): yea it runs but view not good. it should not show in the table ![image](https://user-images.githubusercontent.com/1725643/85555276-6d7ed180-b62e-11ea-8b0a-1013ccc9fe76.png)
Author
Owner

@catborise commented on GitHub (Jun 25, 2020):

I made grouped instances index look like before 2be76c0, but it definitely needs a rework.
Screenshot_20200623_105735

we could use this datatable which has ability to group. sorting finding etc superrior than us. have you use it?
https://www.datatables.net/extensions/rowgroup/examples/initialisation/startAndEndRender.html

<!-- gh-comment-id:649222905 --> @catborise commented on GitHub (Jun 25, 2020): > I made grouped instances index look like before [2be76c0](https://github.com/retspen/webvirtcloud/commit/2be76c07e401d4a2875af35403ca55d550972460), but it definitely needs a rework. > ![Screenshot_20200623_105735](https://user-images.githubusercontent.com/2231969/85362722-00d9d900-b541-11ea-9f52-af1a2c3145c5.png) we could use this datatable which has ability to group. sorting finding etc superrior than us. have you use it? https://www.datatables.net/extensions/rowgroup/examples/initialisation/startAndEndRender.html
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

https://github.com/wenzhixin/bootstrap-table is better IMO
There's also https://django-tables2.readthedocs.io/en/latest/ which makes templates even simpler.

<!-- gh-comment-id:649223971 --> @Real-Gecko commented on GitHub (Jun 25, 2020): https://github.com/wenzhixin/bootstrap-table is better IMO There's also https://django-tables2.readthedocs.io/en/latest/ which makes templates even simpler.
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

but view not good. it should not show in the table

71d75327f21fbef126a57a378b36a5ef5584a76a
I made templates look like they did before

<!-- gh-comment-id:649226184 --> @Real-Gecko commented on GitHub (Jun 25, 2020): > but view not good. it should not show in the table 71d75327f21fbef126a57a378b36a5ef5584a76a I made templates look like they did before
Author
Owner

@catborise commented on GitHub (Jun 25, 2020):

we need "group view" or "detail view" or "tree view" like solution
https://examples.bootstrap-table.com/#extensions/treegrid.html is a suibtable one.

i do not see detail view or like that at django-tables2 .

<!-- gh-comment-id:649242136 --> @catborise commented on GitHub (Jun 25, 2020): we need "group view" or "detail view" or "tree view" like solution https://examples.bootstrap-table.com/#extensions/treegrid.html is a suibtable one. i do not see detail view or like that at django-tables2 .
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

i do not see detail view or like that at django-tables2

We can override built in templates https://django-tables2.readthedocs.io/en/latest/pages/custom-rendering.html#custom-template
We can even try and mix bs-table with django-tables2, first working on client side second on server side.
I think we need to think through new layout of every view, cause now it's a bit chaotic.
Currently design like this is quite popular:
Screenshot_20200625_122711
Most links are on left side menu, which is collapsible, top bar is small and does not have a lot of links. I see such layout quite often in enterprise grade products.

<!-- gh-comment-id:649257339 --> @Real-Gecko commented on GitHub (Jun 25, 2020): > i do not see detail view or like that at django-tables2 We can override built in templates https://django-tables2.readthedocs.io/en/latest/pages/custom-rendering.html#custom-template We can even try and mix bs-table with django-tables2, first working on client side second on server side. I think we need to think through new layout of every view, cause now it's a bit chaotic. Currently design like this is quite popular: ![Screenshot_20200625_122711](https://user-images.githubusercontent.com/2231969/85667284-3d433b80-b6df-11ea-983b-602281b15f83.png) Most links are on left side menu, which is collapsible, top bar is small and does not have a lot of links. I see such layout quite often in enterprise grade products.
Author
Owner

@catborise commented on GitHub (Jun 25, 2020):

yea i like the dashboards like this. webvirtmgr has left side . webvirtcloud uses top navigation.
retspen wanted to start new project webvirtcloud v2(django rest framework + react + material ui) but for some reasons, he choose to wait... with v2 he also switched to the dasboard style view...
nearly all dashboard templates like you specified as above...
image
...
material-ui
image

i want to add a dasboard page to webvirtcloud but there was some hiccups before your reorg. may be it is more appropriate and easy adding a dashboard now before then...

<!-- gh-comment-id:649331898 --> @catborise commented on GitHub (Jun 25, 2020): yea i like the dashboards like this. webvirtmgr has left side . webvirtcloud uses top navigation. retspen wanted to start new project webvirtcloud v2(django rest framework + react + material ui) but for some reasons, he choose to wait... with v2 he also switched to the dasboard style view... nearly all dashboard templates like you specified as above... ![image](https://user-images.githubusercontent.com/1725643/85678692-6361df00-b6d1-11ea-8639-18c98ad1e570.png) ... material-ui ![image](https://user-images.githubusercontent.com/1725643/85678894-94421400-b6d1-11ea-8ae1-089fa2deeb48.png) i want to add a dasboard page to webvirtcloud but there was some hiccups before your reorg. may be it is more appropriate and easy adding a dashboard now before then...
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

i want to add a dasboard page to webvirtcloud but there was some hiccups before your reorg. may be it is more appropriate and easy adding a dashboard now before then...

I'm working on instances tests, after they're done and branch is tested and merged I think we can start doing this. Instances currently has most messy layout, after splitting views I think it'll be easier to rewrite templates.

<!-- gh-comment-id:649338623 --> @Real-Gecko commented on GitHub (Jun 25, 2020): > i want to add a dasboard page to webvirtcloud but there was some hiccups before your reorg. may be it is more appropriate and easy adding a dashboard now before then... I'm working on instances tests, after they're done and branch is tested and merged I think we can start doing this. Instances currently has most messy layout, after splitting views I think it'll be easier to rewrite templates.
Author
Owner

@catborise commented on GitHub (Jun 25, 2020):

stock bootstrap very limited for a dashboard style app. all templates getting help other css/js extensions.
to solve that problem patternfly extends bootstrap3 to get all necessary components.
https://www.patternfly.org/v4/documentation/core/demos/drawer
redhat uses this framework... may be with layout change it is considered to change css framework also...

<!-- gh-comment-id:649339511 --> @catborise commented on GitHub (Jun 25, 2020): stock bootstrap very limited for a dashboard style app. all templates getting help other css/js extensions. to solve that problem patternfly extends bootstrap3 to get all necessary components. https://www.patternfly.org/v4/documentation/core/demos/drawer redhat uses this framework... may be with layout change it is considered to change css framework also...
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

Was guestfsd updated for Python 3?

<!-- gh-comment-id:649381724 --> @Real-Gecko commented on GitHub (Jun 25, 2020): Was guestfsd updated for Python 3?
Author
Owner

@catborise commented on GitHub (Jun 25, 2020):

i made some changes but i am not sure if it is working or not. i never used it.

<!-- gh-comment-id:649383115 --> @catborise commented on GitHub (Jun 25, 2020): i made some changes but i am not sure if it is working or not. i never used it.
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

I'm currently trying it out and looks like it's a bit broken, will fix it.

<!-- gh-comment-id:649384536 --> @Real-Gecko commented on GitHub (Jun 25, 2020): I'm currently trying it out and looks like it's a bit broken, will fix it.
Author
Owner

@Real-Gecko commented on GitHub (Jun 25, 2020):

ffa85d01c1f66dfc0ca26573d2f190e0411c6e16 fixed gstfsd, but it requires root privileges to run, so I'm leaving change password and add public key functionality without testing.

<!-- gh-comment-id:649434115 --> @Real-Gecko commented on GitHub (Jun 25, 2020): ffa85d01c1f66dfc0ca26573d2f190e0411c6e16 fixed gstfsd, but it requires root privileges to run, so I'm leaving change password and add public key functionality without testing.
Author
Owner

@catborise commented on GitHub (Jun 26, 2020):

editing instance problems (retspen/master):

  1. two message
    image
  2. change instance console type causes error
    image
<!-- gh-comment-id:649986187 --> @catborise commented on GitHub (Jun 26, 2020): editing instance problems (retspen/master): 1. two message ![image](https://user-images.githubusercontent.com/1725643/85825093-024a1200-b78a-11ea-8154-7e65948f4ed9.png) 2. change instance console type causes error ![image](https://user-images.githubusercontent.com/1725643/85825142-2279d100-b78a-11ea-9eb9-96af974ecee4.png)
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

2\. change instance console type causes error
console_types = appsettings.get(key="QEMU_CONSOLE_DEFAULT_TYPE").choices_as_list

Is the cause
must be

console_types = appsettings.get(key="QEMU_CONSOLE_DEFAULT_TYPE").choices_as_list()
<!-- gh-comment-id:650006830 --> @Real-Gecko commented on GitHub (Jun 26, 2020): > 2\. change instance console type causes error ```python console_types = appsettings.get(key="QEMU_CONSOLE_DEFAULT_TYPE").choices_as_list ``` Is the cause must be ```python console_types = appsettings.get(key="QEMU_CONSOLE_DEFAULT_TYPE").choices_as_list() ```
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

1. two message

Instances branch is almost there.

<!-- gh-comment-id:650007261 --> @Real-Gecko commented on GitHub (Jun 26, 2020): > 1. two message Instances branch is almost there.
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

There is a great app https://django-guardian.readthedocs.io/en/stable/ that allows to grant users per object permissions. I've never tried it, but it looks interesting, this will grant us more granular control over instances permissions eliminating the need for UserInstance model. But this improvement is for the future, not something we must implement right now.

<!-- gh-comment-id:650018841 --> @Real-Gecko commented on GitHub (Jun 26, 2020): There is a great app https://django-guardian.readthedocs.io/en/stable/ that allows to grant users per object permissions. I've never tried it, but it looks interesting, this will grant us more granular control over instances permissions eliminating the need for UserInstance model. But this improvement is for the future, not something we must implement right now.
Author
Owner

@catborise commented on GitHub (Jun 26, 2020):

adding more features pushes to more granular permission. it will be nice more user roles then now. it should be considered after stabilizing current...

have you tried async django?
we need async capabilities for cloning instance/disk, migrate, backup... but i do not have an experience with it.
qemu provides async actions with "qemu_qpm" but not libvirt... may be django async does something?

<!-- gh-comment-id:650027802 --> @catborise commented on GitHub (Jun 26, 2020): adding more features pushes to more granular permission. it will be nice more user roles then now. it should be considered after stabilizing current... have you tried async django? we need async capabilities for cloning instance/disk, migrate, backup... but i do not have an experience with it. qemu provides async actions with "qemu_qpm" but not libvirt... may be django async does something?
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

have you tried async django?

Async in Django is not fully there yet:
https://code.djangoproject.com/wiki/AsyncProject
https://speakerdeck.com/andrewgodwin/just-add-await-retrofitting-async-into-django?slide=42
So I think it's better to not bother at all for now, at least until Django 4.0.

In the mean time we'd better clean our source code a little and make it more consistent.

I finished views split for instances ae31225b0b531185f4cb39182c63a89c3fe7ef23 and looks like cleaned up all errors, anyone willing to test the branch is free to do so. In the mean time I'll continue writing auto tests for instances, we're already at 50% coverage. I'll create a PR to retspen/master as soon as no bugs remain. But there're still many places that can be improved in terms of code quality, especially in templates: it's a mess out there :D

<!-- gh-comment-id:650037829 --> @Real-Gecko commented on GitHub (Jun 26, 2020): > have you tried async django? Async in Django is not fully there yet: https://code.djangoproject.com/wiki/AsyncProject https://speakerdeck.com/andrewgodwin/just-add-await-retrofitting-async-into-django?slide=42 So I think it's better to not bother at all for now, at least until Django 4.0. In the mean time we'd better clean our source code a little and make it more consistent. I finished views split for instances ae31225b0b531185f4cb39182c63a89c3fe7ef23 and looks like cleaned up all errors, anyone willing to test the branch is free to do so. In the mean time I'll continue writing auto tests for instances, we're already at 50% coverage. I'll create a PR to retspen/master as soon as no bugs remain. But there're still many places that can be improved in terms of code quality, especially in templates: it's a mess out there :D
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

https://github.com/Real-Gecko/webvirtcloud/tree/instances
link for instances testing

<!-- gh-comment-id:650058848 --> @Real-Gecko commented on GitHub (Jun 26, 2020): https://github.com/Real-Gecko/webvirtcloud/tree/instances link for instances testing
Author
Owner

@Real-Gecko commented on GitHub (Jun 26, 2020):

Added some more tests for instances, coverage is 55% now.

<!-- gh-comment-id:650139951 --> @Real-Gecko commented on GitHub (Jun 26, 2020): Added some more tests for instances, coverage is 55% now.
Author
Owner

@catborise commented on GitHub (Jun 26, 2020):

https://github.com/Real-Gecko/webvirtcloud/tree/instances
link for instances testing

i am working on reverse proxy fixing and console minor fixes. i will test it...

<!-- gh-comment-id:650152956 --> @catborise commented on GitHub (Jun 26, 2020): > https://github.com/Real-Gecko/webvirtcloud/tree/instances > link for instances testing i am working on reverse proxy fixing and console minor fixes. i will test it...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#209
No description provided.