Skip to content

Adding initial http support when xrd not available#94

Merged
matyasselmeci merged 13 commits intoopensciencegrid:masterfrom
djw8605:add-http
Dec 12, 2018
Merged

Adding initial http support when xrd not available#94
matyasselmeci merged 13 commits intoopensciencegrid:masterfrom
djw8605:add-http

Conversation

@djw8605
Copy link
Copy Markdown
Member

@djw8605 djw8605 commented Dec 1, 2018

Adding http, and the tests for it, for when xrootd is not available.

There was a lot of work to make curl behave like cp

@djw8605 djw8605 requested a review from bbockelm December 1, 2018 02:42
Comment thread bin/stashcp Outdated

# Append port 8000, which is just a convention for now, not set in stone
cache += ":8000"
curl_command = "cd %s; curl %s -L --connect-timeout 30 --speed-limit 1024 %s --fail %s%s" % (dest_dir, output_mode, download_output, cache, source)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is totally gonna break if dest_dir has a space in it. I suggest quoting it -- either with re.quote() or pipes.quote().

@matyasselmeci
Copy link
Copy Markdown
Contributor

Can you add a command-line argument to force HTTP? That would be useful for testing.

@matyasselmeci
Copy link
Copy Markdown
Contributor

I like this! Let me do some testing...

@matyasselmeci matyasselmeci self-assigned this Dec 12, 2018
@matyasselmeci
Copy link
Copy Markdown
Contributor

Can you print a human-readable success/failure message instead of JSON?

@djw8605
Copy link
Copy Markdown
Member Author

djw8605 commented Dec 12, 2018

Shoot, it wasn't suppose to print anything. That was a debug line that snuck in.

If it fails, it should print something. But if it's successful, it should be completely quiet, like cp. This was requested by user support a while ago. The exit code the best indication of success or failure.

@matyasselmeci
Copy link
Copy Markdown
Contributor

Sure, sounds good.

@matyasselmeci
Copy link
Copy Markdown
Contributor

$ stashcp /chtc/PUBLIC/matyas/Python-3.6.5.tgz Python-3.6.5.tgz
Run: [ERROR] Operation expired
2018-12-12T14:04:24+0000 root         WARNING  XrdCP from cache failed on root://hcc-stash.unl.edu, pulling from main redirector

I'm seeing this message but the operation was successful so the [ERROR] thing is misleading.

@matyasselmeci
Copy link
Copy Markdown
Contributor

also, why isn't it getting cached? That was not the first time I ran that same command on that same host...

@djw8605
Copy link
Copy Markdown
Member Author

djw8605 commented Dec 12, 2018

I made the non-debug messages more quiet.

stashcp itself doesn't cache anything, it relies on cache it connects to to cache the data.

@matyasselmeci matyasselmeci merged commit 9064d6d into opensciencegrid:master Dec 12, 2018
@djw8605 djw8605 deleted the add-http branch December 12, 2018 21:34
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.

2 participants