Merge branch '14087-federated-collection-by-pdh' refs #14087
[arvados.git] / crunch_scripts / file-select
1 #!/usr/bin/env python
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 import arvados
7 import os
8 import re
9
10 this_job = arvados.current_job()
11 this_task = arvados.current_task()
12 this_job_input = this_job['script_parameters']['input']
13 manifest_text = ""
14 for f in arvados.CollectionReader(this_job_input).all_files():
15     if f.name() in this_job['script_parameters']['names']:
16         manifest_text += f.as_manifest()
17
18 this_task.set_output(arvados.Keep.put(manifest_text))