-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uploads the setup bash script that installs necessary project requirements and crosschecks necessary API activations
- Loading branch information
1 parent
8dccfcc
commit 6f01d0c
Showing
1 changed file
with
31 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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Enable Vertex AI and BigQuery | ||
gcloud services enable aiplatform.googleapis.com | ||
gcloud services enable bigquery.googleapis.com | ||
|
||
# Copy public dataset | ||
bq mk --force=true --dataset thelook_ecommerce | ||
bq mk \ | ||
--transfer_config \ | ||
--data_source=cross_region_copy \ | ||
--target_dataset=thelook_ecommerce \ | ||
--display_name='SQL Talk Sample Data' \ | ||
--schedule_end_time="$(date -u -d '5 mins' +%Y-%m-%dT%H:%M:%SZ)" \ | ||
--params='{ | ||
"source_project_id":"bigquery-public-data", | ||
"source_dataset_id":"thelook_ecommerce", | ||
"overwrite_destination_table":"true" | ||
}' | ||
|
||
# Install Python | ||
export PYTHON_PREFIX=~/miniforge | ||
curl -Lo ~/miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh | ||
bash ~/miniforge.sh -fbp ${PYTHON_PREFIX} | ||
rm -rf ~/miniforge.sh | ||
|
||
# Install packages | ||
${PYTHON_PREFIX}/bin/pip install -r requirements.txt | ||
|
||
# Run app | ||
${PYTHON_PREFIX}/bin/streamlit run app.py --server.enableCORS=false --server.enableXsrfProtection=false --server.port 8080 |