Skip to content

Commit

Permalink
Merge pull request #2 from AI4Bharat/shoonya-name-change
Browse files Browse the repository at this point in the history
  • Loading branch information
ishvindersethi22 authored Nov 24, 2023
2 parents 2e5b9df + b10d7d6 commit 61a75a4
Show file tree
Hide file tree
Showing 27 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
username: ${{ secrets.DEV2_USERNAME }}
password: ${{ secrets.DEV2_PASSWORD }}
script: |
cd Shoonya-Backend
cd Anudesh-Backend
git checkout develop2
git pull
newgrp docker
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Shoonya Backend
# Anudesh Backend

Repository for Shoonya's backend.
Repository for Anudesh's backend.

## Pre-requisites

Expand Down Expand Up @@ -111,8 +111,8 @@ os=$(uname)

if [ "$os" = "Linux" ] || [ "$os" = "Darwin" ]; then

git clone https://github.com/AI4Bharat/Shoonya-Backend.git
cd Shoonya-Backend
git clone https://github.com/AI4Bharat/Anudesh-Backend.git
cd Anudesh-Backend
git checkout dev
git pull origin dev
cp .env.example ./backend/.env
Expand Down Expand Up @@ -146,18 +146,18 @@ Please install and run redis from https://redis.io/download/ on port 6379 before

To run background tasks for project creation, we need to run the following command in the terminal. This has also been added into the `docker-compose.yml` file.
```bash
celery command - celery -A shoonya_backend.celery worker -l info
celery command - celery -A shoonya_backend.celery beat --loglevel=info
celery command - celery -A anudesh_backend.celery worker -l info
celery command - celery -A anudesh_backend.celery beat --loglevel=info
```

You can set use the celery to local by modifying CELERY_BROKER_URL = "redis://localhost:6379/0" in ./backend/shoonya_backend/settings.py.
You can set use the celery to local by modifying CELERY_BROKER_URL = "redis://localhost:6379/0" in ./backend/anudesh_backend/settings.py.

We can set the concurrency and autoscale in the process as well to manage the number of worker processes in the background. Read more [here](https://stackoverflow.com/a/72366865/9757174).

The commands will be as follows
```bash
celery -A shoonya_backend.celery worker --concurrency=2 --loglevel=info
celery -A shoonya_backend.celery worker --autoscale=10,3 --loglevel=info
celery -A anudesh_backend.celery worker --concurrency=2 --loglevel=info
celery -A anudesh_backend.celery worker --autoscale=10,3 --loglevel=info
```

### Running Linters
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
ASGI config for shoonya_backend project.
ASGI config for anudesh_backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoonya_backend.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anudesh_backend.settings")

application = get_asgi_application()
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

from celery import Celery

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoonya_backend.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anudesh_backend.settings")

# Define celery app and settings
celery_app = Celery(
"shoonya_backend",
"anudesh_backend",
result_backend="django-db",
accept_content=["application/json"],
result_serializer="json",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for shoonya_backend project.
Django settings for anudesh_backend project.
Generated by 'django-admin startproject' using Django 4.0.1.
Expand Down Expand Up @@ -38,9 +38,9 @@
ALLOWED_HOSTS = ["127.0.0.1", "localhost", "0.0.0.0", "*"]
else:
ALLOWED_HOSTS = [
"shoonya.ai4bharat.org",
"anudesh.ai4bharat.org",
"0.0.0.0",
"backend.shoonya.ai4bharat.org",
"backend.anudesh.ai4bharat.org",
]

# Application definition
Expand Down Expand Up @@ -90,7 +90,7 @@

AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend",)

ROOT_URLCONF = "shoonya_backend.urls"
ROOT_URLCONF = "anudesh_backend.urls"

TEMPLATES = [
{
Expand All @@ -108,7 +108,7 @@
},
]

WSGI_APPLICATION = "shoonya_backend.wsgi.application"
WSGI_APPLICATION = "anudesh_backend.wsgi.application"


# Database
Expand Down Expand Up @@ -180,7 +180,7 @@
"rest_framework_simplejwt.authentication.JWTAuthentication",
"rest_framework.authentication.SessionAuthentication",
),
"DEFAULT_PAGINATION_CLASS": "shoonya_backend.pagination.CustomPagination",
"DEFAULT_PAGINATION_CLASS": "anudesh_backend.pagination.CustomPagination",
}


Expand All @@ -193,8 +193,8 @@
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL")

DOMAIN = "shoonya.ai4bharat.org"
SITE_NAME = "shoonya.ai4bharat.org"
DOMAIN = "anudesh.ai4bharat.org"
SITE_NAME = "anudesh.ai4bharat.org"

DJOSER = {
"PASSWORD_RESET_CONFIRM_URL": "#/forget-password/confirm/{uid}/{token}",
Expand Down Expand Up @@ -224,7 +224,7 @@
# Define the list of formatters
formatters = {
"console": {
"()": "shoonya_backend.logger.ConsoleFormatter",
"()": "anudesh_backend.logger.ConsoleFormatter",
"format": "({server_time}) {console_msg}",
"style": "{",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def get_schema(self, request=None, public=False):

SchemaView = get_schema_view(
openapi.Info(
title="Shoonya API Docs",
title="Anudesh API Docs",
default_version="v1",
description="API documentation for Shoonya Platform.",
description="API documentation for Anudesh Platform.",
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="[email protected]"),
license=openapi.License(name="BSD License"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for shoonya_backend project.
WSGI config for anudesh_backend project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoonya_backend.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anudesh_backend.settings")

application = get_wsgi_application()
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ os=$(uname)

if [ "$os" = "Linux" ] || [ "$os" = "Darwin" ]; then

git clone https://github.com/AI4Bharat/Shoonya-Backend.git
cd Shoonya-Backend
git clone https://github.com/AI4Bharat/Anudesh-Backend.git
cd Anudesh-Backend
git checkout dev
git pull origin dev
cp .env.example ./backend/.env
Expand Down
6 changes: 3 additions & 3 deletions backend/functions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
get_not_null_audio_transcription_duration,
)
from projects.views import get_task_count_unassigned, ProjectViewSet
from shoonya_backend import settings
from anudesh_backend import settings
from tasks.models import (
Annotation,
ANNOTATOR_ANNOTATION,
Expand Down Expand Up @@ -764,7 +764,7 @@ def schedule_mail_for_project_reports(
+ str(user.username)
+ f",\nYour project reports for the {type}"
+ f"{name}"
+ " are ready.\n Thanks for contributing on Shoonya!"
+ " are ready.\n Thanks for contributing on Anudesh!"
+ "\nProject Type: "
+ f"{project_type}"
)
Expand Down Expand Up @@ -1487,7 +1487,7 @@ def schedule_mail_to_download_all_projects(
+ str(user.username)
+ f",\nYou can download all the projects by clicking on- "
+ f"{url}"
+ " This link is active only for 1 hour.\n Thanks for contributing on Shoonya!"
+ " This link is active only for 1 hour.\n Thanks for contributing on Anudesh!"
)
email = EmailMessage(
f"{user.username}" + "- Link to download all projects",
Expand Down
2 changes: 1 addition & 1 deletion backend/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoonya_backend.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anudesh_backend.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
10 changes: 5 additions & 5 deletions backend/organizations/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import string
from django.db import models, transaction
from users.models import *
from shoonya_backend.settings import AUTH_USER_MODEL
from shoonya_backend.mixins import DummyModelMixin
from anudesh_backend.settings import AUTH_USER_MODEL
from anudesh_backend.mixins import DummyModelMixin
import secrets
from django.core.mail import send_mail
import os
Expand Down Expand Up @@ -55,7 +55,7 @@ def create_organization(
cls,
created_by=None,
title="Organization",
email_domain_name="organization@shoonya.org",
email_domain_name="organization@anudesh.org",
):
with transaction.atomic():
org = Organization.objects.create(
Expand Down Expand Up @@ -132,7 +132,7 @@ def create_invite(cls, organization=None, users=None):
invite.save()
send_mail(
"Invitation to join Organization",
f"Hello! You are invited to {organization.title}. Your Invite link is: https://shoonya.ai4bharat.org/#/invite/{invite.invite_code}",
f"Hello! You are invited to {organization.title}. Your Invite link is: https://anudesh.ai4bharat.org/#/invite/{invite.invite_code}",
settings.DEFAULT_FROM_EMAIL,
[user.email],
)
Expand All @@ -149,7 +149,7 @@ def re_invite(cls, users=None):
invite = Invite.objects.get(user=user)
send_mail(
"Invitation to join Organization",
f"Hello! You are invited to {invite.organization.title}. Your Invite link is: https://shoonya.ai4bharat.org/#/invite/{invite.invite_code}",
f"Hello! You are invited to {invite.organization.title}. Your Invite link is: https://anudesh.ai4bharat.org/#/invite/{invite.invite_code}",
settings.DEFAULT_FROM_EMAIL,
[user.email],
)
Expand Down
6 changes: 3 additions & 3 deletions backend/organizations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def send_user_reports_mail_org(
+ str(user.username)
+ ",\nYour user payment reports for "
+ f"{organization.title}"
+ " are ready.\n Thanks for contributing on Shoonya!"
+ " are ready.\n Thanks for contributing on Anudesh!"
+ "\nProject Type: "
+ f"{project_type}"
+ "\nParticipation Types: "
Expand Down Expand Up @@ -1195,7 +1195,7 @@ def send_project_analytics_mail_org(
+ str(user.username)
+ ",\nYour project analysis reports for "
+ f"{organization.title}"
+ " are ready.\n Thanks for contributing on Shoonya!"
+ " are ready.\n Thanks for contributing on Anudesh!"
+ "\nProject Type: "
+ f"{project_type}"
)
Expand Down Expand Up @@ -1401,7 +1401,7 @@ def send_user_analytics_mail_org(
+ str(user.username)
+ ",\nYour user analysis reports for "
+ f"{organization.title}"
+ " are ready.\n Thanks for contributing on Shoonya!"
+ " are ready.\n Thanks for contributing on Anudesh!"
+ "\nProject Type: "
+ f"{project_type}"
)
Expand Down
6 changes: 3 additions & 3 deletions backend/projects/annotation_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def convert_prediction_json_to_annotation_result(
}
if is_acoustic:
text_dict["from_name"] = "verbatim_transcribed_json"
id = f"shoonya_{index}s{idx}s{generate_random_string(13-len(str(idx)))}"
id = f"anudesh_{index}s{idx}s{generate_random_string(13-len(str(idx)))}"
label_dict["id"] = id
text_dict["id"] = id
label_dict["type"] = "labels"
Expand Down Expand Up @@ -202,7 +202,7 @@ def convert_conversation_json_to_annotation_result(conversation_json, idx):
result = []
for i in range(len(conversation_json)):
for j in range(len(conversation_json[i]["sentences"])):
id = f"shoonya_{idx}s{i}s{j}s{generate_random_string(15-len(str(i))-len(str(j)))}"
id = f"anudesh_{idx}s{i}s{j}s{generate_random_string(15-len(str(i))-len(str(j)))}"
text_dict = {
"id": id,
"type": "textarea",
Expand All @@ -228,7 +228,7 @@ def draft_data_json_to_annotation_result(draft_data_json, project_type, pk=None)
idx = 0
for field, value in draft_data_json.items():
try:
id = f"shoonya_{idx}g{generate_random_string(13-len(str(idx)))}"
id = f"anudesh_{idx}g{generate_random_string(13-len(str(idx)))}"
field_dict = {
"id": id,
"origin": "manual",
Expand Down
4 changes: 2 additions & 2 deletions backend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def convert_prediction_json_to_annotation_result(pk, proj_type):
}
if proj_type == "AcousticNormalisedTranscriptionEditing":
text_dict["from_name"] = "verbatim_transcribed_json"
id = f"shoonya_{idx}s{generate_random_string(13 - len(str(idx)))}"
id = f"anudesh_{idx}s{generate_random_string(13 - len(str(idx)))}"
label_dict["id"] = id
text_dict["id"] = id
label_dict["type"] = "labels"
Expand Down Expand Up @@ -884,7 +884,7 @@ def convert_prediction_json_to_annotation_result(pk, proj_type):
if "image_rotation" in ocr_prediction_json
else 0
)
custom_id = f"shoonya_{idx}s{generate_random_string(13 - len(str(idx)))}"
custom_id = f"anudesh_{idx}s{generate_random_string(13 - len(str(idx)))}"
# creating values
common_value = {
"x": val["x"],
Expand Down
4 changes: 2 additions & 2 deletions backend/user_reports.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoonya_backend.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anudesh_backend.settings")
django.setup()
import schedule
import requests
Expand Down Expand Up @@ -215,7 +215,7 @@ def calculate_reports():
+ str(user.username)
+ ",\n Your progress reports for "
+ f"{(datetime.now() - timedelta(days = 1) ):%d-%m-%Y}"
+ " are ready.\n Thanks for contributing on Shoonya!"
+ " are ready.\n Thanks for contributing on Anudesh!"
)

if (
Expand Down
4 changes: 2 additions & 2 deletions backend/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from organizations.models import Organization
from workspaces.models import Workspace
from shoonya_backend import settings
from anudesh_backend import settings
from dotenv import load_dotenv

from .utils import hash_upload
Expand Down Expand Up @@ -261,7 +261,7 @@ def send_mail_to_change_password(self, email, key):
link = f"{prefix}/#/forget-password/confirm/{key}/{sent_token}"
try:
send_mail(
"Reset password link for shoonya",
"Reset password link for anudesh",
f"Hello! Please click on the following link to reset your password - {link}",
settings.DEFAULT_FROM_EMAIL,
[email],
Expand Down
2 changes: 1 addition & 1 deletion backend/users/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.core.mail import send_mail
from celery.schedules import crontab
from shoonya_backend.celery import celery_app
from anudesh_backend.celery import celery_app
from user_reports import calculate_reports


Expand Down
4 changes: 2 additions & 2 deletions backend/workspaces/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import shoonya_backend.mixins
import anudesh_backend.mixins


class Migration(migrations.Migration):
Expand Down Expand Up @@ -73,6 +73,6 @@ class Migration(migrations.Migration):
options={
"ordering": ["pk"],
},
bases=(models.Model, shoonya_backend.mixins.DummyModelMixin),
bases=(models.Model, anudesh_backend.mixins.DummyModelMixin),
),
]
Loading

0 comments on commit 61a75a4

Please sign in to comment.