Skip to content

Commit

Permalink
Merge pull request #1225 from chaoss/test
Browse files Browse the repository at this point in the history
Release PR
  • Loading branch information
sgoggins authored Apr 6, 2021
2 parents 71db576 + 10792cd commit ff5d919
Show file tree
Hide file tree
Showing 18 changed files with 5,093 additions and 6,763 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ notebooks/
cache/

**/node_modules
**/dist
#**/dist

# Logs
logs/
Expand Down
31 changes: 31 additions & 0 deletions augur/cli/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,37 @@ def kill():
"""
_broadcast_signal_to_processes(signal=signal.SIGKILL, given_logger=logging.getLogger("augur.cli"))

@cli.command('export-env')
@pass_config
def export_env(config):
"""
Exports your GitHub key and database credentials
"""

export_file = open(os.getenv('AUGUR_EXPORT_FILE', 'augur_export_env.sh'), 'w+')
export_file.write('#!/bin/bash')
export_file.write('\n')
env_file = open(os.getenv('AUGUR_ENV_FILE', 'docker_env.txt'), 'w+')

for env_var in config.get_env_config().items():
if "LOG" not in env_var[0]:
logger.info(f"Exporting {env_var[0]}")
export_file.write('export ' + env_var[0] + '="' + str(env_var[1]) + '"\n')
env_file.write(env_var[0] + '=' + str(env_var[1]) + '\n')

export_file.close()
env_file.close()

@cli.command('repo-reset')
@pass_application
def repo_reset(augur_app):
"""
Refresh repo collection to force data collection
"""
augur_app.database.execute("UPDATE augur_data.repo SET repo_path = NULL, repo_name = NULL, repo_status = 'New'; TRUNCATE augur_data.commits CASCADE; ")

logger.info("Repos successfully reset")

@cli.command('processes')
@initialize_logging
def processes():
Expand Down
16 changes: 8 additions & 8 deletions augur/routes/contributor_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def new_contributors_bar():

caption = """This graph shows fly by contributors in the specified time period. Fly by contributors are contributors who
make less than the required {} contributions in {} days. New contributors are individuals who make their first contribution
in the specified time period. Of course, then, “All drive-by’s are by definition first time contributors”. However, not all
first time contributors are drive-by’s."""
in the specified time period. Of course, then, “All fly-by’s are by definition first time contributors”. However, not all
first time contributors are fly-by’s."""


elif contributor_type == 'All':
Expand Down Expand Up @@ -653,8 +653,8 @@ def new_contributors_stacked_bar():

caption = """This graph shows fly by contributors in the specified time period. Fly by contributors are contributors who
make less than the required {} contributions in {} days. New contributors are individuals who make their first contribution
in the specified time period. Of course, then, “All drive-by’s are by definition first time contributors”. However, not all
first time contributors are drive-by’s."""
in the specified time period. Of course, then, “All fly-by’s are by definition first time contributors”. However, not all
first time contributors are fly-by’s."""


elif contributor_type == 'All':
Expand Down Expand Up @@ -1121,11 +1121,11 @@ def returning_contributor_stacked_bar():
label_text_font_size = "13pt"

data_source = {'Dates' : data['dates'],
'Drive By' : data['drive_by_counts'],
'Fly By' : data['drive_by_counts'],
'Repeat' : data['repeat_counts'],
'All' : data['total_counts']}

groups = ["Drive By", "Repeat"]
groups = ["Fly By", "Repeat"]

colors = ['#56B4E9', '#E69F00']

Expand All @@ -1150,7 +1150,7 @@ def returning_contributor_stacked_bar():
text_color="black", source=source, text_align='center'))

#add drive by count labels
p.add_layout(LabelSet(x='Dates', y='Drive By', text='Fly By', y_offset=-22, text_font_size=label_text_font_size,
p.add_layout(LabelSet(x='Dates', y='Fly By', text='Fly By', y_offset=-22, text_font_size=label_text_font_size,
text_color="black", source=source, text_align='center'))

#add repeat count labels
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def returning_contributor_stacked_bar():
#add plot to hold caption
p = figure(width = plot_width, height=200, margin = (0, 0, 0, 0))

caption = """This graph shows the number of new contributors in the specified time period, and indicates how many were drive-by and repeat
caption = """This graph shows the number of new contributors in the specified time period, and indicates how many were fly-by and repeat
contributors. Fly by contributors are contributors who make less than the required {0} contributions in {1} days. New contributors are
individuals who make their first contribution in the specified time period. Repeat contributors are contributors who have made {0} or more
contributions in {1} days and their first contribution is in the specified time period."""
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
restart: unless-stopped
ports:
- 5000:5000
- 50100-50800:50100-50800
- 50000-52000:50000-52000
env_file: docker_env.txt

frontend:
Expand Down
13 changes: 11 additions & 2 deletions docs/source/getting-started/collecting-data.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
Collecting data
===============

Now that you've installed Augur's application server, it's time to configure your data collection workers.
Now that you've installed Augur's application server, it's time to configure your data collection workers. If you just want to run Augur using the single repository in the default database, and default worker settings all you need to do is this:

There are 2 pieces to data collection with Augur: the housekeeper, and the data collection workers. The housekeeper creates long-running "jobs" that specify what kind of data to collect for what set of repositories. The data collection workers can then accept these jobs, after which it will use the information provided in the job to find the repositories in question and collect the requested data.
.. code-block:: bash
# To Start Augur:
$ nohup augur backend start >logs/run.log 2>logs/run.err &
# To Stop Augur:
$ augur backend stop
$ augur backend kill
Now, here's a ton of brain splitting detail about workers, and their configuration. There are 2 pieces to data collection with Augur: the housekeeper, and the data collection workers. The housekeeper creates long-running "jobs" that specify what kind of data to collect for what set of repositories. The data collection workers can then accept these jobs, after which it will use the information provided in the job to find the repositories in question and collect the requested data.

Since the default housekeeper setup will work for most use cases, we'll first cover how to configure the workers and then briefly touch on the housekeeper configuration options, after which we'll cover how to add repos and repo groups to the database.

Expand Down
49 changes: 49 additions & 0 deletions docs/source/getting-started/command-line-interface/backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,52 @@ If you'd like to clean all previously collected errors, run::
$ augur backend start --logstash-with-cleanup

Open http://localhost:8003 and select workers to check for errors.


``export-env``
---------------
Exports your GitHub key and database credentials to 2 files. The first is ``augur_export_env.sh`` which is an executable shell script that can be used to initialize environment variables for some of your credentials. The second is ``docker_env.txt`` which specifies each credential in a key/value pair format that is used to configure the backend Docker containers.

Example usage::

# to export your environment
$ augur util export-env

# successful output looks like:
> CLI: [util.export_env] [INFO] Exporting AUGUR_GITHUB_API_KEY
> CLI: [util.export_env] [INFO] Exporting AUGUR_DB_HOST
> CLI: [util.export_env] [INFO] Exporting AUGUR_DB_NAME
> CLI: [util.export_env] [INFO] Exporting AUGUR_DB_PORT
> CLI: [util.export_env] [INFO] Exporting AUGUR_DB_USER
> CLI: [util.export_env] [INFO] Exporting AUGUR_DB_PASSWORD

# contents of augur_export_env.sh
#!/bin/bash
export AUGUR_GITHUB_API_KEY="your_key_here"
export AUGUR_DB_HOST="your_host"
export AUGUR_DB_NAME="your_db_name"
export AUGUR_DB_PORT="your_db_port"
export AUGUR_DB_USER="your_db_user"
export AUGUR_DB_PASSWORD="your_db_password"

# contents of docker_env.txt
AUGUR_GITHUB_API_KEY="your_key_here"
AUGUR_DB_HOST="your_host"
AUGUR_DB_NAME="your_db_name"
AUGUR_DB_PORT="your_db_port"
AUGUR_DB_USER="your_db_user"
AUGUR_DB_PASSWORD="your_db_password"


``repo-reset``
---------------
Refresh repo collection to force data collection. Mostly for debugging.

Example usage::

# to reset the repo collection status to "New"
$ augur util repo-reset

# successful output looks like:
> CLI: [util.repo_reset] [INFO] Repos successfully reset

1 change: 0 additions & 1 deletion docs/source/getting-started/command-line-interface/toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ Each command is invoked by first specifying the category, then the command name,

db
backend
util
configure
logging
65 changes: 0 additions & 65 deletions docs/source/getting-started/command-line-interface/util.rst

This file was deleted.

11 changes: 11 additions & 0 deletions docs/source/getting-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,19 @@ your installation of Python 3: on most systems, this is ``python3``, but yours m
# run the install script
$ make install
.. code-block:: bash
# If you want to develop with Augur, use this command instead
$ make install-dev
If you think something went wrong, check the log files in ``logs/``. If you want to try again, you can use ``make clean`` to delete any build files before running ``make install`` again.

If you want to test new code you have written, you can rebuild Augur using:

.. code-block:: bash
$ make rebuild-dev
.. note::

If you chose to install Augur's frontend dependencies, you might see a bunch of ``canvas@1.6.x`` and ``canvas-prebuilt@1.6.x`` errors in the installation logs. These are harmless and are caused by a few of our dependencies having *optional* requirements for old versions of these libraries. If they seem to be causing you trouble, feel free to open an `issue <https://github.com/chaoss/augur/issues>`_.
Expand Down
Loading

0 comments on commit ff5d919

Please sign in to comment.