Skip to content

Commit 0e2efe7

Browse files
Merge branch 'master' into annualGDP_config
2 parents d790d8d + c5a8a58 commit 0e2efe7

File tree

61 files changed

+7033
-353
lines changed

Some content is hidden

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

61 files changed

+7033
-353
lines changed

import-automation/executor/app/configs.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ExecutorConfig:
3434

3535
# ID of the Google Cloud project that hosts the executor. The project
3636
# needs to enable App Engine and Cloud Scheduler.
37-
gcp_project_id: str = 'datcom-import-automation'
37+
gcp_project_id: str = 'datcom-import-automation-prod'
3838
# ID of the Google Cloud project that stores generated CSVs and MCFs. The
3939
# project needs to enable Cloud Storage and gives the service account the
4040
# executor uses sufficient permissions to read and write the bucket below.
@@ -55,6 +55,10 @@ class ExecutorConfig:
5555
# Name of the Cloud Storage bucket to store the generated data files
5656
# for importing to dev.
5757
storage_dev_bucket_name: str = 'unresolved_mcf'
58+
# DataCommons API key
59+
dc_api_key: str = ''
60+
# Gemini API key
61+
gemini_api_key: str = ''
5862
# Executor output prefix in the storage_dev_bucket_name bucket.
5963
storage_executor_output_prefix: str = 'datcom-dev-imports'
6064
# Name of the file that specifies the most recently generated data files
@@ -74,6 +78,10 @@ class ExecutorConfig:
7478
# The content of latest_version.txt would be a single line of
7579
# '2020_07_15T12_07_17_365264_07_00'.
7680
storage_version_filename: str = 'latest_version.txt'
81+
# GCP secret name containg import config.
82+
import_config_secret: str = 'import-config'
83+
# Config override file.
84+
config_override_file: str = ''
7785
# File with list of historical versions with the most recent at the top
7886
storage_version_history_filename: str = 'version_history.txt'
7987
# Name of the file that contains the import_metadata_mcf for the import.
@@ -130,7 +138,10 @@ class ExecutorConfig:
130138
# Arguments for the user script
131139
user_script_args: List[str] = ()
132140
# Environment variables for the user script
133-
user_script_env: dict = None
141+
user_script_env: dict = dataclasses.field(default_factory=lambda: {
142+
"EXISTING_STATVAR_MCF":
143+
"gs://unresolved_mcf/scripts/statvar/stat_vars.mcf"
144+
})
134145
# Invoke import tool genmcf.
135146
invoke_import_tool: bool = True
136147
# Invoke differ tool.

import-automation/executor/app/executor/cloud_batch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def create_job_request(import_name: str, import_config: dict, import_spec: dict,
151151

152152
resources["cpu"] = resources["cpu"] * 1000
153153
resources["memory"] = resources["memory"] * 1024
154+
schedule = import_spec.get('cron_schedule')
154155
import_config_string = json.dumps(import_config)
155156
job_name = import_name.split(':')[1]
156157
job_name = job_name.replace("_", "-").lower()
@@ -159,7 +160,8 @@ def create_job_request(import_name: str, import_config: dict, import_spec: dict,
159160
"importName": import_name,
160161
"importConfig": import_config_string,
161162
"resources": resources,
162-
"timeout": timeout
163+
"timeout": timeout,
164+
"schedule": schedule
163165
}
164166
argument_string = json.dumps(argument_payload)
165167
final_payload = {

0 commit comments

Comments
 (0)