-
Notifications
You must be signed in to change notification settings - Fork 851
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
Release 0.76.0 #2857
Release 0.76.0 #2857
Changes from all commits
a1f3f8d
51ecbb7
ebe7d26
84ed9e8
6ca9cb7
b17c1a0
310cfb3
de90e81
bccc9a4
a4ea1f7
0ebdc5f
4f3688a
1de0d4b
53290f2
416a904
68f7d06
ab84ce7
fc2e339
abd026b
db15302
b25c6af
51ef7dc
2d26ed4
bcdb1b6
768c340
9167238
0e47f00
4d04633
354a833
2af7ef1
22ba0d6
9d7420e
7fb513d
69cd421
edb56ea
64b859b
cbb76f8
a2f8c24
fdc18cb
af14944
daced69
be2b209
cc2ac05
72b5097
d5402fa
f05b2ed
b8b577c
750ab2d
a83b07a
027ccf5
c6817f8
f837f54
df98aa3
28abb83
dfc8c34
6b5bfdb
42b0bc4
2a76f9c
6730a11
39f552b
6035218
70fa87c
6f931ee
f711042
dbed6aa
95f37e6
3a78d15
24da2cd
9132ae5
42b5840
6f3f09b
f25f695
b435122
2229359
062fe36
7cd7779
1dbb414
ccd6379
9eb8e63
965d806
417cd15
8f2aaa3
4d574f2
614fce6
d0d20ae
268d482
4eb8f71
3a2188f
8b8f90d
98ff8e1
febdee1
96b25e8
523e135
f0cd7f7
d852a60
ce10293
c163846
0db3ba3
20c3ab9
dd16275
4ccfba5
64b82a2
3ee5e48
cd2c620
9ceb97f
7392635
9235aa8
636ef8c
2149adf
62c5d0d
23f7892
cd8bad5
ec84836
249cf37
ec99c31
59abdea
628a1a2
9ba79f0
97cbf45
bc547d9
ab5b5a0
86c8a68
3cf11de
da49d9e
dd4175e
1f7723e
9579840
bfd6b23
d858c00
4003fda
9bd9889
a2a26e3
65ba252
2b8c819
f07a971
f0f7059
c7380c2
9e8795e
c1b7a84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from .Environment import Environment | ||
from .ServerThread import ServerThread | ||
from .LoginException import LoginException | ||
from .Environment import Environment | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
@test_db_connection | ||
@with_database | ||
@click.pass_context | ||
def start(ctx, disable_collection, development, port): | ||
Check warning on line 46 in augur/application/cli/backend.py
|
||
"""Start Augur's backend server.""" | ||
|
||
try: | ||
|
@@ -73,13 +73,13 @@ | |
worker_vmem_cap = get_value("Celery", 'worker_process_vmem_cap') | ||
|
||
gunicorn_command = f"gunicorn -c {gunicorn_location} -b {host}:{port} augur.api.server:app --log-file gunicorn.log" | ||
server = subprocess.Popen(gunicorn_command.split(" ")) | ||
Check warning on line 76 in augur/application/cli/backend.py
|
||
|
||
time.sleep(3) | ||
logger.info('Gunicorn webserver started...') | ||
logger.info(f'Augur is running at: {"http" if development else "https"}://{host}:{port}') | ||
|
||
processes = start_celery_worker_processes(float(worker_vmem_cap), disable_collection) | ||
Check warning on line 82 in augur/application/cli/backend.py
|
||
|
||
if os.path.exists("celerybeat-schedule.db"): | ||
logger.info("Deleting old task schedule") | ||
|
@@ -88,7 +88,7 @@ | |
log_level = get_value("Logging", "log_level") | ||
celery_beat_process = None | ||
celery_command = f"celery -A augur.tasks.init.celery_app.celery_app beat -l {log_level.lower()}" | ||
celery_beat_process = subprocess.Popen(celery_command.split(" ")) | ||
Check warning on line 91 in augur/application/cli/backend.py
|
||
|
||
if not disable_collection: | ||
|
||
|
@@ -154,7 +154,7 @@ | |
|
||
frontend_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=1 -n frontend:{uuid.uuid4().hex}@%h -Q frontend" | ||
max_process_estimate -= 1 | ||
process_list.append(subprocess.Popen(frontend_worker.split(" "))) | ||
Check warning on line 157 in augur/application/cli/backend.py
|
||
sleep_time += 6 | ||
|
||
if not disable_collection: | ||
|
@@ -162,25 +162,25 @@ | |
#2 processes are always reserved as a baseline. | ||
scheduling_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=2 -n scheduling:{uuid.uuid4().hex}@%h -Q scheduling" | ||
max_process_estimate -= 2 | ||
process_list.append(subprocess.Popen(scheduling_worker.split(" "))) | ||
Check warning on line 165 in augur/application/cli/backend.py
|
||
sleep_time += 6 | ||
|
||
#60% of estimate, Maximum value of 45 : Reduced because it can be lower | ||
core_num_processes = determine_worker_processes(.15, 10) | ||
core_num_processes = determine_worker_processes(.40, 50) | ||
logger.info(f"Starting core worker processes with concurrency={core_num_processes}") | ||
core_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={core_num_processes} -n core:{uuid.uuid4().hex}@%h" | ||
process_list.append(subprocess.Popen(core_worker.split(" "))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
sleep_time += 6 | ||
|
||
#20% of estimate, Maximum value of 25 | ||
secondary_num_processes = determine_worker_processes(.70, 60) | ||
secondary_num_processes = determine_worker_processes(.39, 50) | ||
logger.info(f"Starting secondary worker processes with concurrency={secondary_num_processes}") | ||
secondary_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={secondary_num_processes} -n secondary:{uuid.uuid4().hex}@%h -Q secondary" | ||
process_list.append(subprocess.Popen(secondary_worker.split(" "))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
sleep_time += 6 | ||
|
||
#15% of estimate, Maximum value of 20 | ||
facade_num_processes = determine_worker_processes(.15, 20) | ||
facade_num_processes = determine_worker_processes(.17, 20) | ||
logger.info(f"Starting facade worker processes with concurrency={facade_num_processes}") | ||
facade_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={facade_num_processes} -n facade:{uuid.uuid4().hex}@%h -Q facade" | ||
|
||
|
@@ -308,7 +308,7 @@ | |
SET facade_status='Pending', facade_task_id=NULL | ||
WHERE facade_status='Failed Clone' OR facade_status='Initializing'; | ||
""")) | ||
#TODO: write timestamp for currently running repos. | ||
Check warning on line 311 in augur/application/cli/backend.py
|
||
|
||
def assign_orphan_repos_to_default_user(session): | ||
query = s.sql.text(""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,21 +125,21 @@ def determine_worker_processes(ratio,maximum): | |
sleep_time += 6 | ||
|
||
#60% of estimate, Maximum value of 45: Reduced because not needed | ||
core_num_processes = determine_worker_processes(.15, 10) | ||
core_num_processes = determine_worker_processes(.40, 50) | ||
logger.info(f"Starting core worker processes with concurrency={core_num_processes}") | ||
core_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={core_num_processes} -n core:{uuid.uuid4().hex}@%h" | ||
process_list.append(subprocess.Popen(core_worker.split(" "))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
sleep_time += 6 | ||
|
||
#20% of estimate, Maximum value of 25 | ||
secondary_num_processes = determine_worker_processes(.70, 60) | ||
secondary_num_processes = determine_worker_processes(.39, 50) | ||
logger.info(f"Starting secondary worker processes with concurrency={secondary_num_processes}") | ||
secondary_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={secondary_num_processes} -n secondary:{uuid.uuid4().hex}@%h -Q secondary" | ||
process_list.append(subprocess.Popen(secondary_worker.split(" "))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
sleep_time += 6 | ||
|
||
#15% of estimate, Maximum value of 20 | ||
facade_num_processes = determine_worker_processes(.15, 20) | ||
facade_num_processes = determine_worker_processes(.17, 20) | ||
logger.info(f"Starting facade worker processes with concurrency={facade_num_processes}") | ||
facade_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency={facade_num_processes} -n facade:{uuid.uuid4().hex}@%h -Q facade" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import json | ||
import logging | ||
|
||
from augur.application.db.models import Config | ||
from augur.application.db.session import DatabaseSession | ||
from augur.application.config import AugurConfig | ||
from augur.application.cli import DatabaseContext, test_connection, test_db_connection, with_database | ||
|
@@ -160,7 +161,7 @@ def add_section(ctx, section_name, file): | |
@click.option('--section', required=True) | ||
@click.option('--setting', required=True) | ||
@click.option('--value', required=True) | ||
@click.option('--data-type', required=True) | ||
@click.option('--data-type') | ||
@test_connection | ||
@test_db_connection | ||
@with_database | ||
|
@@ -169,6 +170,12 @@ def config_set(ctx, section, setting, value, data_type): | |
|
||
with DatabaseSession(logger, engine=ctx.obj.engine) as session: | ||
config = AugurConfig(logger, session) | ||
|
||
if not data_type: | ||
result = session.query(Config).filter(Config.section_name == section, Config.setting_name == setting).all() | ||
if not result: | ||
return click.echo("You must specify a data-type if the setting does not already exist") | ||
data_type = result[0].type | ||
|
||
if data_type not in config.accepted_types: | ||
print(f"Error invalid type for config. Please use one of these types: {config.accepted_types}") | ||
|
@@ -218,6 +225,22 @@ def config_get(ctx, section, setting): | |
else: | ||
print(f"Error: {section} section not found in config") | ||
|
||
@cli.command('get_all_json') | ||
def config_get_all_json(): | ||
data = {} | ||
try: | ||
with DatabaseSession(logger) as session: | ||
sections = session.query(Config.section_name).distinct().all() | ||
for section in sections: | ||
data[section[0]] = {} | ||
|
||
for row in session.query(Config).all(): | ||
data[row.section_name][row.setting_name] = row.value | ||
except: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
pass | ||
|
||
print(json.dumps(data, indent=4)) | ||
|
||
@cli.command('clear') | ||
@test_connection | ||
@test_db_connection | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,8 @@ def start(): | |
secondary_worker_process = None | ||
|
||
scheduling_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=1 -n scheduling:{uuid.uuid4().hex}@%h -Q scheduling" | ||
core_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=20 -n core:{uuid.uuid4().hex}@%h" | ||
secondary_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=60 -n secondary:{uuid.uuid4().hex}@%h -Q secondary" | ||
core_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=50 -n core:{uuid.uuid4().hex}@%h" | ||
secondary_worker = f"celery -A augur.tasks.init.celery_app.celery_app worker -l info --concurrency=50 -n secondary:{uuid.uuid4().hex}@%h -Q secondary" | ||
|
||
scheduling_worker_process = subprocess.Popen(scheduling_worker.split(" ")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
core_worker_process = subprocess.Popen(core_worker.split(" ")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from celery import chain | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
import logging | ||
|
||
def machine_learning_phase(repo_git): | ||
def machine_learning_phase(repo_git, full_collection): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
from augur.tasks.data_analysis.clustering_worker.tasks import clustering_task | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
from augur.tasks.data_analysis.discourse_analysis.tasks import discourse_analysis_task | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
from augur.tasks.data_analysis.insight_worker.tasks import insight_task | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
|
@@ -15,7 +15,7 @@ def machine_learning_phase(repo_git): | |
ml_tasks.append(discourse_analysis_task.si(repo_git)) | ||
ml_tasks.append(insight_task.si(repo_git)) | ||
ml_tasks.append(message_insight_task.si(repo_git)) | ||
ml_tasks.append(pull_request_analysis_task.si(repo_git)) | ||
#ml_tasks.append(pull_request_analysis_task.si(repo_git)) | ||
|
||
logger.info(f"Machine learning sequence: {ml_tasks}") | ||
return chain(*ml_tasks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)