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

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

Reduce the BSK wheel size #859

wants to merge 10 commits into from

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.

This cuts down drastically on the wheel size.
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.
@schaubh schaubh added enhancement New feature or request ci Continuous integration build Build system or compilation enhancement labels Nov 25, 2024
@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.

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: 👀 In review
Development

Successfully merging this pull request may close these issues.

remove need for supportData folder in BSK wheels
2 participants