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

Upgrade watcher dependencies #923

Merged
merged 4 commits into from
Feb 26, 2024
Merged

Upgrade watcher dependencies #923

merged 4 commits into from
Feb 26, 2024

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Feb 26, 2024

Rationale

Maintenance

Changes

All related to the watcher:

  • Upgrade to python:3.12-alpine and upgrade and pin all Python dependencies
  • Add --runonce argument (boolean flag) to run the watch only once, typically useful for testing (manually for now, but also automatically one day)
  • Add CONTRIBUTING.md
  • Simplify --threads default value (logic to detect if we are running inside Docker is not working anymore / does not provides lots of value)

Testing

Call below succeeds to upload file to S3 and schedule recipe on first call, and to check file is still OK on second call.

docker run -it --rm -e ZIMFARM_API_URL=http://backend:8000/v1 -e S3_URL=$S3_URL --network zimfarm_default local-zf-watcher watcher --zimfarm-username admin --zimfarm-password admin --only tezos.stackexchange.com --runonce

First call:

[2024-02-26 09:22:42,876::INFO] 
  __                                         _       _
 / _| __ _ _ __ _ __ ___      __      ____ _| |_ ___| |__   ___ _ __
| |_ / _` | '__| '_ ` _ \ ____\ \ /\ / / _` | __/ __| '_ \ / _ \ '__|
|  _| (_| | |  | | | | | |_____\ V  V / (_| | || (__| | | |  __/ |
|_|  \__,_|_|  |_| |_| |_|      \_/\_/ \__,_|\__\___|_| |_|\___|_|


[2024-02-26 09:22:42,876::INFO] Testing S3 credentials
[2024-02-26 09:22:43,915::INFO] Testing Zimfarm credentials with http://backend:8000/v1…
[2024-02-26 09:22:44,116::INFO] Starting watcher:
  with zimfarm username: admin
  using cache: s3.eu-central-2.wasabisys.com
  with bucket: org-kiwix-dev-benoit
  only for:
   - tezos.stackexchange.com
[2024-02-26 09:22:44,116::INFO] Checking StackExchange version…
[2024-02-26 09:22:46,668::INFO] Latest online version: 2023-12. Comparing with S3…
[2024-02-26 09:22:46,707::INFO]  [+] tezos.stackexchange.com.7z
[2024-02-26 09:22:46,707::INFO]  [tezos.stackexchange.com] Getting recipes depending on it
[2024-02-26 09:22:46,766::INFO]  [tezos.stackexchange.com] Removed requested task on Zimfarm.
[2024-02-26 09:22:46,805::INFO]  [tezos.stackexchange.com] Downloading…
[2024-02-26 09:22:50,753::INFO]  [tezos.stackexchange.com] Download completed
[2024-02-26 09:22:50,753::INFO]  [tezos.stackexchange.com] Uploading to S3…
[2024-02-26 09:22:51,099::INFO]  [tezos.stackexchange.com] Uploaded
[2024-02-26 09:22:51,100::INFO]  [tezos.stackexchange.com] Local file removed
[2024-02-26 09:22:51,100::INFO]  [tezos.stackexchange.com] Scheduling recipe on Zimfarm
[2024-02-26 09:22:51,131::INFO]  [tezos.stackexchange.com] scheduled: 32f587bb-1f43-47f1-9dd2-1c679c30499e
[2024-02-26 09:22:51,132::INFO] Done.

Second call:

[2024-02-26 09:22:54,117::INFO] 
  __                                         _       _
 / _| __ _ _ __ _ __ ___      __      ____ _| |_ ___| |__   ___ _ __
| |_ / _` | '__| '_ ` _ \ ____\ \ /\ / / _` | __/ __| '_ \ / _ \ '__|
|  _| (_| | |  | | | | | |_____\ V  V / (_| | || (__| | | |  __/ |
|_|  \__,_|_|  |_| |_| |_|      \_/\_/ \__,_|\__\___|_| |_|\___|_|


[2024-02-26 09:22:54,117::INFO] Testing S3 credentials
[2024-02-26 09:22:55,236::INFO] Testing Zimfarm credentials with http://backend:8000/v1…
[2024-02-26 09:22:55,435::INFO] Starting watcher:
  with zimfarm username: admin
  using cache: s3.eu-central-2.wasabisys.com
  with bucket: org-kiwix-dev-benoit
  only for:
   - tezos.stackexchange.com
[2024-02-26 09:22:55,435::INFO] Checking StackExchange version…
[2024-02-26 09:22:57,934::INFO] Latest online version: 2023-12. Comparing with S3…
[2024-02-26 09:22:57,972::INFO] All synced up.
[2024-02-26 09:22:57,973::INFO] Done.

@benoit74 benoit74 self-assigned this Feb 26, 2024
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@9ae1996). Click here to learn what that means.

❗ Current head 5f5286c differs from pull request most recent head 2864f40. Consider uploading reports for the commit 2864f40 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #923   +/-   ##
=======================================
  Coverage        ?   87.84%           
=======================================
  Files           ?       93           
  Lines           ?     5297           
  Branches        ?        0           
=======================================
  Hits            ?     4653           
  Misses          ?      644           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 marked this pull request as ready for review February 26, 2024 09:34
@benoit74 benoit74 requested a review from rgaudin February 26, 2024 09:34
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Good 👍

@benoit74 benoit74 merged commit f02f400 into main Feb 26, 2024
5 checks passed
@benoit74 benoit74 deleted the upgrade_watcher branch February 26, 2024 10:56
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