-
Notifications
You must be signed in to change notification settings - Fork 714
Document how to use a GCP service account in Airflow with SkyPilot #6291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e3050d7
document how to use a GCP service account in Airflow with SkyPilot
kevinmingtarja 79c7776
revert DATA_BUCKET_STORE_TYPE from gcs to s3
kevinmingtarja ed207b9
remove unused import
kevinmingtarja b9dd08e
Merge branch 'master' into airflow-gcp-service-account-example
kevinmingtarja fe83e97
add missing newline
kevinmingtarja d40cc2b
assign var.value.SKYPILOT_API_SERVER_ENDPOINT to a variable
kevinmingtarja dbc14cc
add a note on airflow task virtual env
kevinmingtarja a84c14d
fix link
kevinmingtarja 59bbb6d
add code snippet for run_sky_task
kevinmingtarja 6bff16a
simplify code snippet
kevinmingtarja 61c3da9
simplify passing in SKYPILOT_API_SERVER_ENDPOINT
kevinmingtarja c4f18c7
fix readme
kevinmingtarja 2012ed4
simplify
kevinmingtarja 836a93f
move import sky inside _run_sky_task
kevinmingtarja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,33 @@ | ||
resources: | ||
kevinmingtarja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cpus: 1+ | ||
|
||
envs: | ||
DATA_BUCKET_NAME: sky-demo-data-test | ||
DATA_BUCKET_STORE_TYPE: s3 | ||
GCP_SERVICE_ACCOUNT_JSON_PATH: null | ||
|
||
file_mounts: | ||
/data: | ||
name: $DATA_BUCKET_NAME | ||
store: $DATA_BUCKET_STORE_TYPE | ||
/tmp/gcp-service-account.json: $GCP_SERVICE_ACCOUNT_JSON_PATH | ||
kevinmingtarja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
setup: | | ||
echo "Setting up dependencies for data preprocessing..." | ||
|
||
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz | ||
tar -xf google-cloud-cli-linux-x86_64.tar.gz | ||
|
||
./google-cloud-sdk/install.sh --quiet --path-update true | ||
source ~/.bashrc | ||
gcloud auth activate-service-account --key-file=/tmp/gcp-service-account.json | ||
|
||
run: | | ||
echo "Running data preprocessing on behalf of $(gcloud auth list --filter=status:ACTIVE --format="value(account)")..." | ||
|
||
# Generate few files with random data to simulate data preprocessing | ||
for i in {0..9}; do | ||
dd if=/dev/urandom of=/data/file_$i bs=1M count=10 | ||
done | ||
|
||
echo "Data preprocessing completed, wrote to $DATA_BUCKET_NAME" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.