-
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 The General Index Dataset (#342)
* feat: onboarding early un sdg version * feat: onboarding early un sdg version * feat: Initial checkin. Not production ready. * fix: loads test data into dataframe. Not production ready. * fix: issues with datatypes when loading data. * fix: Tested locally. runs as intended. * fix: Changes to variables in pipeline.yaml preparing for multiple pipelines. * fix: misc changes. not ready for production. * fix: completed loading one file from end-to-end. * fix: expanded pipeline.yaml to include all data files for download and processing * fix: Added deletion of source data if it is being reloaded. * fix: next update * fix: Testing in AF. * fix: Increased number of nodes in cluster in AF to ensure resources are available for running the pipelines. * fix: Resolved download file reference in code. * fix: Fixed delete source data function. * fix: resolved yaml lint issues * fix: black errors * fix: black errors * fix: code fix, production ready * fix: Fixed the bad charecters from data giving loading issues. Production ready
- Loading branch information
Showing
11 changed files
with
3,118 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 |
---|---|---|
@@ -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 | ||
} |
26 changes: 26 additions & 0 deletions
26
datasets/the_general_index/infra/the_general_index_dataset.tf
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,26 @@ | ||
/** | ||
* 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_bigquery_dataset" "the_general_index" { | ||
dataset_id = "the_general_index" | ||
project = var.project_id | ||
description = "Indicators dataset" | ||
} | ||
|
||
output "bigquery_dataset-the_general_index-dataset_id" { | ||
value = google_bigquery_dataset.the_general_index.dataset_id | ||
} |
34 changes: 34 additions & 0 deletions
34
datasets/the_general_index/infra/the_general_index_pipeline.tf
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,34 @@ | ||
/** | ||
* 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_bigquery_table" "the_general_index_the_general_index" { | ||
project = var.project_id | ||
dataset_id = "the_general_index" | ||
table_id = "the_general_index" | ||
description = "The General Index" | ||
depends_on = [ | ||
google_bigquery_dataset.the_general_index | ||
] | ||
} | ||
|
||
output "bigquery_table-the_general_index_the_general_index-table_id" { | ||
value = google_bigquery_table.the_general_index_the_general_index.table_id | ||
} | ||
|
||
output "bigquery_table-the_general_index_the_general_index-id" { | ||
value = google_bigquery_table.the_general_index_the_general_index.id | ||
} |
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" {} | ||
|
21 changes: 21 additions & 0 deletions
21
datasets/the_general_index/pipelines/_images/run_csv_transform_kub/Dockerfile
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,21 @@ | ||
# 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 python:3.8 | ||
ENV PYTHONUNBUFFERED True | ||
COPY requirements.txt ./ | ||
RUN python3 -m pip install --no-cache-dir -r requirements.txt | ||
WORKDIR /custom | ||
COPY ./csv_transform.py . | ||
CMD ["python3", "csv_transform.py"] |
Oops, something went wrong.