Skip to content

Commit 44d78e0

Browse files
authored
Merge branch 'datacommonsorg:master' into brazil_rural
2 parents 4b3a841 + 822c6ec commit 44d78e0

250 files changed

Lines changed: 105045 additions & 1658 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.

import-automation/executor/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ libasound2 \
3333
fonts-liberation \
3434
xdg-utils \
3535
chromium \
36-
chromium-driver
37-
36+
chromium-driver \
37+
p7zip-full
3838
# Install the Google Cloud CLI
3939
RUN apt-get update && \
4040
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \

import-automation/executor/app/configs.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ExecutorConfig:
122122
# Cloud workflow id.
123123
cloud_workflow_id: str = 'import-automation-workflow'
124124
# Maximum time a user script can run for in seconds.
125-
user_script_timeout: float = 36000
125+
user_script_timeout: float = 86400
126126
# Arguments for the user script
127127
user_script_args: List[str] = ()
128128
# Environment variables for the user script
@@ -165,17 +165,7 @@ class ExecutorConfig:
165165

166166
def get_data_refresh_config(self):
167167
"""Returns the config used for Cloud Scheduler data refresh jobs."""
168-
fields = set([
169-
'github_repo_name', 'github_repo_owner_username',
170-
'github_auth_username', 'github_auth_access_token',
171-
'dashboard_oauth_client_id', 'importer_oauth_client_id',
172-
'email_account', 'email_token', 'gcs_project_id',
173-
'storage_prod_bucket_name', 'user_script_args', 'user_script_env',
174-
'user_script_timeout'
175-
])
176-
return {
177-
k: v for k, v in dataclasses.asdict(self).items() if k in fields
178-
}
168+
return {k: v for k, v in dataclasses.asdict(self).items()}
179169

180170

181171
def _setup_logging():

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def get_gce_instance(required_cpu: float,
138138

139139

140140
def create_job_request(import_name: str, import_config: dict, import_spec: dict,
141-
default_resources: dict) -> str:
141+
default_resources: dict, timeout: int) -> str:
142142
resources = import_spec.get('resource_limits', default_resources)
143143
machine_type = get_gce_instance(resources['cpu'], resources['memory'])
144144

@@ -154,7 +154,8 @@ def create_job_request(import_name: str, import_config: dict, import_spec: dict,
154154
"jobName": job_name,
155155
"importName": import_name,
156156
"importConfig": import_config_string,
157-
"resources": resources
157+
"resources": resources,
158+
"timeout": timeout
158159
}
159160
argument_string = json.dumps(argument_payload)
160161
final_payload = {

0 commit comments

Comments
 (0)