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

Reduce the BSK wheel size #859

Merged
merged 13 commits into from
Dec 2, 2024
Merged

Reduce the BSK wheel size #859

merged 13 commits into from
Dec 2, 2024

Conversation

schaubh
Copy link
Contributor

@schaubh schaubh commented Nov 25, 2024

  • Tickets addressed: bsk-814
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

When building a BSK wheel, the resulting file size is very large, over 200Mb. This is due to BSK including some data files into the resulting python package.

With the build process we already chose to download the large de430.bsp file from the JPL web link directly to reduce the GitHub repo size and bandwidth usage. This functionality is now expanded to all *.bsp files inside supportData/EphemerisData/*.bsp files.

Next, un-used data files have been removed. These files took up 10's of Mb.

Then, the wheel build process is updated to not include the supportData/EphemerisData/*.bsp files into the BSK package. This brings the wheel size to about 60-70 Mb depending on what build options were used (opNav, etc.).

Finally, to allow the user who installs BSK from a wheel to run existing BSK scripts, two new command line tools are included in the wheel. The first command bskLargeData pulls the missing *.bsp files and puts them into the locally installed BSK package. This allows existing BSK scripts to run without modification and retains the convenient nature of our BSK python package that includes basic data files. The user always has the option, of course, to connect custom data files to the BSK modules.

Next, the command bskExamples is included. When installing via a pip wheel none of the example tutorial scripts from the repo folder are available. The user could manually download these from GitHub. The command bskExamples pulls all the files inside the BSK root examples folder and installs them in the local directory of the user. This way a new user will be able to get up and running with BSK and tutorial scripts using only a few simple commands.

Verification

Did a lot of test builds to ensure the expected behaviors were achieved. The CI test that builds a wheel was updated to use bskLargeData so all the associated tests still pass.

Documentation

The pip install documentation is updated to talk about what is included in the BSK wheel, and how the bskLargeData and bskExamples commands can be used to install large data files and pull the examples folder.

Future work

None for now, but I'm sure this will be tweaked and updated over time.

@schaubh schaubh added enhancement New feature or request ci Continuous integration build Build system or compilation enhancement labels Nov 25, 2024
@schaubh schaubh requested a review from Mark2000 November 25, 2024 15:04
@schaubh schaubh self-assigned this Nov 25, 2024
@schaubh schaubh requested a review from a team as a code owner November 25, 2024 15:04
@schaubh schaubh linked an issue Nov 25, 2024 that may be closed by this pull request
Copy link
Contributor

@Mark2000 Mark2000 left a comment

Choose a reason for hiding this comment

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

Two questions about the changes:

  • Does bskExamples automatically run bskLargeFiles? If not, that seems like it should be the default behavior.
  • Do we know if people are often using the bsp files in their own projects? If the are and they install BSK from a wheel, will it be clear that they should run bskLargeFiles to get the files they are expecting? The behavior I would expect to see is if people try to load one of the now-removed files is a clear message that says "Run bskLargeFiles to download these files" or even better a prompt like "Do you want to download the bop support files? [y/n]".

@schaubh
Copy link
Contributor Author

schaubh commented Nov 26, 2024

Thanks for the feedback. No, bskExamples does not run bskLargeData automatically. I could add that.

If the files are not present then we just get a standard Spice error message about not being able to load the expected file. I can look and see if we can insert another message suggesting to run bskLargeData. Not sure how helpful this is. I do want to make sure the final documentation makes this behavior very clear on what is included in a BSK wheel, and what can be added. The updated RST documentation on installing pip wheels is already updated.

@Mark2000
Copy link
Contributor

The documentation is certainly good to have, but my philosophy is that is we can anticipate the issues the user may have, we should address it in the code. I think giving an additional message in the SPICE error would be helpful.

This script can be called after doing a pip install of Basilisk to pull the large *.bsp Spice files and install them into the Basilisk
package `supportData` sub-folder
This avoids packaging the examples into the wheel.  The user can elegantly pull the latest copy of the examples folder.
Discuss that the wheel does not contain large BSK data files, and how they can be installed with a new command from the terminal window.
Explain how the examples folder can be downloaded with bskExamples terminal command.
If the BSK script can't find de430.bsp, they BSK was likely installed via a wheel and the user didn't run bskLargeData to download the large BSK data files.  Now the user is given a suggestion to run this command.
@schaubh schaubh force-pushed the feature/reduce_wheel_size branch from 203d824 to f8041a7 Compare November 28, 2024 21:58
@schaubh
Copy link
Contributor Author

schaubh commented Nov 28, 2024

Ok @Mark2000 , I added both changes. Now the command bskLargeData is run when bskExamples is run, documentation is updated, and if the gravity helper function can't find de430.bsp, a suggestion is made to run bskLargeData.

@schaubh schaubh requested a review from Mark2000 November 28, 2024 22:00
Copy link
Contributor

@Mark2000 Mark2000 left a comment

Choose a reason for hiding this comment

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

Looks good, I think those changes should be helpful.

If the user installs BSK via a wheel, they have no way of knowing what support data files are included.  They are now auto-listed in a separate page.
@schaubh schaubh merged commit 60eed28 into develop Dec 2, 2024
9 checks passed
@schaubh schaubh deleted the feature/reduce_wheel_size branch December 2, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system or compilation enhancement ci Continuous integration enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

remove need for supportData folder in BSK wheels
2 participants