Build branch craftbox/main with version main to craftbox on branch main (b74f552)
Build pipeline: vsh-ci-build-template-xfb9n
Source commit: b74f55253e
Source message: Prepare for 0.3.2 release (#19)
This commit is contained in:
@@ -26,6 +26,22 @@ authors:
|
||||
- name: "Data Intuitive"
|
||||
href: "https://www.data-intuitive.com"
|
||||
role: "Data Scientist"
|
||||
- name: "Robrecht Cannoodt"
|
||||
roles:
|
||||
- "contributor"
|
||||
info:
|
||||
links:
|
||||
email: "robrecht@data-intuitive.com"
|
||||
github: "rcannood"
|
||||
orcid: "0000-0003-3641-729X"
|
||||
linkedin: "robrechtcannoodt"
|
||||
organizations:
|
||||
- name: "Data Intuitive"
|
||||
href: "https://www.data-intuitive.com"
|
||||
role: "Data Science Engineer"
|
||||
- name: "Open Problems"
|
||||
href: "https://openproblems.bio"
|
||||
role: "Core Member"
|
||||
argument_groups:
|
||||
- name: "Input arguments"
|
||||
arguments:
|
||||
@@ -34,7 +50,7 @@ argument_groups:
|
||||
description: "A list of (gzipped) text files."
|
||||
info: null
|
||||
example:
|
||||
- "input?.txt.gz"
|
||||
- "input.txt.gz"
|
||||
must_exist: true
|
||||
create_parent: true
|
||||
required: true
|
||||
@@ -50,7 +66,7 @@ argument_groups:
|
||||
direction: "input"
|
||||
- type: "file"
|
||||
name: "--output"
|
||||
description: "File to write the output to, optionally gzipped."
|
||||
description: "File to write the output to, potentially gzipped."
|
||||
info: null
|
||||
example:
|
||||
- "output.txt"
|
||||
@@ -64,7 +80,7 @@ resources:
|
||||
- type: "bash_script"
|
||||
path: "script.sh"
|
||||
is_executable: true
|
||||
summary: "Concatenate a number of text files"
|
||||
summary: "Concatenate multiple (possibly gzipped) text files"
|
||||
description: "Concatenate a number of text files, handle gzipped text files gracefully\
|
||||
\ and\noptionally gzip the output text file.\n\nThis component is useful for concatening\
|
||||
\ fastq files from different lanes, for instance.\n"
|
||||
@@ -73,9 +89,8 @@ test_resources:
|
||||
path: "test.sh"
|
||||
is_executable: true
|
||||
info:
|
||||
improvements: "This component could be improved in 2 ways:\n 1. Allow for a mix\
|
||||
\ of zipped and plain input files\n 2. Allow to specify a compression algorithm\
|
||||
\ for the output\n"
|
||||
improvements: "This component could be improved:\n 1. Allow to specify a compression\
|
||||
\ algorithm for the output\n"
|
||||
status: "enabled"
|
||||
scope:
|
||||
image: "public"
|
||||
@@ -174,8 +189,8 @@ build_info:
|
||||
engine: "docker|native"
|
||||
output: "target/executable/concat_text"
|
||||
executable: "target/executable/concat_text/concat_text"
|
||||
viash_version: "0.9.4"
|
||||
git_commit: "32cec141fe0eb61ce1b63f36a2e5c3ae2fbf9550"
|
||||
viash_version: "0.9.7"
|
||||
git_commit: "b74f55253eaa60d4dcd40a80b6965bc0bc9e1dd1"
|
||||
git_remote: "https://github.com/viash-hub/craftbox"
|
||||
package_config:
|
||||
name: "craftbox"
|
||||
@@ -195,7 +210,7 @@ package_config:
|
||||
\ to ensure dependency management and a consistent, reproducible runtime environment.\n\
|
||||
\ * Unit tested where applicable to ensure components function as expected.\n"
|
||||
info: null
|
||||
viash_version: "0.9.4"
|
||||
viash_version: "0.9.7"
|
||||
source: "src"
|
||||
target: "target"
|
||||
config_mods:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# concat_text main
|
||||
#
|
||||
# This wrapper script is auto-generated by viash 0.9.4 and is thus a derivative
|
||||
# This wrapper script is auto-generated by viash 0.9.7 and is thus a derivative
|
||||
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
|
||||
# Intuitive.
|
||||
#
|
||||
@@ -14,6 +14,7 @@
|
||||
# Component authors:
|
||||
# * Toni Verbeiren (author, maintainer)
|
||||
# * Dries Schaumont (reviewer)
|
||||
# * Robrecht Cannoodt (contributor)
|
||||
|
||||
set -e
|
||||
|
||||
@@ -451,11 +452,11 @@ FROM alpine:latest
|
||||
ENTRYPOINT []
|
||||
RUN apk add --no-cache bash procps file
|
||||
|
||||
LABEL org.opencontainers.image.authors="Toni Verbeiren, Dries Schaumont"
|
||||
LABEL org.opencontainers.image.authors="Toni Verbeiren, Dries Schaumont, Robrecht Cannoodt"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component concat_text"
|
||||
LABEL org.opencontainers.image.created="2025-09-01T14:32:38Z"
|
||||
LABEL org.opencontainers.image.created="2026-06-01T12:52:41Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/craftbox"
|
||||
LABEL org.opencontainers.image.revision="32cec141fe0eb61ce1b63f36a2e5c3ae2fbf9550"
|
||||
LABEL org.opencontainers.image.revision="b74f55253eaa60d4dcd40a80b6965bc0bc9e1dd1"
|
||||
LABEL org.opencontainers.image.version="main"
|
||||
|
||||
VIASHDOCKER
|
||||
@@ -584,7 +585,7 @@ function ViashHelp {
|
||||
echo "Input arguments:"
|
||||
echo " --input"
|
||||
echo " type: file, required parameter, multiple values allowed, file must exist"
|
||||
echo " example: input?.txt.gz"
|
||||
echo " example: input.txt.gz"
|
||||
echo " A list of (gzipped) text files."
|
||||
echo ""
|
||||
echo "Output arguments:"
|
||||
@@ -595,7 +596,7 @@ function ViashHelp {
|
||||
echo " --output"
|
||||
echo " type: file, output, file must exist"
|
||||
echo " example: output.txt"
|
||||
echo " File to write the output to, optionally gzipped."
|
||||
echo " File to write the output to, potentially gzipped."
|
||||
echo ""
|
||||
echo "Viash built in Computational Requirements:"
|
||||
echo " ---cpus=INT"
|
||||
@@ -1080,6 +1081,10 @@ function interrupt {
|
||||
trap clean_up EXIT
|
||||
trap interrupt INT SIGINT
|
||||
cat > "\$tempscript" << 'VIASHMAIN'
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
## VIASH START
|
||||
# The following code has been auto-generated by Viash.
|
||||
$( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi )
|
||||
@@ -1105,40 +1110,62 @@ $( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "${VIASH_META_MEMORY_TIB}"
|
||||
$( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" | sed "s#'#'\"'\"'#g;s#.*#meta_memory_pib='&'#" ; else echo "# meta_memory_pib="; fi )
|
||||
|
||||
## VIASH END
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TMPDIR=\$(mktemp -d "\$meta_temp_dir/concat_text-XXXXXX")
|
||||
function clean_up {
|
||||
[[ -d "\$TMPDIR" ]] && rm -r "\$TMPDIR"
|
||||
# --- Function to check for GZIP format using the 'file' command ---
|
||||
is_gzipped() {
|
||||
# Ensure the file exists and is not empty before checking
|
||||
if [ ! -s "\$1" ]; then
|
||||
return 1
|
||||
fi
|
||||
# Get the MIME type of the file. The '-b' option omits the filename from the output.
|
||||
local mime_type
|
||||
mime_type=\$(file -b --mime-type "\$1")
|
||||
|
||||
# Check if the MIME type corresponds to gzip.
|
||||
# application/gzip is standard, while application/x-gzip is also commonly seen.
|
||||
if [[ "\$mime_type" == "application/gzip" || "\$mime_type" == "application/x-gzip" ]]; then
|
||||
return 0 # 0 indicates success (true in bash)
|
||||
else
|
||||
return 1 # 1 indicates failure (false in bash)
|
||||
fi
|
||||
}
|
||||
trap clean_up EXIT
|
||||
|
||||
par_input="\$(echo "\$par_input" | tr ';' ' ')"
|
||||
# Read the ;-separated file paths from the input variable into an array
|
||||
IFS=";" read -ra input_files <<< "\$par_input"
|
||||
|
||||
echo -n ">> Check if input is gzipped... "
|
||||
set +eo pipefail
|
||||
file \$par_input | grep -q 'gzip'
|
||||
is_zipped="\$?"
|
||||
set -euo pipefail
|
||||
[[ "\$is_zipped" == "0" ]] && echo "yes" || echo "no"
|
||||
# Process the files if the array contains any paths
|
||||
if [ \${#input_files[@]} -gt 0 ] && [ -n "\${input_files[0]}" ]; then
|
||||
|
||||
if [[ "\$is_zipped" == "0" ]]; then
|
||||
echo ">> zcat gzipped files"
|
||||
zcat \$par_input > \$TMPDIR/contents
|
||||
# Ensure the output file is empty before we start
|
||||
> "\$par_output"
|
||||
|
||||
echo "Processing files for -> \$par_output"
|
||||
|
||||
# Create a subshell for the loop to group all cat/zcat output.
|
||||
(
|
||||
for file in "\${input_files[@]}"; do
|
||||
if [ -z "\$file" ]; then continue; fi # Skip empty entries in the array
|
||||
|
||||
if is_gzipped "\$file"; then
|
||||
zcat "\$file"
|
||||
else
|
||||
cat "\$file"
|
||||
fi
|
||||
done
|
||||
) | if [ "\$par_compress_output" = "true" ]; then
|
||||
# If compression is enabled, pipe the entire stream to gzip
|
||||
gzip -c >> "\$par_output"
|
||||
else
|
||||
# Otherwise, just redirect the stream to the plain text file
|
||||
cat >> "\$par_output"
|
||||
fi
|
||||
|
||||
echo "Finished creating \$par_output."
|
||||
else
|
||||
echo ">> cat plain files"
|
||||
cat \$par_input > \$TMPDIR/contents
|
||||
echo "No input files provided in \\\$par_input. Exiting."
|
||||
fi
|
||||
|
||||
if [ "\$par_gzip_output" == true ]; then
|
||||
echo ">> Zip output file"
|
||||
gzip \$TMPDIR/contents
|
||||
mv \$TMPDIR/contents.gz \$par_output
|
||||
else
|
||||
mv \$TMPDIR/contents \$par_output
|
||||
fi
|
||||
echo "Script finished successfully."
|
||||
VIASHMAIN
|
||||
bash "\$tempscript" &
|
||||
wait "\$!"
|
||||
|
||||
Reference in New Issue
Block a user