Skip to content

Commit

Permalink
Config from a single YAML file
Browse files Browse the repository at this point in the history
  • Loading branch information
fajpunk committed Nov 8, 2024
1 parent 126c1ca commit 58f724e
Show file tree
Hide file tree
Showing 34 changed files with 570 additions and 432 deletions.
103 changes: 66 additions & 37 deletions docs/development/idfdev.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################
Testing against ``idfdev``
Testing Against ``idfdev``
##########################

You can run mobu locally while having all of the actual business run against services in ``idefdev`` (or any other environment).
Expand All @@ -17,56 +17,85 @@ You can run mobu locally while having all of the actual business run against ser
set -euo pipefail
config_dir="/tmp/mobu_test"
ci_config_file="github.yaml"
ci_config_path="$config_dir/$ci_config_file"
autostart_config_file="autostart.yaml"
autostart_config_path="$config_dir/$autostart_config_file"
config_file="mobu_config.yaml"
config_path="$config_dir/$config_file"
mkdir -p "$config_dir"
# Note: This whitespace must be actual <tab> chars!
cat <<- 'END' > "$ci_config_path"
users:
cat <<-'END' >"$config_path"
logLevel: debug
githubRefreshApp:
acceptedGithubOrgs:
- lsst-sqre
githubCiApp:
users:
- username: bot-mobu-ci-local-1
- username: bot-mobu-ci-local-2
accepted_github_orgs:
scopes:
- "exec:notebook"
- "exec:portal"
- "read:image"
- "read:tap"
acceptedGithubOrgs:
- lsst-sqre
autostart:
- name: "my-test"
count: 1
users:
- username: "bot-mobu-my-test-local"
scopes:
- "exec:notebook"
business:
type: "NotebookRunner"
options:
repo_url: "https://github.com/lsst-sqre/dfuchs-test-mobu.git"
repo_ref: "dfuchs-test-pr"
max_executions: 10
restart: true
- name: "my-other-test"
count: 1
users:
- username: "bot-mobu-my-test-local2"
scopes:
- "exec:notebook"
business:
type: "NotebookRunner"
options:
repo_url: "https://github.com/lsst-sqre/dfuchs-test-mobu.git"
repo_ref: "main"
max_executions: 10
restart: true
- name: "dfuchs-test-tap"
count: 1
users:
- username: "bot-mobu-dfuchs-test-tap"
scopes: ["read:tap"]
business:
type: "TAPQuerySetRunner"
options:
query_set: "dp0.2"
restart: true
- name: "tap"
count: 1
users:
- username: "bot-mobu-dfuchs-test-tap-query"
scopes: ["read:tap"]
business:
type: "TAPQueryRunner"
options:
queries:
- "SELECT TOP 10 * FROM TAP_SCHEMA.tables"
restart: true
END
# Note: This whitespace must be actual <tab> chars!
cat <<- 'END' > "$autostart_config_path"
- name: "my-test"
count: 1
users:
- username: "bot-mobu-my-test-local"
scopes:
- "exec:notebook"
business:
type: "NotebookRunner"
options:
repo_url: "https://github.com/lsst-sqre/dfuchs-test-mobu.git"
repo_ref: "main"
max_executions: 10
restart: true
END
export MOBU_CONFIG_PATH="$config_path"
export MOBU_ENVIRONMENT_URL=https://data-dev.lsst.cloud
export MOBU_GAFAELFAWR_TOKEN=$(op read "op://Employee/data-dev.lsst.cloud personal token/credential")
export MOBU_AUTOSTART_PATH="$autostart_config_path"
export MOBU_LOG_LEVEL=debug
# Don't set the MOBU_GITHUB_REFRESH* vars if you don't need that integration
export MOBU_GITHUB_REFRESH_ENABLED=true
export MOBU_GITHUB_REFRESH_APP_WEBHOOK_SECRET=$(op read "op://RSP data-dev.lsst.cloud/mobu/github-refresh-app-webhook-secret")
# Don't set the MOBU_GITHUB_REFRESH* vars if you don't need that integration
export MOBU_GITHUB_CI_APP_ENABLED=true
export MOBU_GITHUB_CI_APP_WEBHOOK_SECRET=$(op read "op://RSP data-dev.lsst.cloud/mobu/github-ci-app-webhook-secret")
export MOBU_GITHUB_CI_APP_ID=$(op read "op://RSP data-dev.lsst.cloud/mobu/github-ci-app-id")
export MOBU_GITHUB_CI_APP_PRIVATE_KEY=$(op read "op://RSP data-dev.lsst.cloud/mobu/github-ci-app-private-key" | base64 -d)
# Don't set MOBU_GITHUB_CONFIG_PATH if you don't need any of the GitHub integrations.
export MOBU_GITHUB_CONFIG_PATH="$ci_config_path"
export UVICORN_PORT=8001
uvicorn mobu.main:create_app 2>&1
4 changes: 2 additions & 2 deletions docs/operations/github_ci_app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ In :samp:`applications/mobu/values-{env}.yaml`, add a ``config.githubCiApp`` val
.. code:: yaml
config:
github:
githubCiApp:
acceptedGithubOrgs:
- lsst-sqre
users:
Expand All @@ -58,7 +58,7 @@ In :samp:`applications/mobu/values-{env}.yaml`, add a ``config.githubCiApp`` val
All items are required.

``accepted_github_orgs``
``acceptedGithubOrgs``
A list of GitHub organizations from which this instance of Mobu will accept webhook requests.
Webhook requests from any orgs not in this list will get a ``403`` response.

Expand Down
2 changes: 1 addition & 1 deletion docs/operations/github_refresh_app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ In :samp:`applications/mobu/values-{env}.yaml`, add a ``config.githubRefreshApp`
All of these items are required.

``accepted_github_orgs``
``acceptedGithubOrgs``
A list of GitHub organizations from which this instance of Mobu will accept webhook requests.
Webhook requests from any orgs not in this list will get a ``403`` response.
Loading

0 comments on commit 58f724e

Please sign in to comment.