Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lacks falc job delete #5

Open
seamusabshere opened this issue Apr 5, 2019 · 5 comments
Open

lacks falc job delete #5

seamusabshere opened this issue Apr 5, 2019 · 5 comments
Labels
faraday Requested by Faraday

Comments

@seamusabshere
Copy link
Member

all you have to do is

  1. delete the k8s job
  2. set status=deleted in the jobs table
@seamusabshere
Copy link
Member Author

@emk

@emk
Copy link
Contributor

emk commented Apr 18, 2019

Yup, I saw this!

I'm not sure if we actually want "delete" or "cancel" semantics—I need to think a bit about the use cases here, and what produces desirable behavior.

@seamusabshere
Copy link
Member Author

ah, you want stop instead of delete?

@emk
Copy link
Contributor

emk commented Apr 18, 2019

Yeah, I'm not sure exactly what the most convenient design might be yet. For example, if a job is failing, it might be nice to cancel it but preserve enough debug info to investigate.

@emk emk added the faraday Requested by Faraday label Jan 26, 2020
@seamusabshere
Copy link
Member Author

here's what i do when a job dies unceremoniously and i need to get it ready for a retry:

kubectl job delete X
ruby cancel_job.rb X

cancel_job.rb:

require 'sequel'

db = Sequel.connect(`falconeri db url`.chomp)
db.transaction do
  sql = <<-SQL
    UPDATE
      datums
    SET
      status = 'error'
    WHERE
          status = 'running'
      AND job_id = (
        SELECT
          id
        FROM jobs
        WHERE
          job_name = #{db.literal ARGV[0]}
      )
  SQL
  warn "erroring datums..."
  warn sql
  db[sql].get
  warn "done"

  sql = <<-SQL
    UPDATE
      jobs
    SET
      status = 'error'
    WHERE
      job_name = #{db.literal ARGV[0]}
  SQL
  warn "erroring job..."
  warn sql
  db[sql].get
  warn "done"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
faraday Requested by Faraday
Projects
None yet
Development

No branches or pull requests

2 participants