Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@artivis
Copy link
Contributor

@artivis artivis commented Apr 18, 2023

This PR adds snap packaging which (eventually) allows to easily install the app on dozens on Linux distro,

sudo snap install basaran

Run it then with,

$ basaran
start listening on 0.0.0.0:8080

The snap sets by default,

  • PORT=8080 since 80 requires sudo
  • MODEL_CACHE_DIR=~/snap/basaran/common/models
  • SERVER_THREADS=4

They all can be overloaded by the user through the usual environment variables.

Together with the packaging comes a new workflow that runs the packaging and push the artifacts to the store. This being said, you would have to create an account on the store and generate a access token.

Note that I could only test it on my laptop (no discrete gpu) and thus may require some tweaking.

@codecov-commenter
Copy link

codecov-commenter commented Apr 19, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (6647066) 94.54% compared to head (34f67b2) 94.54%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #150   +/-   ##
=======================================
  Coverage   94.54%   94.54%           
=======================================
  Files           7        7           
  Lines         330      330           
=======================================
  Hits          312      312           
  Misses         18       18           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fardeon
Copy link
Member

fardeon commented Apr 19, 2023

Thank @artivis, this looks great! We will find a Linux machine with discrete GPUs to test it.

peakji
peakji previously approved these changes Apr 19, 2023
Copy link
Member

@peakji peakji left a comment

Choose a reason for hiding this comment

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

LGTM! We can tweak minor issues like the default branch name and access token name later. If @artivis confirms that the download command is okay, then let's merge! 🚀

@fardeon fardeon changed the title Add snap packaging build(snap): add snap packaging Apr 19, 2023
@artivis
Copy link
Contributor Author

artivis commented Apr 19, 2023

Thanks for the quick review.
I fixed the default branch in the snap ci workflow.

Copy link
Member

@fardeon fardeon left a comment

Choose a reason for hiding this comment

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

LGTM!

@fardeon fardeon merged commit ea5a694 into hyperonym:master Apr 19, 2023
@peakji
Copy link
Member

peakji commented Apr 19, 2023

Hi @artivis ! Sorry to bother you again, but we need some help regarding snap.

After this PR is merged, we did some cleanup to only build and publish on release. The first run of the workflow went smoothly, and I could see the package uploaded and waiting for release on the snapcraft web interface. However, the workflow has been failing since then, and we're a bit lost...

This is our first time to publish a package on snapcraft, and we appreciate your guidance! 🙏

@artivis
Copy link
Contributor Author

artivis commented Apr 19, 2023

Hey there no problem.

Looking at the failing job, it seems that you had a heavy hand while cleaning up. Indeed the variable "$grade" isn't defined anymore (unbound varible).

This being said, my bad for not giving you more context for this PR.

Snaps come with a whole release management system baked in. One can manage several releases of one's app depending on the status of the development stable/candidate/beta/edge.

To publish to stable/candidate, the snap grade must be marked as 'stable'. That's what's happening here on: the snap is marked as 'stable' solely on tags, therefore preventing to push ongoing developments to the stable/candidate releases.

Similarly, the ci originally built the snap for all change pushed to the master branch, but would push on-going development (no-tag) to edge and tags to candidate. The promotions edge->beta & candidate->stable are then expected to be done manually on the store web page after rigorous testing ;)

That's really one release management schema, others are definitely possible.

If you have further questions, feel free to ping me :)

@peakji
Copy link
Member

peakji commented Apr 20, 2023

Thank you for such a detailed response!

Looking at the failing job, it seems that you had a heavy hand while cleaning up. Indeed the variable "$grade" isn't defined anymore (unbound varible).

Oh I see! I thought the grade in snapcraft.yaml can be used as a variable. 😂

The promotions edge->beta & candidate->stable are then expected to be done manually on the store web page after rigorous testing ;)

This design is great! I'll test it on the web interface. We plan to gradually optimize our release process after implementing the chat API.

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.

4 participants