#151 review-stats: create a second entrypoint
Merged 3 years ago by cverna. Opened 3 years ago by mattia.
fedora-infra/ mattia/ansible rev_stats_entrypoint  into  master

@@ -7,5 +7,9 @@ 

  username = package-review@lists.fedoraproject.org

  password = {{ packagereviewbugzilla }}

  

+ [review-stats-worker]

+ needinfo_waiting_days = 30

+ not_updated_days = 365

+ 

  [review-stats-logging]

  journal_level = INFO

@@ -1,8 +1,10 @@ 

  apiVersion: batch/v1beta1

  kind: CronJob

  metadata:

-   name: cron

+   name: review-stats-make-html-pages

  spec:

+   successfulJobsHistoryLimit: 3

+   failedJobsHistoryLimit: 1

    concurrencyPolicy: Forbid

    schedule: "0 * * * *"

    jobTemplate:
@@ -19,6 +21,8 @@ 

            containers:

            - name: build

              image: docker-registry.default.svc:5000/review-stats/builder:latest

+             command: ["review-stats", "-c", "/etc/review-stats/config.cfg", "-D",

+                       "make-pages", "-d", "/review-stats/"]

              env:

              - name: HOME

                value: "/tmp"
@@ -37,4 +41,49 @@ 

                name: review-stats-configmap

            - name: build-output

              persistentVolumeClaim:

-               claimName: openshift-{{env_short}}-reviewstats

+               claimName: openshift-{{ env_short }}-reviewstats

+ ---

+ apiVersion: batch/v1beta1

+ kind: CronJob

+ metadata:

+   name: review-stats-work-on-bugs

+ spec:

+   successfulJobsHistoryLimit: 3

+   failedJobsHistoryLimit: 1

+   concurrencyPolicy: Forbid

+   schedule: "45 0 * * *"

+   jobTemplate:

+     spec:

+       template:

+         metadata:

+           labels:

+             parent: "cronjobbuild"

+         spec:

+           hostAliases:

+           - hostnames:

+             - partner-bugzilla.redhat.com

+             ip: 209.132.183.72

+           containers:

+           - name: build

+             image: docker-registry.default.svc:5000/review-stats/builder:latest

+             command: ["review-stats", "-c", "/etc/review-stats/config.cfg", "-D",

+                       "work-on-bugs", "-d"]

+             env:

+             - name: HOME

+               value: "/tmp"

+             volumeMounts:

+             - name: review-stats-config

+               mountPath: /etc/review-stats

+               readOnly: true

+             - name: build-output

+               mountPath: /review-stats

+               readOnly: false

+           restartPolicy: Never

+           startingDeadlineSeconds: 600

+           volumes:

+           - name: review-stats-config

+             configMap:

+               name: review-stats-configmap

+           - name: build-output

+             persistentVolumeClaim:

+               claimName: openshift-{{ env_short }}-reviewstats

Now that review-stats has a second command to operate on bugzilla, I would like to remove the entrypoint from the Dockerfile and
run the two commands from ansible by sharing the same docker image.

It should run the usual html page generation script every hour and the bugzilla script once a day (I've set a dry run, so it will only output debug messages, no real operation is performed on bugs, for the moment).

Signed-off-by: Mattia Verga mattia.verga@protonmail.com

rebased onto ec57a06db0a51e20ba1d12eafb1e3281086e6396

3 years ago

rebased onto 216834ad0b7422346c6c02113b5f9a7ed31cd658

3 years ago

rebased onto 8d87c1a1fcbc5131c4b6494cbc86d47e043a70af

3 years ago

rebased onto d0358e8

3 years ago

rebased onto d0358e8

3 years ago

Pull-Request has been merged by cverna

3 years ago