MACROECO Self-Deployment Guide — Own-Workspace NWUs

This guide is for NWUs that operate their own Databricks workspace and want to deploy the MACROECO DAB independently, outside of the centrally managed workspace.


Prerequisites

Before you start, make sure the following are in place:

  • A Service Principal (SP) created for your legacy use case in your Databricks workspace
  • A Use Case Role ARN (Instance Profile ARN) for S3 access
  • Access to your Databricks workspace
  • Access to the GitHub repository to configure secrets and workflows

How to obtain SP and Use Case Role ARN: Create a JIRA ticket referencing APEX-15817 and request an SP and Use Case Role ARN for S3 connection. Include the following details in your ticket:

Field Value (replace with your NWU name)
Source S3 Bucket s3://finca-890742592045-mopla-p02-data/<nwu>
ARN Role arn:aws:iam::890742592045:role/finca-copy-s3apex-data-p02-<nwu>
KMS ARN arn:aws:kms:eu-central-1:890742592045:key/6d321a0b-148a-4a9a-898b-75e60b4bfcd8

Valid NWU examples: rbhu, rbhr, rbpl, rbko


Step 1: Clone the Repository

git clone https://code.rbi.tech/raiffeisen/rram-primes-macromodeling-pypk-dab.git
cd rram-primes-macromodeling-pypk-dab

# Fetch all tags
git fetch --all --tags

# Checkout the desired released version
git checkout tags/v<version>   # e.g. git checkout tags/v1.1.0

Verify you are on the correct version:

cat VERSION
---

## Step 2: Configure GitHub Secrets

Navigate to your cloned/forked repository on GitHub:

1. Go to **Settings** → **Secrets and variables** → **Actions**
2. Click **New repository secret** and create the following two secrets:

| Secret Name | Value |
|---|---|
| `DATABRICKS_CLIENT_ID_<NWU>` | Your SP Client ID (e.g. `DATABRICKS_CLIENT_ID_RBHU`) |
| `DATABRICKS_CLIENT_SECRET_<NWU>` | Your SP Client Secret (e.g. `DATABRICKS_CLIENT_SECRET_RBHU`) |

---

## Step 3: Create Your Config File

The `config/` directory contains one config file per NWU. Use the HO config as your base:

```bash
# Keep only rram-ifrs9-ho.yml and rename it to your use case
cp config/rram-ifrs9-ho.yml config/<your-use-case-name>.yml
# Example: cp config/rram-ifrs9-ho.yml config/rbhu-rrm-dev-ltpd.yml

You can delete all other .yml files in the config/ folder — they are for other NWUs and are not needed.

Edit Your Config File

Open config/<your-use-case-name>.yml and fill in the values for your environment:

variables:

  nwu:
    default: "rbhu"                             # your NWU name, lowercase

  cluster_user:
    default: "<your-sp-client-id>"              # SP Client ID set in GitHub secrets

  node_type:
    default: "r7a.4xlarge"                      # adjust based on your input data size
                                                # use r7a.4xlarge if input may exceed ~5M rows

  policy_id:
    default: "<cluster-policy-id>"              # see below for how to find this

  instance_profile_arn:
    default: "arn:aws:iam::<aws-account-id>:instance-profile/<instance-profile-name>"
                                                # enter your Use Case Role ARN here

  role_arn:
    default: "arn:aws:iam::890742592045:role/finca-copy-s3apex-data-p02-${var.nwu}"

  input_path:
    default: "${var.nwu}/macroeco/input"

  output_path:
    default: "${var.nwu}/macroeco/results"

  notification_emails:
    default:
      - "your-name@example.com"
      - "teammate@example.com"

  use_case:
    default: "<your-use-case-name>"               # your APEX use case / group name in the workspace. example: "rbhu-rrm-dev-ltpd"

How to Find Each Value

Variable Where to find it
nwu Your NWU short name (e.g. rbhu, rbhr, rbpl)
cluster_user The SP Client ID you set in GitHub secrets
node_type Recommended: r7a.4xlarge for datasets > ~5M rows; r7a.2xlarge otherwise
policy_id Databricks workspace → ComputePolicies → click your use case → copy the Policy ID shown at the top
instance_profile_arn The Use Case Role ARN you received from the JIRA ticket (Step 0)
role_arn The ARN Role from the JIRA ticket (same account, matches NWU name)
notification_emails Email addresses for job failure/success alerts
use_case The APEX use case / group name in your Databricks workspace

Step 4: Update the GitHub Actions Workflow

Open .github/workflows/deploy.yml and make the following changes:

4a — Add your NWU to the workflow inputs

Find the nwu: options: block and add your NWU, removing any entries that do not apply:

      nwu:
        description: 'Use Case'
        type: choice
        options:
          - rbhu          # ← replace existing options with yours
        required: true

4b — Add your workspace URL to the Databricks host options

Find the databricks-host: options: block and replace the existing URLs with your workspace URL:

      databricks-host:
        description: 'Databricks Workspace URL'
        type: choice
        options:
          - 'https://<your-workspace>.cloud.databricks.com'   # ← your workspace URL

4c — Fix the config copy step

Find the “Copy use case configuration” step under jobs: and update the mv command to explicitly reference your config file name:

      - name: Copy ${{ steps.nwu_upper.outputs.nwu_upper }} use case configuration
        run: |
          mv config/<your-use-case-name>.yml config.yml   # ← use your exact config file name (example: rbhu-rrm-dev-ltpd.yml)

This step is necessary because the wildcard pattern config/*-${{ inputs.nwu }}.yml expects the filename to end with -<nwu>.yml. If your config filename follows a different convention (e.g. rbhu-rrm-dev-macroeco.yml), you must reference it explicitly.


Step 5: Validate and Deploy

Once the config and workflow are in place, trigger a deployment from GitHub Actions:

  1. Go to ActionsDeployRun workflow
  2. Select:
    • Branch: your release tag (e.g. release/1.1.0)
    • Use Case: your NWU (e.g. rbhu)
    • Target: prod
    • Databricks Workspace URL: your workspace URL

Alternatively, you can deploy manually from the CLI:

# Authenticate
export DATABRICKS_HOST="https://<your-workspace>.cloud.databricks.com"
export DATABRICKS_CLIENT_ID="<sp-client-id>"
export DATABRICKS_CLIENT_SECRET="<sp-client-secret>"

# Activate your config
cp config/<your-use-case-name>.yml config.yml

# Set bundle version
export BUNDLE_VAR_bundle_version="<version>"   # e.g. "6.0.0"

# Validate and deploy
databricks bundle validate -t prod
databricks bundle deploy -t prod

Step 6: Run the MACROECO Job

After a successful deployment, the Application UI will be available at:

'https://<your-workspace>.cloud.databricks.com/compute/apps'

Navigate to the application, start it through the three dots on the right side, there is a waiting time of 1-2 minutes. Refer to the main User Manual for detailed usage instructions.