This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up script for Composer and support for getting gcsDagLocation fro…
…m Composer environment (#585) * Bash script for setting up Composer * Parameterizing more stuff * Removing commented out commands and adding default values for the parameters * Finishing up the Composer setup script and starting the airflow setup script * Re-organizing some of the comments * Support for fetching gcs dag location from Composer environment * Add verification of bucket name * Minor refactoring, and added comments * Unit-tests for Composer.gcs_dag_location * Add stop-gap contrib imports to enable e2e * Add comments to release script * Remove timeoutMs from call to Composer API; this arg is invalid * Fix flake8 errors * Correct wrong index for shell script arguments * Refactor all gcs_dag_location checks into the property. * Disallow trailing slash in gcs_dag_location from Composer * Allow trailing slash in gcs dag location
- Loading branch information
Showing
9 changed files
with
224 additions
and
30 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
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,15 @@ | ||
#!/usr/bin/env bash | ||
PROJECT=${1:-cloud-ml-dev} | ||
EMAIL=${2:-rajivpb@google.com} | ||
ZONE=${3:-us-central1} | ||
ENVIRONMENT=${3:-rajivpb-airflow} | ||
|
||
gcloud config set project $PROJECT | ||
gcloud config set account $EMAIL | ||
gcloud auth login --activate $EMAIL | ||
|
||
# We use the default cluster spec. | ||
gcloud container clusters create $ENVIRONMENT --zone $ZONE | ||
|
||
# Deploying the airflow container | ||
kubectl run airflow --image=gcr.io/cloud-airflow-releaser/airflow-worker-scheduler-1.8 |
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
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
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,37 @@ | ||
#!/usr/bin/env bash | ||
# We remove the local installation and install a version that allows custom repositories. | ||
sudo apt-get -y remove google-cloud-sdk | ||
|
||
# If an installation still exists after executing apt-get remove, try the following: | ||
# gcloud info --format="value(installation.sdk_root)" | ||
# that'll give you the installation directory of whichever installation gets executed | ||
# you can remove that entire directory | ||
# restart shell, rinse and repeat until gcloud is no longer on your path | ||
# you might have to clean up your PATH in .bashrc and nuke the .config/gcloud directory | ||
|
||
# Hopefully by now the machine is clean, so install gcloud | ||
curl https://sdk.cloud.google.com | CLOUDSDK_CORE_DISABLE_PROMPTS=1 bash | ||
|
||
# Recycling shell to pick up the new gcloud. | ||
exec -l $SHELL | ||
|
||
# These have to be set here and not on the top of the script because we recycle the shell somewhere | ||
# between the start of this script and here. | ||
PROJECT=${1:-cloud-ml-dev} | ||
EMAIL=${2:-rajivpb@google.com} | ||
ZONE=${3:-us-central1} | ||
ENVIRONMENT=${4:-datalab-testing-1} | ||
|
||
gcloud config set project $PROJECT | ||
gcloud config set account $EMAIL | ||
gcloud auth login $EMAIL | ||
|
||
gcloud components repositories add https://storage.googleapis.com/composer-trusted-tester/components-2.json | ||
gcloud components update -q | ||
gcloud components install -q alpha kubectl | ||
|
||
gcloud config set composer/location $ZONE | ||
gcloud alpha composer environments create $ENVIRONMENT | ||
gcloud alpha composer environments describe $ENVIRONMENT | ||
|
||
|
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
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
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
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