#61 OpenShift/docsbuilding: add cronjob to separate translated docs build
Merged 3 years ago by nphilipp. Opened 3 years ago by asamalik.
fedora-infra/ asamalik/ansible docs-cronjob-2  into  master

@@ -36,6 +36,13 @@ 

        - deploy-cronjob

    - role: openshift/object

      app: docsbuilding

+     template: cron-translated.yml

+     objectname: cron-translated.yml

+     when: env == "staging"

+     tags:

+       - deploy-cronjob

+   - role: openshift/object

+     app: docsbuilding

      file: pvc.yml

      objectname: pvc.yml

  
@@ -49,3 +56,9 @@ 

      objecttype: cronjob

      objectname: cron

      tags: [ never, delete ]

+   - role: openshift/object-delete

+     app: docsbuilding

+     objecttype: cronjob

+     objectname: cron-translated

+     when: env == "staging"

+     tags: [ never, delete ]

@@ -0,0 +1,32 @@ 

+ apiVersion: batch/v1beta1

+ kind: CronJob

+ metadata:

+   name: cron-translated

+ spec:

+   concurrencyPolicy: Forbid

+   schedule: "0 * * * *"

+   jobTemplate:

+     spec:

+       template:

+         metadata:

+           labels:

+             parent: "cronjobbuild"

+         spec:

+           containers:

+           - name: build-translated

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

+             env:

+             - name: BUILD_ENV

+               value: "{{ env_short }}"

+             - name: BUILD_LANGS

+               value: "translated"

+             volumeMounts:

+             - name: build-output

+               mountPath: /antora/output

+               readOnly: false

+           restartPolicy: Never

+           startingDeadlineSeconds: 600

+           volumes:

+           - name: build-output

+             persistentVolumeClaim:

+               claimName: docs-storage

@@ -13,7 +13,7 @@ 

              parent: "cronjobbuild"

          spec:

            containers:

-           - name: build

+           - name: build-english

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

              env:

              - name: BUILD_ENV

I'd like to separate the Fedora Docs build into two:

  • one for the English content only
  • one for the translated content that takes hours to build (yay, translations coming!)

I've already tweaked the build script to do this based on environment variables. Now I need to have two builders in OpenShift.

This is my first PR in this repo, I hope I've done everything for this to work. :)

1 new commit added

  • opensift docsbuilding add new cron to playbook
3 years ago

1 new commit added

  • opensift docsbuilding translations in stg only now
3 years ago

I have also added it to the playbook so it gets applied, and marked it to be only added on staging now.

Thanks for all the help on #fedora-apps! Let me know if additional tweaks are needed to be done.

Also, can I then run this myself? @cverna helpfully pointed out in one of my earlier tickets I need to run:

sudo rbac-playbook openshift-apps/docsbuilding.yml

... for these changes to apply. I remember doing this in the past, but it's been a while and might need a little help to refresh my memory when exactly to run this. This will help me not opening tickets in the future, but do things myself. :)

Metadata Update from @nphilipp:
- Request assigned

3 years ago

Pull-Request has been merged by nphilipp

3 years ago