ric
(Ric Anderson)
July 25, 2022, 6:25pm
1
WIll OnDemand function properly in the absence of rsync? I know the ondemand rpm lists rsync as a requirement, but I have a use case where I need to remove the rsync package from the OOD server…
gbyrket
(Gerald Byrket)
July 25, 2022, 6:51pm
2
Hey Ric.
I would have to test it and see. Do you have the ability to test the use case?
Thanks,
-gerald
ric
(Ric Anderson)
July 25, 2022, 11:21pm
3
The standard package removal process that is in use (yum erase rsync) takes the ondemand and ondemand-selonux packages out as dependencoes. I know there are ways around that, but the process is a box.
This comes down to "why does the ondemand rpm require the rsync package as a dependency?”
Ric
gbyrket
(Gerald Byrket)
July 26, 2022, 1:27pm
4
We’ll have to look at this, and get back with you.
Thanks,
-gerald
travert
(Travis Ravert)
July 26, 2022, 2:03pm
5
Hi Ric,
The dependency are in the batch_connect
and myjobs
apps. You can see the associated code here:
def du(path, timeout)
Open3.capture3("timeout", "#{timeout}s", "du", "-cbs", path)
end
# Copies the data in a source to a destination path using rsync.
#
# @param [String, Pathname] src The src path.
# @param [String, Pathname] dest The target path.
# @return array of the [output, status] of the command
def copy_dir(src, dest)
output = `rsync -r --exclude='.svn' --exclude='.git' --exclude='.gitignore' --filter=':- .gitignore' 2>&1 #{Shellwords.escape(src.to_s)}/ #{Shellwords.escape(dest.to_s)}`
[output, $?]
end
# FIXME: some duplication here between du command above and this; we probably
# want to use the above
#
# Get the disk usage of a path in bytes, nil if path does not exist
def path_size (path)
if Dir.exist? path
And also here:
#
# @return [Pathname] The staged directory path.
def stage
if self.staged_dir.nil?
raise StagingTemplateDirMissing unless staging_template_dir && File.directory?(staging_template_dir)
self.staged_dir = OSC::Machete::JobDir.new(staging_target_dir).new_jobdir.to_s
FileUtils.mkdir_p self.staged_dir
# rsync to ignore manifest.yml
stdout, stderr, status = Open3.capture3 "rsync -r --exclude='manifest.yml' #{Shellwords.escape(staging_template_dir.to_s)}/ #{Shellwords.escape(self.staged_dir)}"
raise IOError if status.exitstatus != 0
end
Pathname.new(self.staged_dir.to_s)
end
# Get an array of WorkflowFile Objects of all the files of a directory
#
# Find.find returns an enumerator - the first path is always the initial directory
# so we return the array with the first item omitted
# Then, map files to WorkflowFile objects
Oh! And one more rather important dependency:
rescue => e # rescue from all standard exceptions (app never crashes)
errors.add(:save, e.message)
Rails.logger.error("ERROR: #{e.class} - #{e.message}")
false
end
# Stage the app's job template to user's staging directory
# @param root [#to_s] root directory that gets staged
# @param context [Object] context available when rendering staged files
# @return [Boolean] whether staged successfully
def stage(root, context: nil)
staged_root.tap { |p| p.mkpath unless p.exist? }
# Sync the template files over
oe, s = Open3.capture2e("rsync", "-a", "#{root}/", "#{staged_root}")
raise oe unless s.success?
# Output user submitted context attributes for debugging purposes
user_defined_context_file.write(JSON.pretty_generate context.as_json)
# Render all template files using ERB
Let me know if you have anymore questions!
ric
(Ric Anderson)
July 26, 2022, 2:38pm
6
Thanks for the info - I’ll see if I can get a rsync exception for this system.
Ric
system
(system)
Closed
January 22, 2023, 2:38pm
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.