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

Pre-Built SIPNET Binary for GitHub Actions #3435

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

AritraDey-Dev
Copy link
Contributor

@AritraDey-Dev AritraDey-Dev commented Feb 11, 2025

Fixes #3427

Add CI workflow to build and upload SIPNET binary as an artifact and update PEcAn workflow to use pre-built SIPNET binary.

  • ci.yml

    • Add steps to build SIPNET binary.
    • Add steps to upload SIPNET binary as an artifact.
  • sipnet.yml

    • Remove steps to check out and build SIPNET from source.
    • Add steps to download pre-built SIPNET binary.
    • Add steps to use pre-built SIPNET binary.

Copy link
Member

@infotroph infotroph left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! To meet the requirements of #3427 you'll need to make some changes:

  • Building the binary should be done in the sipnet repo. Determining how to get the built binary from there to here is the crux of the task.
  • In all repositories Github Actions workflows have to be in .github/workflows, not in the project root.
  • The changes to PEcAn's CI should modify existing workflows rather than add new ones.

@AritraDey-Dev
Copy link
Contributor Author

Thanks for working on this! To meet the requirements of #3427 you'll need to make some changes:

  • Building the binary should be done in the sipnet repo. Determining how to get the built binary from there to here is the crux of the task.
  • In all repositories Github Actions workflows have to be in .github/workflows, not in the project root.
  • The changes to PEcAn's CI should modify existing workflows rather than add new ones.

Sure I will look into this changes.

@AritraDey-Dev
Copy link
Contributor Author

i have made the required changes.can you please look into those.

@dlebauer
Copy link
Member

dlebauer commented Feb 12, 2025

@AritraDey-Dev Looks good to me! I am not sure if Lines 61-73 of ci.yml need to be there, now that the binary building will be done elsewhere.

I put a note in PecanProject/sipnet#27 and will update the curl statements once we have a release with binaries.

@AritraDey-Dev
Copy link
Contributor Author

@infotroph i have Updated upload-artifact to v3. SIPNET installation remains encapsulated in sipnet.yml, so no further modifications were needed. Let me know if anything else is required!

Copy link
Collaborator

@allgandalf allgandalf left a comment

Choose a reason for hiding this comment

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

few comments

run: |
cd ${GITHUB_WORKSPACE}/sipnet
make sipnet
curl -L -o sipnet-linux "https://drive.google.com/uc?export=download&id=1sRTFfs9Z9osmMrtLlwVTqxeUDxgVlrEv"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dlebauer @infotroph are we sure that this drive link will always be live for our project ? joining mid way so do not have the best context

Copy link
Member

@dlebauer dlebauer Feb 20, 2025

Choose a reason for hiding this comment

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

That was just a placeholder until I got builds posted with different releases, the latest is 1.3.0 https://github.com/PecanProject/sipnet/releases/tag/v1.3.0

This will always resolve to the latest release https://github.com/PecanProject/sipnet/releases/latest but the version number in the binary name will change.

Copy link
Member

Choose a reason for hiding this comment

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

cd ${GITHUB_WORKSPACE}/sipnet
make sipnet
curl -L -o sipnet-linux "https://drive.google.com/uc?export=download&id=1sRTFfs9Z9osmMrtLlwVTqxeUDxgVlrEv"
chmod +x sipnet-linux
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we make use of sipnet-linux while building ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#3427 here the binary shared for linux i have updated that.

Copy link
Member

@infotroph infotroph Mar 3, 2025

Choose a reason for hiding this comment

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

You can see what binary name we use for testing by following the files referenced from line 69 below and finding that tests/ghaction.sipnet_PostgreSQL.xml expects to find it at$GITHUB_WORKSPACE}/sipnet, so you'll need to update either this line or that file to match each other

@AritraDey-Dev AritraDey-Dev force-pushed the fix_pre-built-sipnet branch 2 times, most recently from 6fd5195 to b685ef5 Compare February 21, 2025 07:25
@AritraDey-Dev
Copy link
Contributor Author

AritraDey-Dev commented Feb 23, 2025

@dlebauer @allgandalf @infotroph I was thinking that how to get the binary file...I have solution please check how much this is possible.After building the binary file based on version or some other parameter,every time it will upload to some location(for now g-drive,or some other location) and then some kind of github Actions which will update the binary file in the sipnet.yml file.What do you think can something like this be done?

@AritraDey-Dev AritraDey-Dev force-pushed the fix_pre-built-sipnet branch 3 times, most recently from d5c0589 to d05c20d Compare February 25, 2025 18:32
@AritraDey-Dev
Copy link
Contributor Author

@dlebauer @allgandalf Does this change work?

Comment on lines 52 to 55
- name: Download SIPNET for macOS
run: |
curl -L -o sipnet-macos "https://drive.google.com/uc?export=download&id=1psNvSw77VcD5QdbSWeGNVQsbCmJokG2W"
chmod +x sipnet-macos
Copy link
Member

Choose a reason for hiding this comment

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

Don't need to download Mac binary to the Linux check machine

@infotroph
Copy link
Member

@AritraDey-Dev This PR is currently failing CI checks for the same reasons discussed in #3427: The downloaded binary needs to be at the path expected by the test files, and the test needs to be updated to handle retrieving its climate driver file (currently taken from the sipnet repo as ${GITHUB_WORKSPACE}/sipnet/Sites/Niwot/niwot.clim, which won't work if we're not checking out the repo anymore).

Previous code created extra copies of items on every subsetting operation,
even if the extracted item was not modified.
Profiling with a 100-site MultiSettings showed ~90% of runtime spent here;
comparing x[[1]] in place completely eliminates GCs and runtime goes from
64 sec to 50 ms.
@AritraDey-Dev
Copy link
Contributor Author

@infotroph i have a fix for this not sure it will work..will test it and let you know if it works.

@github-actions github-actions bot added the Base label Mar 3, 2025
@github-actions github-actions bot added the Tests label Mar 3, 2025
@AritraDey-Dev
Copy link
Contributor Author

@infotroph i have made the changes in test.I have updated the path for the climate driver file in the test configuration to ensure it points to the correct location during the CI process.The CI checks for sipnet is working fine now.

@AritraDey-Dev AritraDey-Dev requested a review from infotroph March 3, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-Built SIPNET Binary for GitHub Actions
4 participants