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

Worker Init/Final Log on Datapoint #482

Merged
merged 3 commits into from
Apr 30, 2019

Conversation

nllong
Copy link
Member

@nllong nllong commented Apr 19, 2019

  • Add set_gem_version.rb to the repo (for versioning and ease). This version can work locally in development or in production but must use resque.
  • Display the contents of the worker init/final script via API/HTML
  • Add simple test for running init scripts (needs more work)

Upon merging have this page reference the script in the PR.

@coveralls
Copy link

coveralls commented Apr 20, 2019

Coverage Status

Coverage increased (+0.3%) to 66.862% when pulling 0bc944a on worker-init-script-logs-and-test into 3f1bf7a on develop.

@nllong nllong requested a review from anyaelena April 20, 2019 14:12

# First check if there is a file that indicates the gem has already been updated.
# We only need to update the bundle once / worker, not every time a data point is initialized.
echo "Checking if Gemfile has been updated in ${GEMFILEUPDATE}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we do this at the start?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that would make more sense.

ensure
# save the log information to the datapoint if it exists
if File.exist? log_path
@data_point.worker_logs[script_name] = File.read(log_path).lines
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like this update. the logs are also downloaded w/data point zip file.

Project.destroy_all
Delayed::Job.destroy_all
rescue Errno::EACCES => e
puts "Cannot unlink files, will try and continue"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@anyaelena
Copy link
Member

Thanks @nllong!

@anyaelena anyaelena merged commit 97755d9 into develop Apr 30, 2019
@anyaelena anyaelena deleted the worker-init-script-logs-and-test branch April 30, 2019 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants