Skip to content

Commit a24ea50

Browse files
committed
Release 6.3.4 - Airflow v3 compatibility
1 parent 2682b49 commit a24ea50

82 files changed

Lines changed: 541 additions & 223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,4 @@
195195
"reporting": "REPORTING_OracleEBS"
196196
}
197197
}
198-
}
198+
}

docs/deprecated/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Navigate to [Cloud Storage](https://console.cloud.google.com/storage/create-buck
321321
**Alternatively**, you can use the following command to create a bucket from the Cloud Shell:
322322

323323
```bash
324-
gsutil mb -l <REGION/MULTI-REGION> gs://<BUCKET NAME>
324+
gcloud storage buckets create --location <REGION/MULTI-REGION> gs://<BUCKET NAME>
325325
```
326326

327327
Navigate to the _Permissions_ tab. Grant `Storage Object Creator` to the user executing the Build command or to the Service account you created for impersonation.
@@ -333,7 +333,7 @@ You can create a specific bucket for the Cloud Build process to store the logs.
333333
**Alternatively**, here is the command line to create this bucket:
334334

335335
```bash
336-
gsutil mb -l <REGION/MULTI-REGION> gs://<BUCKET NAME>
336+
gcloud storage buckets create -l <REGION/MULTI-REGION> gs://<BUCKET NAME>
337337
```
338338

339339
You will need to grant `Object Admin` permissions to the Cloud Build service account.
@@ -560,8 +560,8 @@ We recommend pasting the generated SQL into BigQuery to identify and correct the
560560
If you opted to generate integration or CDC files and have an instance of Cloud Composer (Airflow), you can move them into their final bucket with the following command:
561561

562562
```bash
563-
gsutil -m cp -r gs://<output bucket>/dags/ gs://<composer DAG bucket>/
564-
gsutil -m cp -r gs://<output bucket>/data/ gs://<composer DAG bucket>/
563+
gcloud storage cp --recursive gs://<output bucket>/dags/ gs://<composer DAG bucket>/
564+
gcloud storage cp --recursive gs://<output bucket>/data/ gs://<composer DAG bucket>/
565565
```
566566

567567
## Test, customize and prepare for upgrade

docs/deprecated/RELEASE_NOTES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ The following changes are on our roadmap and are planned to happen **no sooner t
202202
* Option for `sequential` deployment (TURBO=false) for SFDC incorporated.
203203
* Salesforce integration now updates the RAW tables with changes, merging changes on landing. This removes the need for additional CDC processing. Deltas are captured using SystemModstamp provided by Salesforce APIs. See details in README.
204204
* `IsArchived` flag is removed from CDC processing for Salesforce.
205-
* Errors originating from gsutil steps in cloudbuild.sfdc.yaml not finding files to copy are now caught and surfaced gracefully.
205+
* Errors originating from gcloud storage steps in cloudbuild.sfdc.yaml not finding files to copy are now caught and surfaced gracefully.
206206
* Removing some `substitution` defaults (e.g., LOCATION) from cloudbuild.yaml file so all configurations are either passed from the command line or read from `config/config.json`. 🚨🔪🚨[TL;DR submit sample call](https://github.com/GoogleCloudPlatform/cortex-data-foundation#tldr-for-setup) was updated to default these flags. These parameters will be removed from subsitution defaults in future releases. 🚨🔪🚨
207207
* Detecting version for Airflow in DAG templates to use updated libraries for Airflow v2 in SAP and Salesforce. This remvoes some deprecation warnings but may need additional libraries installed in your Airflow instance.
208208
* Fix for test harness data not loading in an intended location when the location is not passed as a substitution.
209-
* Checking existence of DAG-generated files before attempting to copy with `gsutil` to avoid errors.
209+
* Checking existence of DAG-generated files before attempting to copy with `gcloud storage cp` to avoid errors.
210210
* **NOTE**: 🚨🚨Structure of RAW landed tables has changed🚨🚨 to not require additional DAG processing. Please check the documentation on mapping and use of the new extraction process before upgrading to avoid disruption. We recommend pausing the replication, making abackup copy of any loaded tables, modifying the schemata of existing loaded tables and testing the new DAGs work with the new columns. The DAG will start fetching records using the last SystemModstamp present in RAW.
211211
## December 2022 - Release 4.0
212212
* **🎆Welcome Salesforce.com to Cortex Data Foundation🎆🐈🦄**: New [module for Salesforce](https://github.com/GoogleCloudPlatform/cortex-salesforce), to be implemented alongside the SAP models or on its own. The module includes optional integration and CDC scripts and reporting views for Leads Capture & Conversion, Opportunity Trends & Pipeline, Sales Activity and Engagement, Case Overview and Trends, Case Management & Resolution, Accounts with Cases. See the [entity-relationship diagram](images/erd_sfdc.png) for a list of tables and views. Check the [Looker repository](https://github.com/looker-open-source/block-cortex-salesforce) for sample dashboards.

src/OracleEBS/src/common/materializer/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ echo "generate_dependent_dags.py completed successfully."
220220
if [[ $(find generated_materializer_dag_files/*/*/task_dep_dags -type f 2> /dev/null | wc -l) -gt 0 ]]
221221
then
222222
echo "Copying DAG files to GCS bucket..."
223-
echo "gsutil -m cp -r 'generated_materializer_dag_files/*' gs://${GCS_TGT_BUCKET}/dags/"
224-
gsutil -m cp -r 'generated_materializer_dag_files/*' "gs://${GCS_TGT_BUCKET}/dags/"
223+
echo "gcloud storage cp --recursive 'generated_materializer_dag_files/*' gs://${GCS_TGT_BUCKET}/dags/"
224+
gcloud storage cp --recursive 'generated_materializer_dag_files/*' "gs://${GCS_TGT_BUCKET}/dags/"
225225
else
226226
echo "No task dependent DAG files to copy to GCS bucket!"
227227
fi

src/OracleEBS/src/common/materializer/templates/airflow_dag_template_reporting.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from datetime import timedelta
2525

2626
import airflow
27+
from airflow import __version__ as airflow_version
28+
from packaging.version import Version
2729
from airflow.operators.empty import EmptyOperator
2830
from airflow.providers.google.cloud.operators.bigquery import \
2931
BigQueryInsertJobOperator
@@ -34,18 +36,23 @@
3436

3537
default_dag_args = {
3638
"depends_on_past": False,
37-
"start_date": datetime(${year}, ${month}, ${day}),
39+
"start_date": datetime(int("${year}"), int("${month}"), int("${day}")),
3840
"catchup": False,
3941
"retries": 1,
4042
"retry_delay": timedelta(minutes=30),
4143
}
4244

45+
if Version(airflow_version) >= Version("2.4.0"):
46+
schedule_kwarg = {"schedule": "${load_frequency}"}
47+
else:
48+
schedule_kwarg = {"schedule_interval": "${load_frequency}"}
49+
4350
with airflow.DAG("${dag_full_name}",
4451
default_args=default_dag_args,
4552
catchup=False,
4653
max_active_runs=1,
47-
schedule_interval="${load_frequency}",
48-
tags=${tags}) as dag:
54+
tags=ast.literal_eval("${tags}"),
55+
**schedule_kwarg) as dag:
4956
start_task = EmptyOperator(task_id="start")
5057
refresh_table = BigQueryInsertJobOperator(
5158
task_id="refresh_table",

src/OracleEBS/src/common/materializer/templates/airflow_task_dep_dag_template_reporting.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from datetime import timedelta
2525

2626
import airflow
27+
from airflow import __version__ as airflow_version
28+
from packaging.version import Version
2729
from airflow.operators.empty import EmptyOperator
2830
from airflow.providers.google.cloud.operators.bigquery import \
2931
BigQueryInsertJobOperator
@@ -36,18 +38,23 @@
3638

3739
default_dag_args = {
3840
"depends_on_past": False,
39-
"start_date": datetime(${year}, ${month}, ${day}),
41+
"start_date": datetime(int("${year}"), int("${month}"), int("${day}")),
4042
"catchup": False,
4143
"retries": 1,
4244
"retry_delay": timedelta(minutes=30),
4345
}
4446

47+
if Version(airflow_version) >= Version("2.4.0"):
48+
schedule_kwarg = {"schedule": "${load_frequency}"}
49+
else:
50+
schedule_kwarg = {"schedule_interval": "${load_frequency}"}
51+
4552
with airflow.DAG("${dag_full_name}",
4653
default_args=default_dag_args,
4754
catchup=False,
4855
max_active_runs=1,
49-
schedule_interval="${load_frequency}",
50-
tags=${tags}) as dag:
56+
tags=ast.literal_eval("${tags}"),
57+
**schedule_kwarg) as dag:
5158

5259
start_task = EmptyOperator(task_id="start")
5360

src/OracleEBS/src/common/materializer/templates/cloudbuild_materializer.yaml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ steps:
8888
if [[ $(find generated_materializer_dag_files -type f 2> /dev/null | wc -l) -gt 0 ]]
8989
then
9090
echo "Copying DAG files to GCS bucket..."
91-
echo "gsutil -m cp -r 'generated_materializer_dag_files/*' gs://${_GCS_TGT_BUCKET}/dags/"
92-
gsutil -m cp -r 'generated_materializer_dag_files/*' gs://${_GCS_TGT_BUCKET}/dags/
91+
echo "gcloud storage cp --recursive 'generated_materializer_dag_files/*' gs://${_GCS_TGT_BUCKET}/dags/"
92+
gcloud storage cp --recursive 'generated_materializer_dag_files/*' gs://${_GCS_TGT_BUCKET}/dags/
9393
else
9494
echo "No files to copy to GCS bucket!"
9595
fi

src/OracleEBS/src/common/py_libs/k9_deployer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ def _simple_process_and_upload(k9_id: str, k9_dir: str, jinja_dict: dict,
8282
if "__init__.py" not in [str(p.relative_to(k9_dir)) for p in k9_files]:
8383
with open(f"{tmp_dir}/__init__.py", "w", encoding="utf-8") as f:
8484
f.writelines([
85-
"import os",
86-
"import sys",
85+
"import os\n",
86+
"import sys\n",
8787
("sys.path.append("
88-
"os.path.dirname(os.path.realpath(__file__)))")
88+
"os.path.dirname(os.path.realpath(__file__)))\n")
8989
])
9090

9191
if data_source == "k9":

src/OracleEBS/src/common/py_libs/resource_validation_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def validate_resources(
128128
if isinstance(ex, NotFound):
129129
logging.error("🛑 Storage bucket `%s` doesn't exist. 🛑",
130130
bucket.name)
131-
elif isinstance(ex, Unauthorized, Forbidden):
131+
elif isinstance(ex, (Unauthorized, Forbidden)):
132132
if checking_on_writing:
133133
logging.error("🛑 Storage bucket `%s` "
134134
"is not writable. 🛑", bucket.name)

src/SAP/SAP_CDC/cdc_settings.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,3 +312,7 @@ data_to_replicate:
312312
load_frequency: "@weekly"
313313
- base_table: mkol
314314
load_frequency: "@weekly"
315+
## CORTEX-CUSTOMER: Uncomment if you need optional address notes/remarks in AddressMD view.
316+
# - base_table: adrt
317+
# load_frequency: "@daily"
318+

0 commit comments

Comments
 (0)