Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

integrate mini dashboard #153

Merged
merged 8 commits into from
Apr 26, 2021
Merged

integrate mini dashboard #153

merged 8 commits into from
Apr 26, 2021

Conversation

MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented Apr 20, 2021

This PR integrate the mini dashboard to transplant.

It adds a build feature mini-dashboard to statically add the mini-dashboard to the MeiliSearch binary. The mini-dashboard build feature is enabled by default and can be disabled by building MeiliSearch with cargo build --no-default-features.

  • Fetch the mini-dashboard from the Github release
  • Check that the SHA1 on the downloaded payload matches the one in the metadata
  • Unpack the mini dashboard in meilisearch-http/mini-dashboard
  • serve the mini-dashboard if the mini-dashboard feature is enabled
  • Update CI to build MeiliSearch with mini-dashboard for releases

close #87

Shasum check and build optimizations.

In order to make sure that the right bundle for the mini-dashboard is downloaded, its shasum is computed and compared to the one specified in the Cargo.toml. If the shasums match, them the shasum is written to the .mini-dashboard.sha1 file for later comparison. On subsequent builds, the build script will check that both the mini-dashboard assets and the shasum file are found and that the shasum file content matches the one from the toml file. It will only preform a re-generation on the static dashboard files if it finds that either the dashboard is not present where it expects it to be, or if it finds out that it is outdated, by comparing the shasums.

Notes

I had to rely on a custom patch of actix-web-static-files, to support actix-web 4 beta6. there is currently a pr on the official repo to support actix-web 4, but it most likely won't be merged until actix is stabilized.

@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch from 77cf1d1 to 6af769a Compare April 22, 2021 08:45
@MarinPostma MarinPostma marked this pull request as ready for review April 22, 2021 12:42
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

That's a great addition, I hope actix will be out of beta soon and we will be able to use a non-beta release of this new actix-web-static-files crate.

.github/workflows/create_artifacts.yml Outdated Show resolved Hide resolved
meilisearch-http/Cargo.toml Outdated Show resolved Hide resolved
meilisearch-http/build.rs Outdated Show resolved Hide resolved
meilisearch-http/build.rs Outdated Show resolved Hide resolved
meilisearch-http/src/error.rs Show resolved Hide resolved
meilisearch-http/src/main.rs Outdated Show resolved Hide resolved
@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch from 41d600d to 1a838be Compare April 22, 2021 16:34
@MarinPostma MarinPostma requested a review from Kerollmops April 22, 2021 16:35
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

That's a great addition to the project.

Could you describe the new process with the sha1 check in the PR head message, please?

.github/workflows/create_artifacts.yml Outdated Show resolved Hide resolved
meilisearch-http/build.rs Outdated Show resolved Hide resolved
meilisearch-http/build.rs Outdated Show resolved Hide resolved
meilisearch-http/src/main.rs Outdated Show resolved Hide resolved
meilisearch-http/Cargo.toml Outdated Show resolved Hide resolved
meilisearch-http/Cargo.toml Show resolved Hide resolved
meilisearch-http/Cargo.toml Outdated Show resolved Hide resolved
@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch 2 times, most recently from 4bbee4a to f06f367 Compare April 26, 2021 08:18
@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch from f06f367 to c2461e5 Compare April 26, 2021 08:20
curquiza
curquiza previously approved these changes Apr 26, 2021
Copy link
Member

@curquiza curquiza 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 the explanations!
It works on my machine 🎉

Wouldn't it be interesting to add meilisearch-http/.mini-dashboard.sha1 and meilisearch-http/mini-dashboard/ to the .gitignore?

Kerollmops
Kerollmops previously approved these changes Apr 26, 2021
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, could you just make sure that the gitignore is updated as curqui said?

@MarinPostma MarinPostma dismissed stale reviews from Kerollmops and curquiza via 6a7f4eb April 26, 2021 16:20
@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch from 6a7f4eb to e434b7d Compare April 26, 2021 16:20
@MarinPostma MarinPostma force-pushed the integrate-mini-dashboard branch from e434b7d to 77481d7 Compare April 26, 2021 16:21
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you! You can merge!

@MarinPostma
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Apr 26, 2021

Build succeeded:

@bors bors bot merged commit 9e6a7e3 into main Apr 26, 2021
@bors bors bot deleted the integrate-mini-dashboard branch April 26, 2021 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fetch and serve the mini-dashboard
3 participants