How to schedule a docker run on google cloud

ARINDAM BANERJEE

There are 3 batches in my project. I have put all 3 batches in a single docker image. Now to run any particular batch I invoke the docker run with command line argument, which is taken into account by a shell script and launches appropriate batch inside the image.

Now to schedule these 3 batches at a different time period, I can use 3 commands for same docker images with proper arguments. But how to deploy (app engine or gke) and from where to fire the command? In cloud scheduler there is only Pub Sub / HTTP Url firing options are available. So not able to find any way out.

Can you suggest ?

Thanks in advance.

Regards,

Arindam

DazWilkin

Your question raises questions but -- first -- why do you wish to employ App Engine or GKE?

IIUC you likely could solve your problem using Kubernetes CronJobs: https://cloud.google.com/kubernetes-engine/docs/how-to/cronjobs

Cloud Scheduler's use of HTTP and Pub/Sub is because this provides the service with a general-purpose way to fire its events. If you wished to pursue Cloud Scheduler, you could develop a companion (aka "sidecar") image that exposes an e.g. HTTP interface and, when invoked, it runs the correct command against your container. You then program Cloud Scheduler to invoke the sidecars on your schedule and they, in turn, invoke your container image. Something similar to this approach is employed in the Cloud Scheduler example here: https://cloud.google.com/scheduler/docs/start-and-stop-compute-engine-instances-on-a-schedule#set_up_the_functions_with

If you don't wish to use Kubernetes, I think the easiest solution would be for you to create a Compute Engine instance that runs your cron schedule and it simply invokes the appropriate docker run commands on your image as needed.

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

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

編集
0

コメントを追加

0

関連記事

分類Dev

How to run docker in docker in Container-optimized OS on Compute Engine VM on Google Cloud?

分類Dev

easiest way to schedule a Google Cloud Dataflow job

分類Dev

How to run a job in openshift to schedule a particular script?

分類Dev

Wix How to schedule the XmlConfig run after ConfigureIIs?

分類Dev

How to run C++ files on the Google Cloud Functions?

分類Dev

How to run dynamic second query in google cloud dataflow?

分類Dev

How to use a Google Secret in a deployed Cloud Run Service (managed)?

分類Dev

Google Cloud Run Container Networking

分類Dev

How to schedule Google Data Fusion pipeline?

分類Dev

google-cloud-run quarkus Keyloack

分類Dev

How can I see request count (not rate) for a Google Cloud Run application?

分類Dev

How do I list images (tags) in a remote Google Cloud docker repo?

分類Dev

Docker and Gitlab - how to modify the docker run

分類Dev

Google Cloud Run / Google StorageBucketのマウント

分類Dev

docker not found with docker:dind + google/cloud-sdk

分類Dev

Google Cloud How to get authorization?

分類Dev

404 error with custom domain for Google Cloud Run service

分類Dev

Python are not able to find files on google cloud run in production

分類Dev

Trying to run a BigQuery example with google cloud, but getting issues

分類Dev

Connecting 2 Services on Google Cloud Run (gRPC/Python)

分類Dev

Run a tensorflow code in distributed mode on google cloud ML

分類Dev

How do you delay and schedule a stage to only run the latest build in an Azure Devops yaml pipeline?

分類Dev

how can I schedule a custom script to run whenever I restart a service

分類Dev

How to run a cron job inside a docker container?

分類Dev

How to run 2 commands with docker exec

分類Dev

How to run symfony via docker-composer

分類Dev

How to run docker containers in their network with an external gateway?

分類Dev

How to run Tensorboard and jupyter concurrently with docker?

分類Dev

how to start postgres prior to run docker

Related 関連記事

  1. 1

    How to run docker in docker in Container-optimized OS on Compute Engine VM on Google Cloud?

  2. 2

    easiest way to schedule a Google Cloud Dataflow job

  3. 3

    How to run a job in openshift to schedule a particular script?

  4. 4

    Wix How to schedule the XmlConfig run after ConfigureIIs?

  5. 5

    How to run C++ files on the Google Cloud Functions?

  6. 6

    How to run dynamic second query in google cloud dataflow?

  7. 7

    How to use a Google Secret in a deployed Cloud Run Service (managed)?

  8. 8

    Google Cloud Run Container Networking

  9. 9

    How to schedule Google Data Fusion pipeline?

  10. 10

    google-cloud-run quarkus Keyloack

  11. 11

    How can I see request count (not rate) for a Google Cloud Run application?

  12. 12

    How do I list images (tags) in a remote Google Cloud docker repo?

  13. 13

    Docker and Gitlab - how to modify the docker run

  14. 14

    Google Cloud Run / Google StorageBucketのマウント

  15. 15

    docker not found with docker:dind + google/cloud-sdk

  16. 16

    Google Cloud How to get authorization?

  17. 17

    404 error with custom domain for Google Cloud Run service

  18. 18

    Python are not able to find files on google cloud run in production

  19. 19

    Trying to run a BigQuery example with google cloud, but getting issues

  20. 20

    Connecting 2 Services on Google Cloud Run (gRPC/Python)

  21. 21

    Run a tensorflow code in distributed mode on google cloud ML

  22. 22

    How do you delay and schedule a stage to only run the latest build in an Azure Devops yaml pipeline?

  23. 23

    how can I schedule a custom script to run whenever I restart a service

  24. 24

    How to run a cron job inside a docker container?

  25. 25

    How to run 2 commands with docker exec

  26. 26

    How to run symfony via docker-composer

  27. 27

    How to run docker containers in their network with an external gateway?

  28. 28

    How to run Tensorboard and jupyter concurrently with docker?

  29. 29

    how to start postgres prior to run docker

ホットタグ

アーカイブ