Skip to content

Commit

Permalink
Move tasks to data_tasks directory
Browse files Browse the repository at this point in the history
Adapt executable and github actions naming as well
  • Loading branch information
marcospri committed Nov 25, 2022
1 parent 97a0a35 commit dcab408
Show file tree
Hide file tree
Showing 43 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Run various SQL defined tasks, usually related to the report aggregations
# Run various tasks, usually related to the report aggregations

name: SQL tasks
name: Data tasks
on:
workflow_dispatch:
inputs:
Task:
type: choice
description: "The SQL task to perform"
description: "The data task to perform"
required: true
options:
- "report/refresh"
Expand Down Expand Up @@ -47,12 +47,12 @@ jobs:
run_task:
needs: check_for_danger
name: "Run '${{ inputs.Task }}' SQL task in ${{ inputs.Environment }} / ${{ inputs.Region }}"
name: "Run '${{ inputs.Task }}' Data task in ${{ inputs.Environment }} / ${{ inputs.Region }}"
uses: hypothesis/workflows/.github/workflows/eb-task.yml@main
with:
App: ${{ github.event.repository.name }}
Env: ${{ inputs.Environment }}
Timeout: 3600
Region: ${{ inputs.Region }}
Command: 'newrelic-admin run-program python bin/run_sql_task.py --config-file conf/production.ini --task ${{ inputs.Task }}'
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/production.ini --task ${{ inputs.Task }}'
secrets: inherit
6 changes: 3 additions & 3 deletions bin/run_sql_task.py → bin/run_data_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

from lms.models import Regions

TASK_ROOT = importlib_resources.files("lms.sql_tasks") / "tasks"
TASK_ROOT = importlib_resources.files("lms.data_tasks")

parser = ArgumentParser(
description=f"A script for running SQL tasks defined in: {TASK_ROOT}"
description=f"A script for running tasks defined in: {TASK_ROOT}"
)
parser.add_argument(
"-c",
Expand All @@ -28,7 +28,7 @@
help="The paster config for this application. (e.g. development.ini)",
)

parser.add_argument("-t", "--task", required=True, help="The SQL task name to run")
parser.add_argument("-t", "--task", required=True, help="The data task name to run")

parser.add_argument(
"--no-python",
Expand Down
File renamed without changes.
Empty file removed lms/sql_tasks/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_task(self, environ, task_name):
result = check_output(
[
sys.executable,
"bin/run_sql_task.py",
"bin/run_data_task.py",
"--config-file",
"conf/development.ini",
"--task",
Expand Down

0 comments on commit dcab408

Please sign in to comment.