-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Onboard MLCommons Multilingual Spoken Words Corpus (MSWC) datas…
…et (#252) * cleanup: Ignores temporary folders * feat: Adds MLCommons MSWC YAML config * feat: Adds generated files for MLC MSWC
- Loading branch information
1 parent
48c96f2
commit ec93997
Showing
7 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,6 @@ tmp | |
/datasets/**/Pipfile | ||
/datasets/**/*.json | ||
/datasets/**/*.tfvars | ||
|
||
# ignore temp folders | ||
.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
resource "google_storage_bucket" "mswc" { | ||
name = "${var.bucket_name_prefix}-mswc" | ||
force_destroy = true | ||
location = "US" | ||
uniform_bucket_level_access = true | ||
lifecycle { | ||
ignore_changes = [ | ||
logging, | ||
] | ||
} | ||
} | ||
|
||
output "storage_bucket-mswc-name" { | ||
value = google_storage_bucket.mswc.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
provider "google" { | ||
project = var.project_id | ||
impersonate_service_account = var.impersonating_acct | ||
region = var.region | ||
} | ||
|
||
data "google_client_openid_userinfo" "me" {} | ||
|
||
output "impersonating-account" { | ||
value = data.google_client_openid_userinfo.me.email | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
variable "project_id" {} | ||
variable "bucket_name_prefix" {} | ||
variable "impersonating_acct" {} | ||
variable "region" {} | ||
variable "env" {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
dataset: | ||
name: mlcommons | ||
friendly_name: ~ | ||
description: ~ | ||
dataset_sources: ~ | ||
terms_of_use: ~ | ||
|
||
|
||
resources: | ||
|
||
- type: storage_bucket | ||
name: "mswc" | ||
uniform_bucket_level_access: True | ||
location: US |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
from airflow import DAG | ||
from airflow.providers.google.cloud.operators import cloud_storage_transfer_service | ||
|
||
default_args = { | ||
"owner": "Google", | ||
"depends_on_past": False, | ||
"start_date": "2021-12-01", | ||
} | ||
|
||
|
||
with DAG( | ||
dag_id="mlcommons.mswc", | ||
default_args=default_args, | ||
max_active_runs=1, | ||
schedule_interval="@monthly", | ||
catchup=False, | ||
default_view="graph", | ||
) as dag: | ||
|
||
# Task to run a GCS to GCS operation using Google resources | ||
copy_gcs_bucket = ( | ||
cloud_storage_transfer_service.CloudDataTransferServiceGCSToGCSOperator( | ||
task_id="copy_gcs_bucket", | ||
timeout=43200, | ||
retries=0, | ||
wait=True, | ||
project_id="bigquery-public-data", | ||
source_bucket="{{ var.json.mlcommons.mswc.source_bucket }}", | ||
destination_bucket="{{ var.json.mlcommons.mswc.destination_bucket}}", | ||
google_impersonation_chain="{{ var.json.mlcommons.mswc.service_account }}", | ||
) | ||
) | ||
|
||
copy_gcs_bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
|
||
resources: ~ | ||
|
||
dag: | ||
airflow_version: 2 | ||
initialize: | ||
dag_id: mswc | ||
default_args: | ||
owner: "Google" | ||
depends_on_past: False | ||
start_date: '2021-12-01' | ||
max_active_runs: 1 | ||
schedule_interval: "@monthly" | ||
catchup: False | ||
default_view: graph | ||
|
||
tasks: | ||
- operator: "CloudDataTransferServiceGCSToGCSOperator" | ||
description: "Task to run a GCS to GCS operation using Google resources" | ||
args: | ||
task_id: copy_gcs_bucket | ||
timeout: 43200 # 12 hours | ||
retries: 0 | ||
wait: True | ||
project_id: bigquery-public-data | ||
source_bucket: "{{ var.json.mlcommons.mswc.source_bucket }}" | ||
destination_bucket: "{{ var.json.mlcommons.mswc.destination_bucket}}" | ||
google_impersonation_chain: "{{ var.json.mlcommons.mswc.service_account }}" | ||
|
||
graph_paths: | ||
- "copy_gcs_bucket" |