Skip to content

Local default trees#7820

Closed
acwhite211 wants to merge 4 commits intomainfrom
local-default-trees
Closed

Local default trees#7820
acwhite211 wants to merge 4 commits intomainfrom
local-default-trees

Conversation

@acwhite211
Copy link
Member

Instead of accessing default tree files remotely, we decided to add them to the repo so that each Specify instance would have the needed files locally. This allows users without internet access to do the important process of setting up default trees locally. We also compressed the default csv files to save on storage space when user's pull the latest code from the repo. The default_trees directory was originally 156.1 MB, and now is 19.9 MB after compression. The code for making the requests for the files has been changed to reflect the new file locations.

No new api calls were needed, just using the existing /static/config/... api now to get the default tree files. This is used, instead of the remote call to specifysoftware.org/taxonfiles/.... We also added the leaflet-layers.json to the local config directory, since it was being frequently called to files.specifysoftware.org, so now it can be retrieved from /static/config/default_trees/taxonfiles.json.

Also note in the implementation that we needed to add local mapping files for the setup preload of Geography and Geologic Time Period trees in order to get them to work.

There are three places in the application where when need to confirm that the new default trees files are requested. Those being the setup tool, the configuration tool, and the tree viewer.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • Start with a new database to go through the setup tool process
  • Choose one of the default trees
  • See that the network request for taxonfiles.json was to /static/config/default_trees/taxonfiles.json instead of specifysoftware.org/taxonfiles/taxonfiles.json.
  • Once logged-in, see that the default tree was populated.
  • Go to the tree viewer and press the '+' "Add Tree" tree button on the top of the page.
  • See that the network request for taxonfiles.json was to /static/config/default_trees/taxonfiles.json instead of specifysoftware.org/taxonfiles/taxonfiles.json.
  • Click on one of the default trees. Wait for it to be created and then confirm that the new tree is populated.
  • Go to the configuration tool and create a new discipline with a default tree.
  • See that the network request for taxonfiles.json was to /static/config/default_trees/taxonfiles.json instead of specifysoftware.org/taxonfiles/taxonfiles.json.
  • Once the discipline is finished being created, create a collection in the discipline. Log into that collection and go to the tree viewer to see that the default tree is populated.

Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

S3 is suitable for large, infrequently accessed resources, such as default taxon trees, which work well on demand. For essential components that are always required for basic app functions, like always populated defaults and leaflet layers, we should not need to access an external server.

To clarify, only the geography and geologictimeperiod trees need to be local, not the taxon trees. I think having those be independent and downloaded on-demand is a better approach ^

@acwhite211
Copy link
Member Author

New implementation here #7821

@acwhite211 acwhite211 closed this Mar 17, 2026
@github-project-automation github-project-automation bot moved this from 📋Back Log to ✅Done in General Tester Board Mar 17, 2026
@acwhite211 acwhite211 mentioned this pull request Mar 17, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

2 participants