Copy from Google Cloud Storage Bucket to S3 Bucket

D_usv

I have set up an airflow workflow that ingests some files from s3 to Google Cloud storage and then runs a workflow of sql queries to create new tables on Big Query. At the end of the workflow I need to push the output of the one final Big Query table to Google Cloud Storage and from there to S3.

I have cracked the the transfer of the Big Query table to Google Cloud Storage with no issues using the BigQueryToCloudStorageOperator python operator. However it seems the transfer from Google Cloud Storage to S3 is a less trodden route and I have been unable to find a solution which I can automate in my Airflow workflow.

I am aware of rsync which comes as part of the gsutil and have gotten this working (see post Exporting data from Google Cloud Storage to Amazon S3) but I am unable to add this into my workflow.

I have a dockerised airflow container running on a compute engine instance.

Would really appreciate help solving this problem.

Many thanks!

Chengzhi

So we are also using rsync to move data between S3 and GCS,

You first need to get a bash script working, something like gsutil -m rsync -d -r gs://bucket/key s3://bucket/key

For s3 you also need to provide AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as environment variable.

Then define your BashOperator and put it in your DAG file

rsync_yesterday = BashOperator(task_id='rsync_task_' + table,
                                bash_command='Your rsync script',
                                dag=dag)

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

How do I setup a public Google Cloud Storage bucket

Moving Google Cloud Storage bucket to another project

Copy content from one S3 bucket to another S3 bucket with different keys

How to retrieve the most recent file in cloud storage bucket?

Can i search Google Cloud Storage Bucket using metadata values?

Google Cloud Functions Bucket.upload()

Google Cloud Storage Bucketは帯域幅に対して課金されますか?

Google Cloud StorageBucketからS3Bucketにコピーします

Serve subfolders from separate S3 bucket

How to copy an S3 bucket onto Kubernetes nodes

Google Cloud Storage bucket throws error "The project to be billed is associated with a closed billing account."

Couchbase: How to copy data from bucket to another?

Allow Google Cloud Compute Engine Instance to write file to Google Storage Bucket - Python

Uploading a Dataframe to AWS S3 Bucket from SageMaker

How to Transfer data from Google cloud storage to S3 without any manual activity?

Add Firebase Storage bucket

Python: Read CSV from S3 bucket with `import csv`

R - How to copy and paste files from one location to another within an s3 bucket (using aws.s3)?

Export data from QlikSense cloud to AWS S3 bucket

Unable to access AWS s3 bucket from Private Google cloud composer

R reactiveFileReader reading from aws s3 bucket

How to create a folder on s3 bucket from python script?

Unable to see access logs in my Google Storage Bucket

How can I execute a command (like copy) for each folder in an Amazon S3 bucket?

uploading to S3 bucket from Codeigniter

Can I change the Google Cloud Storage bucket class after the bucket has been created?

S3のloopback-component-storageでbucket-nameを指定する

How to use boto's s3 bucket.copy_key with KMS SSE?

Struggling to read csv files from Google Cloud Storage bucket

TOP 一覧

  1. 1

    STSでループプロセス「クラスパス通知の送信」のループを停止する方法

  2. 2

    Spring Boot Filter is not getting invoked if remove @component in fitler class

  3. 3

    Python / SciPyのピーク検出アルゴリズム

  4. 4

    セレンのモデルダイアログからテキストを抽出するにはどうすればよいですか?

  5. 5

    tkinterウィンドウを閉じてもPythonプログラムが終了しない

  6. 6

    androidsoongビルドシステムによるネイティブコードカバレッジ

  7. 7

    ZScalerと証明書の問題により、Dockerを使用できません

  8. 8

    VisualStudioコードの特異点/ドッカー画像でPythonインタープリターを使用するにはどうすればよいですか?

  9. 9

    ビュー用にサイズ変更した後の画像の高さと幅を取得する方法

  10. 10

    二次導関数を数値計算するときの大きな誤差

  11. 11

    Ansibleで複数行のシェルスクリプトを実行する方法

  12. 12

    画像変更コードを実行してもボタンの画像が変更されない

  13. 13

    Reactでclsxを使用する方法

  14. 14

    Three.js indexed BufferGeometry vs. InstancedBufferGeometry

  15. 15

    __init__。pyファイルの整理中に循環インポートエラーが発生しました

  16. 16

    PyTesseractを使用した背景色のため、スクリーンショットからテキストを読み取ることができません

  17. 17

    値間の一致を見つける最も簡単な方法は何ですか

  18. 18

    reCAPTCHA-エラーコード:ユーザーの応答を検証するときの「missing-input-response」、「missing-input-secret」(POSTの詳細がない)

  19. 19

    三項演算子良い練習の代わりとしてOptional.ofNullableを使用していますか?

  20. 20

    好き/愛の関係のためのデータベース設計

  21. 21

    エンティティIDを含む@RequestBody属性をSpringの対応するエンティティに変換します

ホットタグ

アーカイブ