Skip to content

Allow to download tarball directly from the website#165

Closed
mj-gomes wants to merge 70 commits intoziotom78:masterfrom
litebird:allow_download_tarball
Closed

Allow to download tarball directly from the website#165
mj-gomes wants to merge 70 commits intoziotom78:masterfrom
litebird:allow_download_tarball

Conversation

@mj-gomes
Copy link
Copy Markdown
Contributor

@mj-gomes mj-gomes commented Mar 24, 2026

note: this branch builds on top of the focalplane_ui branch. To see the changes which are specific to this branch, you can simply check commit fa0e143.

This PR adds the option to download the full tarball, including data files, format specification, etc., directly from the website, for each release. I thought at first that this would be particularly useful if the server were to go down, but in that case the website would not be available and so the user cannot download the tarball anyways. However, this can turn out to be useful in specific cases (I remember when I first tried to access the IMo through the online server, for a big number of detectors it would become slow, and it was much faster locally in that case).
Of course, in general, this should not be the default way, especially for simulation production, as we lose the safety that we get from using the server remotely, but I can imagine it being useful for some tests or quick debugging.

The button to download the tarball appears in the home page, in the release table:
image

@ziotom78 I cannot find why, but after uncompressing the downloaded tarball, the files are all inside a parent folder called "release". I wanted to change the name of this folder to be the release version, but I cannot find anywhere the explicit (or implicit) definition of this "release" default name. Do you know where it comes from?

@mj-gomes mj-gomes marked this pull request as draft March 24, 2026 17:32
@ziotom78
Copy link
Copy Markdown
Owner

Hi Miguel, it seems that something went wrong because I see LiteBIRD stuff in this commit (logos, messages, the focal plane view…). Probably you did your work in the LiteBIRD fork and now you copied it into the original InstrumentDB repo.

Apart from this, it is a fantastic addition! I tried to implement this in the past, but I wasn't sure how to do it because I feared the “tar-of-death”: Eventually, I expect that the overall amount of data files in a release will become quite large, possibly tens of gigabytes, and thus the creation of the file will take considerable time, possibly freezing the webserver. At the time I thought that a possible solution would be to create a tarball manually using the command line and upload it to a dedicated file server (possibly optimized in some way and load-balanced, so that multiple downloads can be running at the same time); then one would just put a link to that server in the release page. It seems that you solved this problem by creating the table when the release is added to the database, which is the simplest yet most effective solution! I love it!

I checked the source code to find the reason of the release folder, but it seems that you import the tarfile package (in line 44 of models.py) without using it. Am I missing something?

@mj-gomes
Copy link
Copy Markdown
Contributor Author

mj-gomes commented Mar 24, 2026

Hi Maurizio,

Hi Miguel, it seems that something went wrong because I see LiteBIRD stuff in this commit (logos, messages, the focal plane view…). Probably you did your work in the LiteBIRD fork and now you copied it into the original InstrumentDB repo.

I wanted to open this PR in the litebird fork, not in here. And the changes related to litebird are in there because I built this on a branch on top of the other branch that I opened in the litebird fork in which I have been doing the changes to the website design, adding the focal plane visualization etc (this one). But if this can be merged into the main repo, I will just remove the other changes from this PR.

I checked the source code to find the reason of the release folder, but it seems that you import the tarfile package (in line 44 of models.py) without using it. Am I missing something?

I am not sure, I did some back and forth trying to fix this detail and in the process I might have left some unused variable or package, indeed. I will look better at this. Anyway, it is working and creating a tar.gz file as of now.

@mj-gomes
Copy link
Copy Markdown
Contributor Author

I am closing this PR because I built a cleaner one that does not have the litebird fork specificities in #167.

@mj-gomes mj-gomes closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants