Giter Site home page Giter Site logo

scheduler's Introduction

Scheduler

This is a basic client command which will be used to automatically close all events in given time. It will run once in a day then checks events which has expired, then close those events no matter what is happening. There are some important parts to run this auto-cleaner for events:

  1. Specify volume of configuration file
  2. Bound certificates volume to docker image when docker run command takes place

Example Run

Building the image:

  • docker build -t autokiller .

Running the image

In order to run stop command following command should be run :

  • docker run -it --rm -v (path_of_conf_file):/app/conf.yml -v (path_of_certs):/certs autokiller -command stop

In order to run start command following command should be run :

  • docker run -it --rm -v (path_of_conf_file):/app/conf.yml -v (path_of_certs):/certs autokiller -command start

Note: In order to test it on your local environment --network=host should be clarified when grpc_endpoint is localhost.

Cronjob configuration on host side

Will gonna run at 02:00 midnight and stop the events which are expired.

0 2 * * * docker run -it --rm -v (path_of_conf_file):/app/conf.yml -v (path_of_certs):/certs autokiller >> autokiller_logs

Docker container will gonna remove itself when it is done.

Test Functionality

  • In order to test the functionality of this approach, setEnvVariables function should be set correctly
  • According to environment variables which are specified in that function, it will make request to given grpc endpoint.
  • For testing functionality, no need to use TLS for GRPC endpoint, however it can be used as well.

Todo

  • Starting events automatically could be added (useful for booking functionality ...)
  • Github actions for autodeploy and build should be integrated
  • The functionality of this program should be tested on test environment properly

scheduler's People

Contributors

mrtrkmn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.