Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Set up script for Composer and support for getting gcsDagLocation from Composer environment #585

Merged
merged 21 commits into from
Nov 10, 2017
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions google/datalab/contrib/pipeline/composer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ZONE=us-central1
PROJECT=$1
EMAIL=$2
ZONE=$3
ENVIRONMENT=$4


gcloud config set project $PROJECT
gcloud auth login --activate $EMAIL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--activate is the default

Is this setup.sh only ever run manually? (Asking because users shouldn't gcloud auth login on a VM.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, setup.sh is only ever run manually on a local machine at the moment. It's not for the VM scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Removed --activate)

sudo gcloud components repositories add https://storage.googleapis.com/composer-trusted-tester/components-2.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First thing is to install composer specific gcloud and it may vary slightly depending on the environment (e.g., VM, shell, local) before any gcloud * operations.


#gcloud components update -q
sudo apt-get update
sudo apt-get --only-upgrade install kubectl google-cloud-sdk google-cloud-sdk-datastore-emulator \
google-cloud-sdk-pubsub-emulator google-cloud-sdk-app-engine-go google-cloud-sdk-app-engine-java \
google-cloud-sdk-app-engine-python google-cloud-sdk-cbt google-cloud-sdk-bigtable-emulator \
google-cloud-sdk-datalab

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put apt-get first, and then composer gcloud installation, and finally composer related configs and environment creation.


#gcloud components install -q alpha kubectl
sudo apt-get install google-cloud-sdk kubectl

gcloud config set composer/location $ZONE
gcloud alpha composer environments create $ENVIRONMENT
gcloud alpha composer environments describe $ENVIRONMENT