openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

FR: Post-build Actions - Scale Development #38

Closed livelace closed 8 years ago

livelace commented 8 years ago

Hello.

Current workflow:

  1. "job-run" - scale development to 1, do something, call "job-down" in any situation (exit 0/1).
  2. "job-down" - scale development to 0, do something.

Why we can't do this in one job, steps:

  1. Scale development to 1
  2. Execute a shell script, which return status of execution on step 1
  3. Scale development to 0

If error will appear on step 2 (exit 1), the step 3 will not be executed and all deployments will stay in working state.

Therefore we should write and maintain two jobs (up/down) instead of one. From this arise problems for batch execution of many of jobs ("job-run" tasks stayed alive until will not be executed "job-down" tasks).

We need post-build action - "scale development".

gabemontero commented 8 years ago

Yeah, I could see having both a build step and post-build action version of oc scale (where today we just have the build step.

@bparees FYI

bparees commented 8 years ago

yeah sounds reasonable. In the meantime of course you can do a post-build shell script step that invokes oc to scale the deployment down, to avoid having a second job, right?

gabemontero commented 8 years ago

Correct @bparees re: post build shell script invoking oc scale

On Tue, May 17, 2016 at 10:40 AM, Ben Parees notifications@github.com wrote:

yeah sounds reasonable. In the meantime of course you can do a post-build shell script step that invokes oc to scale the deployment down, to avoid having a second job, right?

— You are receiving this because you were assigned. Reply to this email directly or view it on GitHub https://github.com/openshift/jenkins-plugin/issues/38#issuecomment-219739035

livelace commented 8 years ago

yeah sounds reasonable. In the meantime of course you can do a post-build shell script step that invokes oc to scale the deployment down, to avoid having a second job, right?

Jenkins is working on other host and assemble hack with remote "oc scale" ... authentication with superadmin/cluster-admin rights ... I think we will wait post-build steps, because double jobs already created and extra manipulation not needed.

livelace commented 8 years ago

It's more complicated than just "oc scale", because in addition we should verify ( "Verify whether the specified number of replicas are up", oc scale --replicas=0) that deployment completely stopped and after that do something with a data, which was appeared after work of deployment.

livelace commented 8 years ago

up

gabemontero commented 8 years ago

Yeah, this could be a fairly quick one. Things are shaping up that I'll have some cycles for this one in the next day or two.

livelace commented 8 years ago

@gabemontero Big thanks! Just it is last part before we will add bulk of tasks.

gabemontero commented 8 years ago

@livelace - this pre-release version should contain this commit, which introduces the "Scale OpenShift Deployments" post build action.

Closing this out.