Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

RECIRCLE / portal

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 11
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !23 opened Apr 27, 2020 by Chif Gergő@chif.gergo 
  • Report abuse
Report abuse

Realtime status

Features

Websocket

Clients can subscribe to websocket channel which sends information about instance status changes.

URI:

ws://{BASE_URL}/ws/instance-statuses

This queries messages for vms which belongs to the user.

Celery

Includes celery.py for background tasks

Celery-beat package for running scheduler for periodic tasks.

Running periodic tasks:

celery -A recircle worker -B -l INFO

Edited Jun 25, 2020 by Chif Gergő
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b realtime-status origin/realtime-status

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout DEV
git merge --no-ff realtime-status

Step 4. Push the result of the merge to GitLab

git push origin DEV

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 6
  • Commits 24
  • Pipelines 16
  • Changes 14
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Chif Gergő @chif.gergo

    added 1 commit

    • db59fc6f - Fix celery confoguration

    Compare with previous version

    Apr 27, 2020

    added 1 commit

    • db59fc6f - Fix celery confoguration

    Compare with previous version

    added 1 commit * db59fc6f - Fix celery confoguration [Compare with previous version](https://git.ik.bme.hu/RECIRCLE/portal/merge_requests/23/diffs?diff_id=1000&start_sha=1a9d29a03d785b4df3daedab0e4b3c9dc0411fa7)
    Toggle commit list
  • Chif Gergő @chif.gergo

    added 1 commit

    • 09803af9 - Fix check old status and new

    Compare with previous version

    Apr 27, 2020

    added 1 commit

    • 09803af9 - Fix check old status and new

    Compare with previous version

    added 1 commit * 09803af9 - Fix check old status and new [Compare with previous version](https://git.ik.bme.hu/RECIRCLE/portal/merge_requests/23/diffs?diff_id=1001&start_sha=db59fc6f5f667e098605f7f47de46b40a80cd623)
    Toggle commit list
  • Chif Gergő @chif.gergo

    marked as a Work In Progress

    Apr 28, 2020

    marked as a Work In Progress

    marked as a **Work In Progress**
    Toggle commit list
  • Chif Gergő @chif.gergo

    changed the description

    Apr 28, 2020

    changed the description

    changed the description
    Toggle commit list
  • Belákovics Ádám
    @Edi started a discussion on the diff May 04, 2020
    Last updated by Chif Gergő May 05, 2020
    recircle/instance/models.py
    251 254
    252 255 def update_status(self):
    253 256 remote = self.get_remote_instance()
    254 self.status = remote.status
    255 self.save()
    257 if self.status != remote.status:
    258 self.status = remote.status
    259 channels = get_channel_layer()
    260 async_to_sync(channels.group_send)(
    • Belákovics Ádám @Edi commented May 04, 2020
      Owner

      ez miért kell?

      ez miért kell?
    • Chif Gergő @chif.gergo commented May 05, 2020
      Master

      Mi?

      Mi?
    Please register or sign in to reply
  • Belákovics Ádám
    @Edi started a discussion on the diff May 04, 2020
    Last updated by Chif Gergő May 05, 2020
    recircle/instance/models.py
    251 254
    252 255 def update_status(self):
    253 256 remote = self.get_remote_instance()
    254 self.status = remote.status
    255 self.save()
    257 if self.status != remote.status:
    258 self.status = remote.status
    259 channels = get_channel_layer()
    260 async_to_sync(channels.group_send)(
    261 str(self.id), {"type": "status_changed",
    262 "status": self.status,
    263 "vm": str(self.id)
    • Belákovics Ádám @Edi commented May 04, 2020
      Owner

      Itt miért kell az str?

      Itt miért kell az str?
    • Chif Gergő @chif.gergo commented May 05, 2020
      Master

      Hogy string legyen 😸

      Hogy string legyen :smile_cat:
    Please register or sign in to reply
  • Belákovics Ádám
    @Edi started a discussion on the diff May 04, 2020
    Last updated by Chif Gergő May 05, 2020
    recircle/recircle/routing.py 0 → 100644
    1 from channels.auth import AuthMiddlewareStack
    2 from channels.routing import ProtocolTypeRouter, URLRouter
    3 import status.routing
    4
    5 application = ProtocolTypeRouter({
    6 # Empty for now (http->django views is added by default)
    7 'websocket': AuthMiddlewareStack(
    • Belákovics Ádám @Edi commented May 04, 2020
      Owner

      Az AuthMiddlewareStack az mi?

      Az AuthMiddlewareStack az mi?
    • Chif Gergő @chif.gergo commented May 05, 2020
      Master

      https://channels.readthedocs.io/en/latest/topics/authentication.html

      https://channels.readthedocs.io/en/latest/topics/authentication.html
    Please register or sign in to reply
  • Chif Gergő @chif.gergo

    unmarked as a Work In Progress

    Jun 25, 2020

    unmarked as a Work In Progress

    unmarked as a **Work In Progress**
    Toggle commit list
  • Chif Gergő @chif.gergo

    merged

    Jul 17, 2020

    merged

    merged
    Toggle commit list
  • Chif Gergő @chif.gergo

    mentioned in commit 28c8e075

    Jul 17, 2020

    mentioned in commit 28c8e075

    mentioned in commit 28c8e075cf6c5388a49c99623f1cb1ffb42c9711
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: RECIRCLE/portal!23
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.