-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from 6G-SANDBOX/dev
New release 0.4.0
- Loading branch information
Showing
74 changed files
with
2,217 additions
and
1,821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.github/ | ||
.vscode/ | ||
docs/ | ||
scripts/ | ||
tn_template_lib/ | ||
venv/ | ||
**/__pycache__/ | ||
core/logs/executions/ | ||
core/trial_networks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# FLASK_ENV | ||
# 1. development | ||
# 2. production | ||
# 3. testing | ||
FLASK_ENV="production" | ||
# GUNICORN | ||
GUNICORN_WORKERS=3 | ||
GUNICORN_TIMEOUT=7200 | ||
GUNICORN_LOG_LEVEL="INFO" | ||
|
||
# TNLCM | ||
TNLCM_LOG_LEVEL="INFO" | ||
TNLCM_ADMIN_USER="" | ||
TNLCM_ADMIN_PASSWORD="" | ||
TNLCM_ADMIN_EMAIL="" | ||
TNLCM_ADMIN_EMAIL="[email protected]" | ||
TNLCM_HOST="" | ||
TNLCM_PORT=5000 | ||
TNLCM_CALLBACK="http://${TNLCM_HOST}:${TNLCM_PORT}/tnlcm/callback" | ||
|
||
# Jenkins connection | ||
# JENKINS | ||
JENKINS_HOST="" | ||
JENKINS_PORT=8080 | ||
JENKINS_URL="http://${JENKINS_HOST}:${JENKINS_PORT}" | ||
|
@@ -22,37 +22,35 @@ JENKINS_TOKEN="" | |
JENKINS_DEPLOY_PIPELINE="TN_DEPLOY" | ||
JENKINS_DESTROY_PIPELINE="TN_DESTROY" | ||
|
||
# MongoDB database | ||
MONGO_INITDB_ROOT_USERNAME="tnlcm-database-user" | ||
MONGO_INITDB_ROOT_PASSWORD="tnlcm-database-password" | ||
# MONGODB | ||
MONGO_HOST="127.0.0.1" | ||
MONGO_PORT=27017 | ||
MONGO_DATABASE="tnlcm-database" | ||
# MongoDB connect database with frontend | ||
|
||
# MONGO-EXPRESS | ||
ME_CONFIG_MONGODB_ADMINUSERNAME="tnlcm-database-user" | ||
ME_CONFIG_MONGODB_ADMINPASSWORD="tnlcm-database-password" | ||
ME_CONFIG_MONGODB_URL="mongodb://${ME_CONFIG_MONGODB_ADMINUSERNAME}:${ME_CONFIG_MONGODB_ADMINPASSWORD}@${MONGO_DATABASE}:${MONGO_PORT}/?authSource=admin" | ||
# MongoDB database frontend dashboard | ||
ME_CONFIG_MONGODB_ENABLE_ADMIN="false" | ||
ME_CONFIG_MONGODB_URL="mongodb://${ME_CONFIG_MONGODB_ADMINUSERNAME}:${ME_CONFIG_MONGODB_ADMINPASSWORD}@${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}" | ||
ME_CONFIG_BASICAUTH="true" | ||
ME_CONFIG_SITE_SESSIONSECRET="secret" | ||
VCAP_APP_HOST="0.0.0.0" | ||
ME_CONFIG_BASICAUTH_USERNAME="tnlcm" | ||
ME_CONFIG_BASICAUTH_PASSWORD="tnlcm" | ||
|
||
# Connect TNLCM with MongoDB | ||
MONGO_URI="mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}?authSource=admin" | ||
|
||
# 6G-Library connection | ||
# 6G-LIBRARY | ||
GITHUB_6G_LIBRARY_HTTPS_URL="https://github.com/6G-SANDBOX/6G-Library.git" | ||
GITHUB_6G_LIBRARY_BRANCH="main" | ||
GITHUB_6G_LIBRARY_REPOSITORY_NAME="6G-Library" | ||
|
||
# 6G-Sandbox-Sites connection | ||
# 6G-SANDBOX-SITES | ||
GITHUB_6G_SANDBOX_SITES_HTTPS_URL="https://github.com/6G-SANDBOX/6G-Sandbox-Sites.git" | ||
GITHUB_6G_SANDBOX_SITES_BRANCH="main" | ||
GITHUB_6G_SANDBOX_SITES_REPOSITORY_NAME="6G-Sandbox-Sites" | ||
# Ansible password to decrypt file 6G-Sandbox-Sites | ||
# Not use " or ' or ` | ||
ANSIBLE_VAULT='' | ||
# Ansible password to decrypt file 6G-Sandbox-Sites (not use \" or \' or \`) | ||
SITES_TOKEN='' | ||
|
||
# Mail constants | ||
MAIL_SERVER="smtp.gmail.com" | ||
MAIL_PORT=465 | ||
MAIL_USE_TLS=False | ||
|
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in the repo. Unless a later match takes precedence, @CarlosAndreo will be requested for review when someone opens a pull request. | ||
* @CarlosAndreo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
|
||
from core.logs.log_handler import log_handler | ||
from conf import MailSettings, MongoDBSettings | ||
|
||
class FlaskConf(object): | ||
""" | ||
Flask Settings | ||
""" | ||
|
||
DEBUG = False | ||
TESTING = False | ||
SECRET_KEY = os.getenv("SECRET_KEY") or "clave" | ||
ERROR_404_HELP = False | ||
|
||
ME_CONFIG_MONGODB_URL = MongoDBSettings.ME_CONFIG_MONGODB_URL | ||
|
||
MAIL_SERVER = MailSettings.MAIL_SERVER | ||
MAIL_PORT = MailSettings.MAIL_PORT | ||
MAIL_USE_TLS = MailSettings.MAIL_USE_TLS | ||
MAIL_USE_SSL = MailSettings.MAIL_USE_SSL | ||
MAIL_USERNAME = MailSettings.MAIL_USERNAME | ||
MAIL_PASSWORD = MailSettings.MAIL_PASSWORD | ||
|
||
config_dict = { | ||
"DEBUG": DEBUG, | ||
"TESTING": TESTING, | ||
"SECRET_KEY": SECRET_KEY, | ||
"ERROR_404_HELP": ERROR_404_HELP, | ||
"ME_CONFIG_MONGODB_URL": ME_CONFIG_MONGODB_URL, | ||
"MAIL_SERVER": MAIL_SERVER, | ||
"MAIL_PORT": MAIL_PORT, | ||
"MAIL_USE_TLS": MAIL_USE_TLS, | ||
"MAIL_USE_SSL": MAIL_USE_SSL, | ||
"MAIL_USERNAME": MAIL_USERNAME, | ||
"MAIL_PASSWORD": MAIL_PASSWORD, | ||
} | ||
|
||
log_handler.info(f"Load Flask configuration: {config_dict}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
|
||
from conf import TnlcmSettings | ||
from core.logs.log_handler import log_handler | ||
from core.exceptions.exceptions_handler import UndefinedEnvVariableError | ||
|
||
# Number of worker processes to handle requests | ||
workers = os.getenv("GUNICORN_WORKERS") | ||
|
||
# Log level for output verbosity | ||
loglevel = os.getenv("GUNICORN_LOG_LEVEL") | ||
|
||
# Request timeout in seconds (35 minutes). The time of the component that takes the longest time to deploy | ||
timeout = os.getenv("GUNICORN_TIMEOUT") | ||
|
||
# Address and port Gunicorn will bind to | ||
bind = f"0.0.0.0:{TnlcmSettings.TNLCM_PORT}" | ||
|
||
# WSGI entry point for the application | ||
wsgi_app = "app:app" | ||
|
||
# Maximum number of pending connections | ||
backlog = 1024 | ||
|
||
missing_variables = [] | ||
if not workers: | ||
missing_variables.append("GUNICORN_WORKERS") | ||
if not workers: | ||
missing_variables.append("GUNICORN_LOG_LEVEL") | ||
if not workers: | ||
missing_variables.append("GUNICORN_TIMEOUT") | ||
if missing_variables: | ||
raise UndefinedEnvVariableError(missing_variables) | ||
|
||
config_dict = { | ||
"WORKERS": workers, | ||
"BIND": bind, | ||
"TIMEOUT": timeout, | ||
"LOGLEVEL": loglevel, | ||
"BACKLOG": backlog, | ||
} | ||
|
||
log_handler.info(f"Load gunicorn configuration: {config_dict}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.