Skip to content
Snippets Groups Projects

Add helm charts for cluster tasks and run tasks with a job

Merged Dimitra Chatzichrysou requested to merge run-task-with-a-job into master

The task:

  • gets info about the drupal site
  • creates the job for running the script
  • monitors if the status of the job
  • waits for the job to succeed or fail
  • prints the final status of the job
  • prints the logs of the job

Logs of the taskrun pod:

image

Refers to:

Edited by Dimitra Chatzichrysou

Merge request reports

Merge request pipeline #2781808 skipped

Merge request pipeline skipped for 6a082a06

Merged by Konstantinos Samaras-TsakirisKonstantinos Samaras-Tsakiris 3 years ago (Jul 5, 2021 2:55pm UTC)

Loading

Pipeline #2791372 passed

Pipeline passed for d3ceac48 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Dimitra Chatzichrysou changed the description

    changed the description

  • added 1 commit

    • fb1f0c9a - Mount job template configmap using a workspace

    Compare with previous version

  • 22 24 echo "Drupal site name: $(params.drupalSite)"
    23 25 deploymentPod=$(oc get pods -n $(params.namespace) -l drupalSite=$(params.drupalSite) -l app=drupal -o custom-columns=POD:.metadata.name --no-headers)
    24 26 echo "Deployment pod: $deploymentPod"
    25 oc exec $deploymentPod -c php-fpm drush cr
    27 export TASK=clear-cache
    28 export DRUPALSITE=$(params.drupalSite)
    29 export NAMESPACE=$(params.namespace)
    30 envsubst < $(workspaces.job.path)/job-operations-template.yaml | oc create -n $(params.namespace) -f -
    31 oc wait --for=condition=complete job/$TASK-$(params.drupalSite) & completion_pid=$!
    32 oc wait --for=condition=failed job/$TASK-$(params.drupalSite) & failure_pid=$!
    33 wait -n $completion_pid $failure_pid
    34 jobStatus=$(oc get job/$TASK-$(params.drupalSite) -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
    35 echo "Job status: $jobStatus"
    36 jobPod=$(oc get pods -n $(params.namespace) -l job-name=$TASK-$(params.drupalSite) -o custom-columns=POD:.metadata.name --no-headers)
    37 echo "Job pod: $jobPod"
    38 echo "Job logs:"
  • added 7 commits

    • fb1f0c9a...494acc84 - 2 commits from branch master
    • ede89475 - Fix typo and make files executable
    • 16e0e833 - Add rules for batch api group
    • 1e675095 - Use a job for running the clear-cache task
    • 1696440e - Mount job template configmap using a workspace
    • d4202fa4 - Update configmap, role and image for clear-cache task

    Compare with previous version

  • added 12 commits

    • d4202fa4...aece0655 - 6 commits from branch master
    • 9ee5e058 - Add rules for batch api group
    • eaf39abd - Use a job for running the clear-cache task
    • 5810a6db - Mount job template configmap using a workspace
    • b724a44f - Update configmap, role and image for clear-cache task
    • 3274491a - Delete roles
    • 9de3acdd - Update script for clear-cache cluster task

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • b519f85f - Pass arguments if needed to script

    Compare with previous version

  • Dimitra Chatzichrysou marked this merge request as ready

    marked this merge request as ready

  • Dimitra Chatzichrysou changed the description

    changed the description

  • added 2 commits

    • b02463d7 - Use generateName in TaskRuns
    • 39408258 - Move cluster tasks to helm chart

    Compare with previous version

  • Dimitra Chatzichrysou changed title from Run tasks with a job to Add helm charts for cluster tasks and run tasks with a job

    changed title from Run tasks with a job to Add helm charts for cluster tasks and run tasks with a job

  • Dimitra Chatzichrysou changed the description

    changed the description

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading