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

gnparser: add aarch64/arm64 builds #51376

Merged
merged 1 commit into from
Oct 14, 2024

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>.

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g martin-g added aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Oct 14, 2024
@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 gnparser-1.10.3-he881be0_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 gnparser-1.10.3-h193322a_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>
osx-arm64 gnparser-1.10.3-hd5f1084_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/d0c4ab3a-372f-46f1-bf99-f412fa56e86a/artifacts/0/tmp/artifacts/packages <package name>
linux-aarch64 gnparser-1.10.3-h8865c2f_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/ed789289-7494-415e-aabb-464b8c2f4f6b/artifacts/0/tmp/artifacts/packages <package name>

Docker image(s) built:

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

@martin-g
Copy link
Contributor Author

mgrigorov in 🌐 euler-arm-22 in /tmp/gnparser via 🅒 test123 took 13s 
❯ tar xvf gnparser-1.10.3-h8865c2f_1.tar.bz2                                                                                                                                                               (test123) 
info/files
info/run_exports.json
info/test/run_test.sh
info/hash_input.json
info/recipe/build.sh
info/paths.json
info/index.json
info/recipe/meta.yaml.template
info/licenses/LICENSE
info/recipe/meta.yaml
info/recipe/conda_build_config.yaml
info/about.json
info/git
bin/gnparser

mgrigorov in 🌐 euler-arm-22 in /tmp/gnparser via 🅒 test123 
❯ file bin/*                                                                                                                                                                                               (test123) 
bin/gnparser: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=1KnjcVEiSJ-rtkKj4gKb/mXLL5DrHVKdmOd_I6yAn/bKCHZJmliluEDASqF-3w/TnzvmDCk0XQkvJKku0lN, with debug_info, not stripped

mgrigorov in 🌐 euler-arm-22 in /tmp/gnparser via 🅒 test123 
❯ ./bin/gnparser                                                                                                                                                                                           (test123) 

Parses scientific names into their semantic elements.

To see version:
gnparser -V

To parse one name in CSV format
gnparser "Homo sapiens Linnaeus 1758" [flags]
or (the same)
gnparser "Homo sapiens Linnaeus 1758" -f csv [flags]

To parse one name using JSON format:
gnparser "Homo sapiens Linnaeus 1758" -f compact [flags]
or
gnparser "Homo sapiens Linnaeus 1758" -f pretty [flags]

To parse with maximum amount of details:
gnparser "Homo sapiens Linnaeus 1758" -d -f pretty

To parse many names from a file (one name per line):
gnparser names.txt [flags] > parsed_names.txt

To leave HTML tags and entities intact when parsing (faster)
gnparser names.txt -n > parsed_names.txt

To start web service on port 8080 with 5 concurrent jobs:
gnparser -j 5 -p 8080

Usage:
  gnparser file_or_name [flags]

Flags:
  -b, --batch_size int      maximum number of names in a batch send for processing.
  -c, --capitalize          capitalize the first letter of input name-strings
  -C, --cultivar            include cultivar epithets and graft-chimeras in normalized and canonical outputs
  -d, --details             provides more details
  -D, --diaereses           preserve diaereses in names
  -f, --format string       sets output format. Can be one of:
                            'csv', 'tsv', 'compact', 'pretty'
                            default is 'csv'
  -h, --help                help for gnparser
  -i, --ignore_tags         ignore HTML entities and tags when parsing.
  -j, --jobs int            number of threads to run. CPU's threads number is the default.
      --nsqd-tcp string     an addresss pointing to NSQ TCP service for logs redirection (e.g. 127.0.0.1:4150)
  -p, --port int            starts web site and REST server on the port.
  -q, --quiet               do not show progress
      --species-group-cut   cut autonym/species group names to species for stemmed version
  -s, --stream              parse one name at a time in a stream instead of a batch parsing
  -u, --unordered           output and input are in different order
  -V, --version             shows build version and date, ignores other flags.
      --web-logs            enable logs for the web service

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 14, 2024
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to two files: build.sh and meta.yaml within the gnparser package. In build.sh, the command set -xe is added at the beginning, which enables the script to print each command before execution and to exit immediately if any command fails. The rest of the script remains unchanged, maintaining its functionality of navigating to the gnparser directory, cleaning the Go build environment, building the application, and managing the output binaries. In meta.yaml, the version is updated to "1.10.3" with an incremented build number from 0 to 1. The source URL is modified to reference a specific versioned tarball. Additionally, two new platforms, linux-aarch64 and osx-arm64, are included under additional-platforms, enhancing the package's compatibility. No alterations were made to the declarations of exported or public entities in either file.

Possibly related PRs

Suggested reviewers

  • mencian
  • bgruening

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.

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: 0

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

3-3: Excellent addition of error handling and verbosity.

The addition of set -xe is a great improvement to the build script. It enhances error detection and provides better visibility into the build process. This change aligns well with best practices for shell scripting in build environments.

Consider adding a comment explaining the purpose of these flags for future maintainers. For example:

+# Enable verbose mode and exit on any error
set -xe

This small addition would improve the script's readability and maintainability.


Line range hint 1-11: Consider enhancing error handling and portability.

While the current script works, there are a few areas where it could be made more robust:

  1. Add a check for the gnparser directory's existence.
  2. Export the CGO_ENABLED variable to ensure it affects subprocesses.
  3. Add a check for successful build before moving the binary.
  4. Consider adding a check for the $PREFIX variable.

Here's a suggested improvement:

 #!/bin/bash

 # Enable verbose mode and exit on any error
 set -xe

+# Ensure PREFIX is set
+: "${PREFIX:?PREFIX must be set}"
+
+# Check if gnparser directory exists
+if [ ! -d "gnparser" ]; then
+    echo "Error: gnparser directory not found" >&2
+    exit 1
+fi
+
 cd gnparser
-CGO_ENABLED=0
+export CGO_ENABLED=0
 go clean
 go build .
+
+# Check if build was successful
+if [ ! -f "gnparser" ]; then
+    echo "Error: Build failed, gnparser binary not found" >&2
+    exit 1
+fi
+
 mkdir -p $PREFIX/bin
 mv gnparser $PREFIX/bin

These changes will make the script more robust and easier to debug if issues arise.

🧰 Tools
🪛 Shellcheck

[warning] 6-6: CGO_ENABLED appears unused. Verify use (or export if used externally).

(SC2034)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1c1935d and 577e0d0.

📒 Files selected for processing (2)
  • recipes/gnparser/build.sh (1 hunks)
  • recipes/gnparser/meta.yaml (2 hunks)
🧰 Additional context used
🔇 Additional comments (4)
recipes/gnparser/meta.yaml (4)

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

The build number has been correctly incremented from 0 to 1. This is the expected practice when making changes to a package without altering its version, which is the case here with the addition of new platforms.


Line range hint 1-42: Summary: All changes look good and align with PR objectives.

The modifications to meta.yaml are well-implemented and consistent with the PR's goal of adding aarch64/arm64 builds. Key changes include:

  1. Updating the version to 1.10.3 with corresponding SHA256 and URL updates.
  2. Incrementing the build number.
  3. Adding linux-aarch64 and osx-arm64 to the additional platforms.

These changes will expand the compatibility of the gnparser package to ARM-based systems while maintaining the integrity of the package. The review process included verification steps for build artifacts and the SHA256 checksum to ensure the changes are correctly implemented.


37-39: LGTM: New platforms added correctly.

The addition of linux-aarch64 and osx-arm64 platforms is in line with the PR objective and expands the package's compatibility to ARM-based systems. This is a valuable improvement.

To ensure these changes are reflected in the build process, let's verify the build artifacts:

#!/bin/bash
# Description: Verify that build artifacts for the new platforms are generated.

# Test: Check if build artifacts for linux-aarch64 and osx-arm64 are present
gh pr view 51376 --json comments -q '.comments[].body' | grep -E 'linux-aarch64|osx-arm64'

Line range hint 1-11: LGTM: Version update is consistent and complete.

The version has been correctly updated to "1.10.3" across all relevant fields, including the version number, SHA256 checksum, and source URL. This ensures that the correct version of the package will be downloaded and built.

To ensure the integrity of the package, let's verify the SHA256 checksum:

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.

3 participants