Skip to content

Commit

Permalink
Merge branch 'terraform' of https://github.com/kmoscoe/website into t…
Browse files Browse the repository at this point in the history
…erraform
  • Loading branch information
kmoscoe committed Dec 19, 2024
2 parents 16c02fc + 179fd64 commit c7290d5
Show file tree
Hide file tree
Showing 175 changed files with 4,922 additions and 2,188 deletions.
11 changes: 11 additions & 0 deletions build/ci/cloudbuild.py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@

# Run Python tests, lint, etc.
steps:
# Download the files needed for nl embeddings tests.
- id: download_nl_files
name: python:3.11.3
entrypoint: /bin/sh
args:
- -c
- |
cd tools/nl/download_nl_files
./run.sh
- id: flask_test
name: python:3.11.3
entrypoint: /bin/sh
waitFor: ["download_nl_files"]
args:
- -c
- |
Expand Down
6 changes: 6 additions & 0 deletions deploy/terraform-custom-datacommons/modules/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ locals {
# Data Commons API protocol
dc_api_protocol = "https"

# Data Commons API hostname
dc_api_hostname = "api.datacommons.org"

# Data Commons API protocol
dc_api_protocol = "https"

# Data Commons API root url
dc_api_root = "${local.dc_api_protocol}://${local.dc_api_hostname}"

Expand Down
2 changes: 1 addition & 1 deletion deploy/terraform-custom-datacommons/modules/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ variable "dc_gcs_data_bucket_path_override" {
}

variable "dc_gcs_data_bucket_location" {
description = "Data Commons data bucket GCS location"
description = "Data Commons GCS data bucket location"
type = string
default = "US"
}
Expand Down
2 changes: 1 addition & 1 deletion mixer
Submodule mixer updated 98 files
+12 −12 deploy/storage/base_bigtable_info.yaml
+1 −1 deploy/storage/bigquery.version
+2 −2 internal/server/place/golden/get_related_locations/county.json
+0 −9 internal/server/recon/golden/recognize_entities/result.json
+0 −5 internal/server/recon/golden/resolve_coordinates/result.json
+22 −6 internal/server/spanner/datasource.go
+53,070 −0 internal/server/spanner/golden/query/get_observations_contained_in.json
+18 −4 internal/server/spanner/golden/query_test.go
+81 −0 internal/server/spanner/query.go
+2 −1 internal/server/stat/golden/get_stat_all/branch.json
+86 −0 internal/server/stat/golden/get_stat_all/result.json
+86 −0 internal/server/stat/golden/get_stat_date_within_place/USA_State.json
+20 −20 internal/server/statvar/golden/search_statvar/count_person.json
+0 −17 internal/server/v0/placestatvar/golden/get_place_stat_vars/alb.json
+0 −7 internal/server/v0/placestatvar/golden/get_place_stat_vars/california.json
+0 −11 internal/server/v0/placestatvar/golden/get_place_stat_vars/santa_clara.json
+1 −1 internal/server/v0/statpoint/golden/get_stat_value/umemployed.json
+1 −1 internal/server/v0/triple/golden/get_triples/limit1.json
+0 −14 internal/server/v0/triple/golden/get_triples/place.json
+405 −0 internal/server/v0/triple/golden/get_triples/place_type.json
+1 −981 internal/server/v1/event/golden/event_collection/EarthquakeEvent_CA_202001.json
+1 −36,473 internal/server/v1/event/golden/event_collection/EarthquakeEvent_Earth_202001.json
+1 −293 internal/server/v1/event/golden/event_collection/FireEvent_CA_202210.json
+1 −1,195 internal/server/v1/event/golden/event_collection_date/EarthquakeEvent_CA.json
+1 −1,414 internal/server/v1/event/golden/event_collection_date/EarthquakeEvent_Earth.json
+336 −5 internal/server/v1/info/golden/bulk_variable_info/bulk_bt_and_sql.json
+336 −5 internal/server/v1/info/golden/bulk_variable_info/bulk_result.json
+13 −4 internal/server/v1/info/golden/variable_group_info/demographics.json
+8 −0 internal/server/v1/info/golden/variable_group_info/demographics_gbr.json
+5 −5 internal/server/v1/info/golden/variable_group_info/root.json
+270 −0 internal/server/v1/observationdates/golden/observation_dates_linked/USA_State.json
+21 −0 internal/server/v1/observations/golden/bulk_point/all_2010.json
+25 −4 internal/server/v1/observations/golden/bulk_point/all_latest.json
+10 −4 internal/server/v1/observations/golden/bulk_point/preferred_latest.json
+260 −4 internal/server/v1/observations/golden/bulk_point_linked/all_Country.json
+51 −0 internal/server/v1/observations/golden/bulk_point_linked/all_FRA_AA2_2016.json
+261 −0 internal/server/v1/observations/golden/bulk_point_linked/all_US_State.json
+6 −0 internal/server/v1/observations/golden/bulk_point_linked/preferred_Country.json
+6 −0 internal/server/v1/observations/golden/bulk_point_linked/preferred_FRA_AA2_2016.json
+6 −0 internal/server/v1/observations/golden/bulk_point_linked/preferred_US_State.json
+438 −1 internal/server/v1/observations/golden/bulk_series/all_result.json
+9 −1 internal/server/v1/observations/golden/bulk_series/preferred_result.json
+1,676 −437 internal/server/v1/observations/golden/bulk_series_linked/all_FRA_AA2_2016.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Crime.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Demographics.json
+11 −7 internal/server/v1/page/golden/place_page/asm.Economics.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Education.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Energy.json
+0 −267 internal/server/v1/page/golden/place_page/asm.Environment.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Equity.json
+4 −3 internal/server/v1/page/golden/place_page/asm.Health.json
+0 −1 internal/server/v1/page/golden/place_page/asm.Housing.json
+15 −9 internal/server/v1/page/golden/place_page/asm.Overview.json
+12 −5 internal/server/v1/page/golden/place_page/ca.Economics.json
+0 −124 internal/server/v1/page/golden/place_page/ca.Environment.json
+12 −5 internal/server/v1/page/golden/place_page/ca.Overview.json
+12 −6 internal/server/v1/page/golden/place_page/county.Overview.json
+1 −4,385 internal/server/v1/propertyvalues/golden/bulk_property_values_in/containedIn1.json
+1 −377 internal/server/v1/propertyvalues/golden/bulk_property_values_in/containedIn2.json
+253 −0 internal/server/v1/propertyvalues/golden/bulk_property_values_in/typeOf.json
+1 −4,001 internal/server/v1/propertyvalues/golden/property_values_in/containedIn1.json
+1 −377 internal/server/v1/propertyvalues/golden/property_values_in/containedIn2.json
+2 −4,008 internal/server/v1/triples/golden/bulk_triples_in/result1.json
+2 −4,008 internal/server/v1/triples/golden/bulk_triples_in/result2.json
+1 −4,009 internal/server/v1/triples/golden/triples_in/BiologicalSpecimen1.json
+1 −4,009 internal/server/v1/triples/golden/triples_in/BiologicalSpecimen2.json
+0 −14 internal/server/v1/variables/golden/bulk_variables/california.json
+0 −14 internal/server/v1/variables/golden/bulk_variables/california_and_santa_clara_union.json
+0 −17 internal/server/v1/variables/golden/variables/alb.json
+1 −981 internal/server/v2/event/golden/event_collection/EarthquakeEvent_CA_202001.json
+1 −36,473 internal/server/v2/event/golden/event_collection/EarthquakeEvent_Earth_202001.json
+1 −293 internal/server/v2/event/golden/event_collection/FireEvent_CA_202210.json
+1 −1,195 internal/server/v2/event/golden/event_collection_date/EarthquakeEvent_CA.json
+1 −1,414 internal/server/v2/event/golden/event_collection_date/EarthquakeEvent_Earth.json
+9 −0 internal/server/v2/facet/golden/contained_in_facet/IND_AA1.json
+9 −0 internal/server/v2/facet/golden/contained_in_facet/US_State.json
+9 −0 internal/server/v2/facet/golden/contained_in_facet/country.json
+18 −0 internal/server/v2/facet/golden/series_facet/series_facet.json
+87 −0 internal/server/v2/observation/golden/contained_in_2015/FRA_AA2.json
+1,761 −495 internal/server/v2/observation/golden/contained_in_all/FRA_AA2.json
+459 −3 internal/server/v2/observation/golden/contained_in_latest/Country.json
+42 −0 internal/server/v2/observation/golden/direct/2010.json
+42 −0 internal/server/v2/observation/golden/direct/2015.json
+451 −5 internal/server/v2/observation/golden/direct/all.json
+18 −0 internal/server/v2/observation/golden/direct/filter.json
+50 −8 internal/server/v2/observation/golden/direct/latest.json
+18 −0 internal/server/v2/observation/golden/direct/multi_filter.json
+1 −4,001 internal/server/v2/propertyvalues/golden/simple/containedIn1.json
+1 −377 internal/server/v2/propertyvalues/golden/simple/containedIn2.json
+2 −4,009 internal/server/v2/propertyvalues/golden/triple_in/result1.json
+2 −4,009 internal/server/v2/propertyvalues/golden/triple_in/result2.json
+12 −0 internal/server/v3/observation/golden/observation_test.go
+6,025 −0 internal/server/v3/observation/golden/observations_contained_in.json
+50 −0 scripts/update_prod_tag.sh
+7 −0 test/statvar_ranking/missing_Earth_country_rankings.json
+7 −0 test/statvar_ranking/missing_USA_city_rankings.json
+7 −0 test/statvar_ranking/missing_USA_county_rankings.json
+7 −0 test/statvar_ranking/missing_USA_state_rankings.json
16 changes: 15 additions & 1 deletion run_website_sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,22 @@ set -e

# DC Instance domain like: "dev.datacommons.org", "datacommons.org"
domain=$1
# Check if the domain is set
if [[ -z "$domain" ]]; then
echo "Error: Domain is not set."
echo "Usage: $0 <domain> [NO_PIP]"
echo "Example: $0 autopush.datacommons.org"
exit 1
fi

# Prepend https:// if no protocol is specified
if [[ ! "$domain" =~ ^http:// && ! "$domain" =~ ^https:// ]]; then
domain="https://$domain"
fi

echo "Domain: $domain"

# Set to true if you don't want to install the dependencies
NO_PIP=$2

export FLASK_ENV=webdriver
Expand All @@ -32,6 +46,6 @@ if [[ $NO_PIP != "true" ]]; then
fi

date_str=$(TZ="America/Los_Angeles" date +"%Y_%m_%d_%H_%M_%S")
python3 server/webdriver/tests/standalone/sanity.py --mode=home --url="https://$domain"
python3 server/webdriver/tests/standalone/sanity.py --mode=home --url="$domain"
gsutil cp ./output/*.csv gs://datcom-website-sanity/$domain/$date_str/
rm ./output/*.csv
12 changes: 6 additions & 6 deletions server/config/home_page/partners.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"id": "unSdg",
"title": "United Nations Sustainable Development Goals",
"sprite-index": 5,
"url": "https://unstats.un.org/UNSDWebsite/undatacommons/sdgs"
},
{
"id": "techsoup",
"title": "TechSoup",
Expand Down Expand Up @@ -28,11 +34,5 @@
"title": "Stanford University",
"sprite-index": 4,
"url": "https://datacommons.stanford.edu"
},
{
"id": "unSdg",
"title": "United Nations Sustainable Development Goals",
"sprite-index": 5,
"url": "https://unstats.un.org/UNSDWebsite/undatacommons/sdgs"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -627,18 +627,40 @@
{
"tiles": [
{
"barTileSpec": {
"maxPlaces": 15,
"maxVariables": 15,
"sort": "DESCENDING"
},
"comparisonPlaces": [
"country/USA"
],
"statVarKey": [
"Amount_EconomicActivity_GrossDomesticProduction_RealValue",
"Amount_EconomicActivity_GrossValueAdded_RealValue"
"Amount_EconomicActivity_GrossDomesticProduction_NAICSConstruction_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSAccommodationFoodServices_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSAdministrativeSupportWasteManagementRemediationServices_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSAgricultureForestryFishingHunting_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSArtsEntertainmentRecreation_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSEducationalServices_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSFinanceInsurance_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSHealthCareSocialAssistance_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSInformation_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSManagementOfCompaniesEnterprises_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSMiningQuarryingOilGasExtraction_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSOtherServices_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSProfessionalScientificTechnicalServices_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSRealEstateRentalLeasing_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSRetailTrade_RealValue_multiple_place_bar_block",
"Amount_EconomicActivity_GrossDomesticProduction_NAICSTransportationWarehousing_RealValue_multiple_place_bar_block"
],
"title": "GDP (Real Value) and Amount of Economic Activity (Real Value): Gross Value Added in United States",
"type": "LINE"
"title": "GDP of the Construction Industry and More in United States (${date})",
"type": "BAR"
}
]
}
],
"denom": "Count_Person",
"title": "Related: GDP (Real Value) and Amount of Economic Activity (Real Value): Gross Value Added"
"title": "Related: GDP of the Construction Industry and More"
}
],
"statVarSpec": {
Expand Down Expand Up @@ -698,6 +720,14 @@
"name": "GDP of the Real Estate and Rental and Leasing Industry",
"statVar": "Amount_EconomicActivity_GrossDomesticProduction_NAICSRealEstateRentalLeasing_RealValue"
},
"Amount_EconomicActivity_GrossDomesticProduction_NAICSRetailTrade_RealValue_multiple_place_bar_block": {
"name": "Amount of Economic Activity (Real Value): Gross Domestic Production, Retail Trade (NAICS/44-45)",
"statVar": "Amount_EconomicActivity_GrossDomesticProduction_NAICSRetailTrade_RealValue"
},
"Amount_EconomicActivity_GrossDomesticProduction_NAICSTransportationWarehousing_RealValue_multiple_place_bar_block": {
"name": "Amount of Economic Activity (Real Value): Gross Domestic Production, Transportation And Warehousing (NAICS/48-49)",
"statVar": "Amount_EconomicActivity_GrossDomesticProduction_NAICSTransportationWarehousing_RealValue"
},
"Amount_EconomicActivity_GrossDomesticProduction_NAICSUtilities_RealValue_multiple_place_bar_block": {
"name": "GDP of the Utilities Industry",
"statVar": "Amount_EconomicActivity_GrossDomesticProduction_NAICSUtilities_RealValue"
Expand All @@ -718,10 +748,6 @@
"name": "GDP (Real Value)",
"statVar": "Amount_EconomicActivity_GrossDomesticProduction_RealValue"
},
"Amount_EconomicActivity_GrossValueAdded_RealValue": {
"name": "Amount of Economic Activity (Real Value): Gross Value Added",
"statVar": "Amount_EconomicActivity_GrossValueAdded_RealValue"
},
"Area_Farm": {
"name": "Total Farm Area",
"statVar": "Area_Farm"
Expand Down Expand Up @@ -1210,17 +1236,6 @@
"Amount_EconomicActivity_GrossDomesticProduction_NAICSWholesaleTrade_RealValue"
]
},
"Amount_EconomicActivity_GrossValueAdded_RealValue": {
"isic": [
"Amount_EconomicActivity_GrossValueAdded_ISICAgricultureHuntingForestryFishing_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICConstruction_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICManufacturing_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICMiningManufacturingUtilities_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICOtherActivities_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICTransportStorageCommunications_RealValue",
"Amount_EconomicActivity_GrossValueAdded_ISICWholesaleRetailTradeRestaurantsHotels_RealValue"
]
},
"dc/1wf1h5esex2d": {
"establishmentOwnership": [
"dc/n1mgflew2xqm8",
Expand Down
Loading

0 comments on commit c7290d5

Please sign in to comment.