Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitted default queue to import/export, fixed django-rq admin page #5555

Merged
merged 5 commits into from
Jan 6, 2023

Conversation

azhavoro
Copy link
Contributor

@azhavoro azhavoro commented Jan 6, 2023

Motivation and context

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

queue = django_rq.get_queue("default")
rq_id = "/api/{}s/{}/backup".format(filename_prefix, db_instance.pk)
queue = django_rq.get_queue(queue_name)
rq_id = f"api-{filename_prefix}s-{db_instance.pk}/backup"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-backup?

if 'rq_id' in request.data:
rq_id = request.data['rq_id']
else:
rq_id = "{}@/api/projects/{}/import".format(request.user, uuid.uuid4())
rq_id = f"{request.user}$-api-projects-{uuid.uuid4()}-import"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is $ typo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will recommend to think about more readable names: import~project.{uuid.uuid4()}-by-{request.user.username}

if 'rq_id' in request.data:
rq_id = request.data['rq_id']
else:
rq_id = "{}@/api/tasks/{}/import".format(request.user, uuid.uuid4())
rq_id = f"{request.user}$-api-tasks-{uuid.uuid4()}-import"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ meant in. I see no value in $ here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import~task.{uuid.uuid4()}-by-{request.user.username}

@@ -259,7 +259,7 @@ def export_annotations(self, request, pk, db_obj, export_func, callback, get_dat
field_name=StorageType.TARGET,
)

rq_id = "/api/{}/{}/annotations/{}".format(self._object.__class__.__name__.lower(), pk, format_name)
rq_id = f"api-{self._object.__class__.__name__.lower()}-{pk}-annotations-{format_name}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export~annotations-for-{self._object.__class__.__name__.lower()}.id{pk}-in-{format_name}-format

q.enqueue_call(func=_create_thread, args=(tid, data),
job_id="/api/tasks/{}".format(tid))
job_id=f"api-tasks-{tid}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create~task.id{tid}-by-{username}

@@ -24,15 +24,8 @@ autorestart=true

[program:rqworker_low]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rqworker_annotation for consistency?

priority=1
autorestart=true

[program:rqworker_default]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rqworker_export?

"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=%(ENV_NUMPROCS)s
process_name=rqworker_default_%(process_num)s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rqworker_export_?

@nmanovic nmanovic merged commit fd7d802 into develop Jan 6, 2023
@nmanovic nmanovic deleted the az/improve_workers branch January 6, 2023 19:48
@efcy
Copy link
Contributor

efcy commented Jan 7, 2023

@azhavoro there is a reference to cvat_worker_default in the docs share path example. See https://opencv.github.io/cvat/docs/administration/basics/installation/#share-path

How should I adjust that in my override file after this PR? Do I use cvat_worker_import or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants