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

DM-24352: Add new link and auto transfer modes and default to auto for 2to3 #222

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions python/lsst/obs/base/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def makeTransferChoiceField(doc="How to transfer files (None for no transfer).",
dtype=str,
allowed={"move": "move",
"copy": "copy",
"auto": "choice will depend on datastore",
"link": "hard link falling back to symbolic link",
"hardlink": "hard link",
"symlink": "symbolic (soft) link"},
optional=True,
Expand Down
4 changes: 4 additions & 0 deletions python/lsst/obs/base/ingest_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def checkRepo(self, files=None):
"""
pass

def testLink(self):
self.config.transfer = "link"
self.runIngestTest()

def testSymLink(self):
self.config.transfer = "symlink"
self.runIngestTest()
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/script/convertGen2RepoToGen3.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def convert(gen2root, gen3root, instrumentClass, calibFilterType,
instrument.applyConfigOverrides(ConvertRepoTask._DefaultName, convertRepoConfig)
if convertRepoConfig.raws.instrument is None:
convertRepoConfig.raws.instrument = instrumentClass
convertRepoConfig.raws.transfer = "symlink"
convertRepoConfig.raws.transfer = "auto"
Copy link
Member

Choose a reason for hiding this comment

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

This really needs to be controllable from the command-line. The right way to do that is to leverage the pex_config-override argument parsing that's in ctrl_mpexec, so maybe that can wait until we make this a butler subcommand.

But we also shouldn't let the lack of command-line flexibility now bias our choice of default behavior (especially down in daf_butler; see PR comment there). It'd be better to add an argparse option here for transfer mode manually, even if we do later replace it with more general pex_config stuff.

if skymapName is not None:
convertRepoConfig.skyMaps[skymapName] = ConvertRepoSkyMapConfig()
convertRepoConfig.skyMaps[skymapName].load(skymapConfig)
Expand Down