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

devider: add aarch64/arm64 builds #51370

Merged
merged 4 commits into from
Oct 16, 2024
Merged

Conversation

martin-g
Copy link
Contributor

Describe your pull request here


Please read the guidelines for Bioconda recipes before opening a pull request (PR).

General instructions

  • If this PR adds or updates a recipe, use "Add" or "Update" appropriately as the first word in its title.
  • New recipes not directly relevant to the biological sciences need to be submitted to the conda-forge channel instead of Bioconda.
  • PRs require reviews prior to being merged. Once your PR is passing tests and ready to be merged, please issue the @BiocondaBot please add label command.
  • Please post questions on Gitter or ping @bioconda/core in a comment.

Instructions for avoiding API, ABI, and CLI breakage issues

Conda is able to record and lock (a.k.a. pin) dependency versions used at build time of other recipes.
This way, one can avoid that expectations of a downstream recipe with regards to API, ABI, or CLI are violated by later changes in the recipe.
If not already present in the meta.yaml, make sure to specify run_exports (see here for the rationale and comprehensive explanation).
Add a run_exports section like this:

build:
  run_exports:
    - ...

with ... being one of:

Case run_exports statement
semantic versioning {{ pin_subpackage("myrecipe", max_pin="x") }}
semantic versioning (0.x.x) {{ pin_subpackage("myrecipe", max_pin="x.x") }}
known breakage in minor versions {{ pin_subpackage("myrecipe", max_pin="x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
known breakage in patch versions {{ pin_subpackage("myrecipe", max_pin="x.x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
calendar versioning {{ pin_subpackage("myrecipe", max_pin=None) }}

while replacing "myrecipe" with either name if a name|lower variable is defined in your recipe or with the lowercase name of the package in quotes.

Bot commands for PR management

Please use the following BiocondaBot commands:

Everyone has access to the following BiocondaBot commands, which can be given in a comment:

@BiocondaBot please update Merge the master branch into a PR.
@BiocondaBot please add label Add the please review & merge label.
@BiocondaBot please fetch artifacts Post links to CI-built packages/containers.
You can use this to test packages locally.

Note that the @BiocondaBot please merge command is now depreciated. Please just squash and merge instead.

Also, the bot watches for comments from non-members that include @bioconda/<team> and will automatically re-post them to notify the addressed <team>.

@martin-g martin-g added aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Oct 14, 2024
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request includes modifications to three files: build.sh, devider-aarch64.patch, and meta.yaml for the devider package. In build.sh, the shebang line has been changed to remove the -euo options, and a new set command has been added with -xeuo for enhanced debugging and error handling. The export statement for CARGO_NET_GIT_FETCH_WITH_CLI has been removed, retaining only the export of CARGO_HOME, which points to the .cargo subdirectory in the current working directory. A conditional block has been added to set the FEATURES variable based on the architecture detected by uname -m, specifically for aarch64 or arm64.

The devider-aarch64.patch modifies the Cargo.toml file, updating the versions of rust-htslib from 0.44 to 0.47 and block-aligner from 0.4 to 0.5.

In meta.yaml, the version number has been set to "0.0.1," and the build number has been incremented from 0 to 1. A new patches section has been added to specify the devider-aarch64.patch, and a new host requirement for clangdev has been included. Additionally, a new platform, linux-aarch64, has been added under additional-platforms.

Possibly related PRs

Suggested labels

please review & merge

Suggested reviewers

  • aliciaaevans

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 17c8237 and c02f604.

📒 Files selected for processing (1)
  • recipes/devider/meta.yaml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/devider/meta.yaml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@martin-g
Copy link
Contributor Author

This is weird!
The OSX ARM64 job says that it builds devider recipe but actually builds LoFreq ...
https://circleci.com/api/v1.1/project/github/bioconda/bioconda-recipes/213019/output/107/0?file=true&allocation-id=670d02a541577e2ff2e27322-0-build%2FABCDEFGH

11:41:19 �[32mBIOCONDA INFO�[0m Constraining to 1 git modified recipes (devider).�[0m
11:41:19 �[32mBIOCONDA INFO�[0m Processing 1 recipes (devider).�[0m
...
 Source cache directory is: /opt/mambaforge/envs/bioconda/conda-bld/src_cache�[0m
11:43:25 �[32mBIOCONDA INFO�[0m (OUT) Downloading source to cache: lofreq_star-2.1.5_43028af07f.tar.gz�[0m
11:43:25 �[32mBIOCONDA INFO�[0m (OUT) Downloading https://raw.githubusercontent.com/CSB5/lofreq/v2.1.5/dist/lofreq_star-2.1.5.tar.gz�[0m
11:43:26 �[32mBIOCONDA INFO�[0m (OUT) Success�[0m
11:43:27 �[32mBIOCONDA INFO�[0m (ERR) fatal: not a git repository (or any of the parent directories): .git�[0m
...

@aliciaaevans Any ideas ?

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
recipes/devider/build.sh (2)

6-6: Consider separating declaration and assignment of CARGO_HOME

The current line sets the CARGO_HOME environment variable, which is necessary for the conda-build environment. However, to address the static analysis hint and improve robustness, consider separating the declaration and assignment:

-export CARGO_HOME="$(pwd)/.cargo"
+CARGO_HOME="$(pwd)/.cargo"
+export CARGO_HOME

This approach:

  1. Avoids masking the return value of the command substitution.
  2. Makes it easier to handle potential errors in the command substitution.
  3. Improves readability and follows shell scripting best practices.
🧰 Tools
🪛 Shellcheck

[warning] 6-6: Declare and assign separately to avoid masking return values.

(SC2155)


11-18: Excellent addition of architecture-specific build options

The new case statement for setting architecture-specific features is a great improvement:

  1. It allows for optimized builds on ARM architectures by enabling the NEON feature.
  2. The structure is clean and easily extensible for future architecture-specific needs.

Suggestion for minor improvement:
Consider using a more specific default case to catch unexpected architectures:

 case $(uname -m) in
     aarch64 | arm64)
         FEATURES="--features neon --no-default-features"
         ;;
-    *)
+    x86_64 | i686)
         FEATURES=""
         ;;
+    *)
+        echo "Unsupported architecture: $(uname -m)" >&2
+        exit 1
+        ;;
 esac

This change would provide clearer error messages if the script is run on an unexpected architecture.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 219af55 and 17c8237.

📒 Files selected for processing (3)
  • recipes/devider/build.sh (1 hunks)
  • recipes/devider/devider-aarch64.patch (1 hunks)
  • recipes/devider/meta.yaml (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • recipes/devider/devider-aarch64.patch
🧰 Additional context used
🪛 Shellcheck
recipes/devider/build.sh

[warning] 6-6: Declare and assign separately to avoid masking return values.

(SC2155)

🔇 Additional comments (7)
recipes/devider/build.sh (3)

1-3: Improved error handling and debugging setup

The changes to the shebang line and the addition of the set -xeuo command are good improvements:

  1. Simplifying the shebang line makes the script more portable.
  2. Using set -xeuo enables better error handling and debugging:
    • -x: Prints commands and their arguments as they are executed.
    • -e: Exits immediately if a command exits with a non-zero status.
    • -u: Treats unset variables as an error when substituting.
    • -o pipefail: Causes a pipeline to fail if any command fails.

These changes will make the build process more robust and easier to debug.


20-20: Proper integration of architecture-specific features

The addition of ${FEATURES} to the cargo install command is excellent:

  1. It correctly applies the architecture-specific build options set earlier.
  2. This change ensures that the NEON features are used when building on ARM architectures, potentially improving performance.
  3. The placement of ${FEATURES} at the end of the command allows it to override any default features if necessary.

This modification completes the architecture-specific build improvements started earlier in the script.


1-21: Overall excellent improvements to the build script

The changes made to this build script are well-thought-out and beneficial:

  1. Improved error handling and debugging with the set -xeuo pipefail command.
  2. Proper setting of the CARGO_HOME environment variable for conda-build compatibility.
  3. Addition of architecture-specific build options, particularly for ARM architectures.
  4. Correct integration of these options into the cargo install command.

These modifications will make the build process more robust, easier to debug, and optimized for different architectures. The script is now more maintainable and extensible for future needs.

Consider implementing the minor suggestions provided in the previous comments to further enhance the script's robustness and clarity.

🧰 Tools
🪛 Shellcheck

[warning] 6-6: Declare and assign separately to avoid masking return values.

(SC2155)

recipes/devider/meta.yaml (4)

14-14: LGTM! Build number increment is appropriate.

Incrementing the build number from 0 to 1 is correct when making changes to the package without changing its version. This aligns with the addition of aarch64 support.


Line range hint 1-54: Overall, the changes look good and align with the PR objectives.

The modifications to meta.yaml effectively add support for aarch64/arm64 builds as intended. The key changes include:

  1. Adding an architecture-specific patch
  2. Incrementing the build number
  3. Adding a new host requirement for clangdev
  4. Specifying additional platforms (linux-aarch64 and osx-arm64)

These changes are consistent and necessary for supporting the new architectures. However, please ensure that all verifications suggested in the previous comments are performed to guarantee full compatibility and build support for the new platforms.


50-52: LGTM! Verify build support for new platforms.

The addition of linux-aarch64 and osx-arm64 to the additional-platforms list is appropriate and aligns with the PR objective.

Please ensure that the necessary build infrastructure and dependencies are in place to support these new platforms. You can verify the availability of key dependencies for these platforms with:

#!/bin/bash
# Description: Check availability of key dependencies for aarch64 and arm64
for dep in rust clangdev samtools minimap2 lofreq tabix pysam; do
  echo "Checking $dep for linux-aarch64:"
  conda search -c conda-forge -c bioconda --platform linux-aarch64 $dep
  echo "Checking $dep for osx-arm64:"
  conda search -c conda-forge -c bioconda --platform osx-arm64 $dep
  echo "---"
done

25-26: LGTM! Verify clangdev version constraint.

The addition of clangdev as a host requirement for linux and aarch64 is appropriate for supporting the new architecture.

Please confirm that the specific version constraint (>=16,<17) for clangdev is necessary. If it's not critical, consider relaxing it to allow for a wider range of compatible versions. You can check the availability of clangdev versions in the conda-forge channel with:

Comment on lines +10 to +11
patches:
- devider-aarch64.patch # [aarch64]
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Patch File Does Not Address aarch64-Specific Changes

The devider-aarch64.patch only updates dependency versions and does not include any modifications specific to aarch64 architecture support.

  • Ensure that the patch includes necessary aarch64-specific configurations or code changes.
🔗 Analysis chain

LGTM! Verify the patch file contents.

The addition of the architecture-specific patch for aarch64 is appropriate. This is a common approach for supporting new architectures.

Please ensure that the devider-aarch64.patch file contains the necessary changes for aarch64 support. You can verify its contents with:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Display the contents of the aarch64 patch file
cat recipes/devider/devider-aarch64.patch

Length of output: 560

recipes/devider/meta.yaml Outdated Show resolved Hide resolved
@martin-g
Copy link
Contributor Author

@BiocondaBot please fetch artifacts

@BiocondaBot
Copy link
Collaborator

Package(s) built are ready for inspection:

Arch Package Zip File / Repodata CI Instructions
linux-64 devider-0.0.1-h919a2d8_1.tar.bz2 LinuxArtifacts.zip Azure
showYou may also use conda to install after downloading and extracting the zip file. From the LinuxArtifacts directory: conda install -c ./packages <package name>
osx-64 devider-0.0.1-hfd5405d_1.tar.bz2 OSXArtifacts.zip Azure
showYou may also use conda to install after downloading and extracting the zip file. From the OSXArtifacts directory: conda install -c ./packages <package name>
linux-aarch64 devider-0.0.1-h2c59f48_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/46bde081-7509-46da-8b0e-ac7e3b506469/artifacts/0/tmp/artifacts/packages <package name>

Docker image(s) built:

Package Tag CI Install with docker
devider 0.0.1--h919a2d8_1 Azure
showImages for Azure are in the LinuxArtifacts zip file above.gzip -dc LinuxArtifacts/images/devider:0.0.1--h919a2d8_1.tar.gz | docker load

@martin-g
Copy link
Contributor Author

mgrigorov in 🌐 euler-arm-22 in /tmp/devider via 🅒 test123 took 3s 
❯ tar xvf devider-0.0.1-h2c59f48_1.tar.bz2                                                                                                                                                                 (test123) 
info/run_exports.json
info/test/run_test.sh
info/files
info/hash_input.json
info/has_prefix
info/index.json
info/recipe/devider-aarch64.patch
info/recipe/build.sh
info/licenses/LICENSE
info/recipe/meta.yaml.template
info/paths.json
info/recipe/meta.yaml
info/recipe/conda_build_config.yaml
info/about.json
info/git
info/licenses/THIRDPARTY.yml
bin/haplotag_bam
bin/run_devider_pipeline
bin/devider
bin/write_contig_headers_vcf.py

mgrigorov in 🌐 euler-arm-22 in /tmp/devider via 🅒 test123 
❯ file bin/*                                                                                                                                                                                               (test123) 
bin/devider:                     ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not stripped
bin/haplotag_bam:                Python script, ASCII text executable
bin/run_devider_pipeline:        Python script, ASCII text executable
bin/write_contig_headers_vcf.py: Python script, ASCII text executable

mgrigorov in 🌐 euler-arm-22 in /tmp/devider via 🅒 test123 
❯ ./bin/devider                                                                                                                                                                                            (test123) 
error: the following required arguments were not provided:
  --bam-file <BAM_FILE>
  --vcf-file <VCF_FILE>
  --reference-fasta <REFERENCE_FASTA>

Usage: devider --bam-file <BAM_FILE> --vcf-file <VCF_FILE> --reference-fasta <REFERENCE_FASTA>

For more information, try '--help'.

LGTM!

@martin-g
Copy link
Contributor Author

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Oct 15, 2024
@aliciaaevans
Copy link
Contributor

@martin-g I think there are some circumstances where conda-build will try to build packages which are dependencies instead of throwing an error. I am not sure of the details. You probably can add the osx-arm64 for lofreq first in another PR and then re-enable it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants