ai-accelerator 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AI_Accelerator/__init__.py +3 -0
- AI_Accelerator/asgi.py +16 -0
- AI_Accelerator/celery.py +11 -0
- AI_Accelerator/settings.py +203 -0
- AI_Accelerator/urls.py +33 -0
- AI_Accelerator/wsgi.py +16 -0
- ai_accelerator-0.1.0.dist-info/METADATA +1079 -0
- ai_accelerator-0.1.0.dist-info/RECORD +30 -0
- ai_accelerator-0.1.0.dist-info/WHEEL +5 -0
- ai_accelerator-0.1.0.dist-info/entry_points.txt +2 -0
- ai_accelerator-0.1.0.dist-info/licenses/LICENSE +200 -0
- ai_accelerator-0.1.0.dist-info/top_level.txt +2 -0
- aiac/__init__.py +0 -0
- aiac/admin.py +3 -0
- aiac/aiac_cli.py +31 -0
- aiac/apps.py +6 -0
- aiac/client.py +29 -0
- aiac/config.py +26 -0
- aiac/console.py +15 -0
- aiac/deployment/commands.py +236 -0
- aiac/governance/commands.py +150 -0
- aiac/main.py +8 -0
- aiac/migrations/__init__.py +0 -0
- aiac/models.py +3 -0
- aiac/monitoring/commands.py +141 -0
- aiac/requirments.txt +4 -0
- aiac/tests.py +3 -0
- aiac/urls.py +4 -0
- aiac/user/auth.py +52 -0
- aiac/views.py +3 -0
AI_Accelerator/asgi.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for AI_Accelerator project.
|
|
3
|
+
|
|
4
|
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.asgi import get_asgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AI_Accelerator.settings')
|
|
15
|
+
|
|
16
|
+
application = get_asgi_application()
|
AI_Accelerator/celery.py
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Django settings for AI_Accelerator project.
|
|
3
|
+
|
|
4
|
+
Generated by 'django-admin startproject' using Django 5.2.7.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/5.2/topics/settings/
|
|
8
|
+
|
|
9
|
+
For the full list of settings and their values, see
|
|
10
|
+
https://docs.djangoproject.com/en/5.2/ref/settings/
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
16
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Quick-start development settings - unsuitable for production
|
|
20
|
+
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
|
21
|
+
|
|
22
|
+
# SECURITY WARNING: keep the secret key used in production secret!
|
|
23
|
+
SECRET_KEY = 'django-insecure-31zkjc965bz@we($(*xw5f6)w!-%w-v#$(5-x8v)wa^k8%k(07'
|
|
24
|
+
|
|
25
|
+
# SECURITY WARNING: don't run with debug turned on in production!
|
|
26
|
+
DEBUG = True
|
|
27
|
+
|
|
28
|
+
ALLOWED_HOSTS = []
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Application definition
|
|
32
|
+
|
|
33
|
+
INSTALLED_APPS = [
|
|
34
|
+
'django.contrib.admin',
|
|
35
|
+
'django.contrib.auth',
|
|
36
|
+
'django.contrib.contenttypes',
|
|
37
|
+
'django.contrib.sessions',
|
|
38
|
+
'django.contrib.messages',
|
|
39
|
+
'django.contrib.staticfiles',
|
|
40
|
+
'users',
|
|
41
|
+
'deployment',
|
|
42
|
+
|
|
43
|
+
'monitoring',
|
|
44
|
+
'governance',
|
|
45
|
+
'aiac',
|
|
46
|
+
'rest_framework',
|
|
47
|
+
"rest_framework_simplejwt",
|
|
48
|
+
'rest_framework_simplejwt.token_blacklist',
|
|
49
|
+
'corsheaders',
|
|
50
|
+
'drf_spectacular',
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
# Custom user model
|
|
54
|
+
AUTH_USER_MODEL = 'users.User'
|
|
55
|
+
|
|
56
|
+
MIDDLEWARE = [
|
|
57
|
+
'django.middleware.security.SecurityMiddleware',
|
|
58
|
+
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
59
|
+
'corsheaders.middleware.CorsMiddleware',
|
|
60
|
+
'django.middleware.common.CommonMiddleware',
|
|
61
|
+
'django.middleware.csrf.CsrfViewMiddleware',
|
|
62
|
+
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
63
|
+
'django.contrib.messages.middleware.MessageMiddleware',
|
|
64
|
+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
ROOT_URLCONF = 'AI_Accelerator.urls'
|
|
68
|
+
|
|
69
|
+
TEMPLATES = [
|
|
70
|
+
{
|
|
71
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
72
|
+
'DIRS': [],
|
|
73
|
+
'APP_DIRS': True,
|
|
74
|
+
'OPTIONS': {
|
|
75
|
+
'context_processors': [
|
|
76
|
+
'django.template.context_processors.request',
|
|
77
|
+
'django.contrib.auth.context_processors.auth',
|
|
78
|
+
'django.contrib.messages.context_processors.messages',
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
WSGI_APPLICATION = 'AI_Accelerator.wsgi.application'
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# Database
|
|
88
|
+
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
|
89
|
+
'''
|
|
90
|
+
DATABASES = {
|
|
91
|
+
'default': {
|
|
92
|
+
'ENGINE': 'django.db.backends.sqlite3',
|
|
93
|
+
'NAME': BASE_DIR / 'db.sqlite3',
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
'''
|
|
97
|
+
|
|
98
|
+
# Password validation
|
|
99
|
+
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
|
100
|
+
|
|
101
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
102
|
+
{
|
|
103
|
+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# Internationalization
|
|
118
|
+
# https://docs.djangoproject.com/en/5.2/topics/i18n/
|
|
119
|
+
|
|
120
|
+
LANGUAGE_CODE = 'en-us'
|
|
121
|
+
|
|
122
|
+
TIME_ZONE = 'UTC'
|
|
123
|
+
|
|
124
|
+
USE_I18N = True
|
|
125
|
+
|
|
126
|
+
USE_TZ = True
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# Static files (CSS, JavaScript, Images)
|
|
130
|
+
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
|
131
|
+
|
|
132
|
+
STATIC_URL = 'static/'
|
|
133
|
+
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
|
134
|
+
MEDIA_URL = '/media/'
|
|
135
|
+
MEDIA_ROOT = BASE_DIR / 'media'
|
|
136
|
+
|
|
137
|
+
# Default primary key field type
|
|
138
|
+
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
|
139
|
+
|
|
140
|
+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
141
|
+
DJANGO_ALLOW_ALL_ORIGINS = True
|
|
142
|
+
AYTH_USER_MODEL = 'users.User'
|
|
143
|
+
import os
|
|
144
|
+
DATABASES = {
|
|
145
|
+
'default': {
|
|
146
|
+
'ENGINE': 'django.db.backends.postgresql',
|
|
147
|
+
'NAME' : os.getenv('DB_Name'),
|
|
148
|
+
'USER' : os.getenv('Username'),
|
|
149
|
+
'PASSWORD' : os.getenv('Password'),
|
|
150
|
+
'HOST' : os.getenv('Host'),
|
|
151
|
+
'PORT' : os.getenv('Port'),
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
REST_FRAMEWORK ={
|
|
156
|
+
'DEFAULT_AUTHENTICATION_CLASSES':(
|
|
157
|
+
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
|
158
|
+
'rest_framework.authentication.SessionAuthentication',
|
|
159
|
+
),
|
|
160
|
+
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
SPECTACULAR_SETTINGS = {
|
|
164
|
+
'TITLE': 'AI_Accelerator',
|
|
165
|
+
'DESCRIPTION': 'AI Accelerator is a SaaS platform designed to help small and medium-sized enterprises (SMEs) accelerate the adoption of Artificial Intelligence by simplifying the process of deploying, monitoring, and managing AI models. The platform bridges the gap between AI experimentation and production, enabling companies to leverage AI effectively without requiring large ML/DevOps teams.',
|
|
166
|
+
'VERSION': '1.0.0',
|
|
167
|
+
'SERVE_INCLUDE_SCHEMA': False,
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
from decouple import config
|
|
172
|
+
|
|
173
|
+
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
174
|
+
EMAIL_HOST = config('EMAIL_HOST')
|
|
175
|
+
EMAIL_PORT = config('EMAIL_PORT', cast=int)
|
|
176
|
+
EMAIL_USE_TLS = config('EMAIL_USE_TLS', cast=bool)
|
|
177
|
+
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
|
|
178
|
+
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
|
|
179
|
+
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
|
180
|
+
|
|
181
|
+
from datetime import timedelta
|
|
182
|
+
|
|
183
|
+
SIMPLE_JWT = {
|
|
184
|
+
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
|
|
185
|
+
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=30),
|
|
186
|
+
'ROTATE_REFRESH_TOKENS': True,
|
|
187
|
+
'BLACKLIST_AFTER_ROTATION': True,
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
CELERY_BROKER_URL = "redis://http:localhost:6379/0"
|
|
191
|
+
CELERY_RESULT_BACKEND = "redis://http:localhost:6379/0"
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
CACHES = {
|
|
196
|
+
"default": {
|
|
197
|
+
"BACKEND": "django_redis.cache.RedisCache",
|
|
198
|
+
"LOCATION": "redis://127.0.0.1:6379/1",
|
|
199
|
+
"OPTIONS": {
|
|
200
|
+
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
AI_Accelerator/urls.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
URL configuration for AI_Accelerator project.
|
|
3
|
+
|
|
4
|
+
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
5
|
+
https://docs.djangoproject.com/en/5.2/topics/http/urls/
|
|
6
|
+
Examples:
|
|
7
|
+
Function views
|
|
8
|
+
1. Add an import: from my_app import views
|
|
9
|
+
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
10
|
+
Class-based views
|
|
11
|
+
1. Add an import: from other_app.views import Home
|
|
12
|
+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
13
|
+
Including another URLconf
|
|
14
|
+
1. Import the include() function: from django.urls import include, path
|
|
15
|
+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
16
|
+
"""
|
|
17
|
+
from django.contrib import admin
|
|
18
|
+
from django.urls import path,include
|
|
19
|
+
from django.conf import settings
|
|
20
|
+
from django.conf.urls.static import static
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
urlpatterns = [
|
|
24
|
+
path('admin/', admin.site.urls),
|
|
25
|
+
path('api/users/', include('users.urls')),
|
|
26
|
+
path('api/deployment/', include('deployment.urls')),
|
|
27
|
+
path('api/aiac/', include('aiac.urls')),
|
|
28
|
+
path('api/monitoring/', include('monitoring.urls')),
|
|
29
|
+
path('api/governance/', include('governance.urls')),
|
|
30
|
+
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
AI_Accelerator/wsgi.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WSGI config for AI_Accelerator project.
|
|
3
|
+
|
|
4
|
+
It exposes the WSGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.wsgi import get_wsgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AI_Accelerator.settings')
|
|
15
|
+
|
|
16
|
+
application = get_wsgi_application()
|