Commit Graph

596 Commits

Author SHA1 Message Date
Ilya Kreymer
b40d599e17
operator fixes: (#834)
- just pass cid from operator for consistency, don't load crawl from update_crawl (different object)
- don't throw in update_config_crawl_stats() to avoid exception in operator, only throw in crawlconfigs api
2023-05-06 13:02:33 -07:00
Ilya Kreymer
f992704491 version: bump version to 1.5.0-beta.1 2023-05-06 00:31:03 -07:00
Tessa Walsh
4f121fb868
Update precompute migration to only update active workflows (#833) 2023-05-05 21:35:03 -07:00
Tessa Walsh
8281ba723e
Pre-compute workflow last crawl information (#812)
* Precompute config crawl stats

* Includes a database migration to move preciously dynamically computed crawl stats for workflows into the CrawlConfig model.

* Add crawls.finished descending index

* Add last crawl fields to workflow tests
2023-05-05 15:12:52 -07:00
sua yoo
9fcbc3f87e
Allow users to set max depth/hop out within scope (#816)
- Adds an input to the Workflow creation and edit form for specifying crawl depth. This input is conditionally shown for seeded crawls when the scope is set to "Pages on this domain", "Pages on this domain & subdomains" or "Custom page prefix". The "any" scope is also supported for backwards compatibility but is not shown by default or in new configs.
- API implementation: The depth value is set in the primary seed config, i.e. the first seed in seeds: [], not in the outer .config.depth property.
2023-05-05 14:26:48 -07:00
Henry Wilkinson
7409e0637e
Improves crawl detail files list truncation (#830) 2023-05-05 14:25:29 -07:00
sua yoo
0d23b45dac
Crawl workflow detail page improvements (#823)
Resolves #817
- Adds relevant action buttons to each Workflow detail tab header
- Adds "Delete" action menu item to crawls in Crawls tab
- Prevent automatically switching to "Watch" tab after running crawl from detail page
- Removes "Stop" confirmation prompt and only shows "Cancel" confirmation prompt if there are one or more pages crawled
- Replaces "Cancel" confirmation prompt with web component dialog (partially addresses Switch to in-page dialogue boxes #619)
- Fixes hash routing to fix going back with browser back button
2023-05-05 13:50:45 -07:00
Ilya Kreymer
aae0e6590e
Ensure Volumes are deleted when crawl is canceled (#828)
* operator:
- ensures crawler pvcs are always deleted before crawl object is finalized (fixes #827)
- refactor to ensure finalizer handler always run when finalizing
- remove obsolete config entries
2023-05-05 12:05:54 -07:00
Tessa Walsh
48d34bc3c4
Add option to list workflows API endpoint to filter by schedule (#822)
* Add option to filter workflows by empty or non-empty schedule

* Add tests
2023-05-05 12:05:19 -07:00
Tessa Walsh
542ad7a24a
Update scale in workflow when crawl scale is updated (#820) 2023-05-05 11:59:57 -07:00
Tessa Walsh
774ae518f4
Set crawl-stop in redis from operator when crawl is stopped (#815)
Change redis to <crawl-id>:crawl-stop to match webrecorder/browsertrix-crawler#303
2023-05-05 11:34:24 -07:00
Ilya Kreymer
8aac6ccb6a
add authsign block to microk8s playbook (#776) 2023-05-05 11:32:32 -07:00
sua yoo
85c96de883
Show critical errors in Crawl detail logs (#811) 2023-05-05 11:30:38 -07:00
Henry Wilkinson
53539425aa
Fix issue template bug label addition
Had the wrong value in there, it should now auto apply the right label
2023-05-04 15:13:35 -04:00
Henry Wilkinson
e18b0ce9ad
Update bug.yml
Fixes title field
2023-05-04 14:58:18 -04:00
Henry Wilkinson
0a165cc22d
Adds bug report issue template (#797)
Co-authored-by: sua yoo <sua@webrecorder.org>
2023-05-04 14:54:37 -04:00
Henry Wilkinson
7978cb4d85
Crawl detail page update (#808)
- Removes the info bar rendering and moves relevant information to the Overview section
- Adds total crawl size to the overview section
2023-05-03 15:50:15 -04:00
Henry Wilkinson
76c9185d69
Improve Recursive font declaration (#791) 2023-05-03 14:19:21 -04:00
Tessa Walsh
b2005fe389
Fix crawl /errors API endpoint (#813)
* Fix crawl error slicing to ensure a consistent number of errors per page
* Fix total count in paginated API response
2023-05-03 13:58:38 -04:00
sua yoo
60581411eb
Refactor screencast IDs (#800)
Fixes #713, mapping watch windows to exact column/row by id
2023-05-03 10:33:04 -07:00
sua yoo
9a1c2ba871
Fix workflow limit empty values being set to 0 (#795)
* default to null

* pass undefined for removing values

* handle 0 default
2023-05-03 09:25:22 -07:00
Henry Wilkinson
9500fd97fa
Merge pull request #802 from webrecorder/frontend-workflow-controls-update 2023-05-03 00:21:20 -04:00
Henry Wilkinson
a13964c4c4
Merge pull request #809 from webrecorder/frontend-icon-button-aria-label-fixes 2023-05-01 15:38:49 -04:00
Henry Wilkinson
ee92eb6646
Merge pull request #810 from webrecorder/frontend-minor-visual-updates 2023-05-01 15:38:37 -04:00
Henry Wilkinson
624e7083cf
Merge pull request #806 from webrecorder/frontend-update-copy-button 2023-05-01 15:38:22 -04:00
Henry Wilkinson
5957e0877b
Merge pull request #801 from webrecorder/frontend-replay-padding-removal 2023-05-01 15:35:39 -04:00
Henry Wilkinson
bddbe35315 Runs yarn format 2023-05-01 15:33:17 -04:00
Henry Wilkinson
088d6d306a Adds hoist to browser profile list actions dropdown
- Should fix bug where you can see the icon buttons through the dropdown
2023-05-01 03:27:59 -04:00
Henry Wilkinson
6e921cc065 Add margin to crawls list
Mirrors workflow list
2023-05-01 03:26:57 -04:00
Henry Wilkinson
23e398d327 Icon updates
- Changes `trash` for `trash3` which I believe wasn't originally available in the version of bootstrap-icons we were using but now it is and I like the tapered edges better :P
- Makes browser profiles action button small to fit with the rest of the dropdown components used elswhere
- Changes previous file-earmark delete icon to trash icons used everywhere else for delete actions
2023-05-01 03:26:34 -04:00
Henry Wilkinson
e04a6a7825 Improves icon button aria labels
- Adds some labels to missing icon buttons
- Fixes metadata `aria-label` usage → `label` so it actually gets added to the rendered `button`
- Changes the "More" label to a (hopefully) more descriptive "Actions" label for dropdown actions menus
2023-05-01 02:57:32 -04:00
Henry Wilkinson
1d7518af07 Ensure that button returns to its default state
uses the .blur() method to set the icon button back to its unfocused state after the set time
2023-04-29 17:17:49 -04:00
Henry Wilkinson
228e2187e3 Copy button text → icon
- Converts to icon button
- Adds accessibility label field
2023-04-28 14:53:11 -04:00
Henry Wilkinson
45826f8d70 Show only mine unification
Same styling as the finished crawls page
2023-04-28 13:38:23 -04:00
Henry Wilkinson
577942805b Moves dropdown beside search bar
- Improves responsiveness for top two items
2023-04-27 02:03:09 -04:00
Henry Wilkinson
81aeba6e92 Changes logout icon
- It's a door now instead of the box arrow
2023-04-27 00:46:42 -04:00
Henry Wilkinson
c359589024 Adds additional styling to the file picker
- Half aligned with current mockup!
2023-04-27 00:12:06 -04:00
Henry Wilkinson
c03bb1923b Removes extra padding around replay window
- Adds a check before the block of HTML that adds 16px of padding and tells it not to add that if it's the replay page.
2023-04-26 23:50:02 -04:00
Tessa Walsh
1a63c31b71
backend: errors endpoint: Parse JSON-l errors before returning (#799) 2023-04-26 14:36:48 -07:00
sua yoo
e6e46b522a
hotfix: prevent polling during workflow edit 2023-04-26 13:41:41 -07:00
sua yoo
937ad4fe08
fix: navigate to watch on new crawl work
follows #720
2023-04-25 14:30:41 -07:00
sua yoo
7888c4fde3
Frontend crawl workflows rework (#775) 2023-04-25 14:16:07 -07:00
Ilya Kreymer
7aefe09581
startup fixes: (#793)
- don't run migrations on first init, just set to CURR_DB_VERSION
- implement 'run once lock' with mkdir/rmdir
- move register_exit_handler() to utils
- remove old run once handler
2023-04-24 18:32:52 -07:00
Ilya Kreymer
60ba9e366f
Refactor to use new operator on backend (#789)
* Btrixjobs Operator - Phase 1 (#679)

- add metacontroller and custom crds
- add main_op entrypoint for operator

* Btrix Operator Crawl Management (#767)

* operator backend:
- run operator api in separate container but in same pod, with WEB_CONCURRENCY=1
- operator creates statefulsets and services for CrawlJob and ProfileJob
- operator: use service hook endpoint, set port in values.yaml

* crawls working with CrawlJob
- jobs start with 'crawljob-' prefix
- update status to reflect current crawl state
- set sync time to 10 seconds by default, overridable with 'operator_resync_seconds'
- mark crawl as running, failed, complete when finished
- store finished status when crawl is complete
- support updating scale, forcing rollover, stop via patching CrawlJob
- support cancel via deletion
- requires hack to content-length for patching custom resources
- auto-delete of CrawlJob via 'ttlSecondsAfterFinished'
- also delete pvcs until autodelete supported via statefulset (k8s >1.27)
- ensure filesAdded always set correctly, keep counter in redis, add to status display
- optimization: attempt to reduce automerging, by reusing volumeClaimTemplates from existing children, as these may have additional props added
- add add_crawl_errors_to_db() for storing crawl errors from redis '<crawl>:e' key to mongodb when crawl is finished/failed/canceled
- add .status.size to display human-readable crawl size, if available (from webrecorder/browsertrix-crawler#291)
- support new page size, >0.9.0 and old page size key (changed in webrecorder/browsertrix-crawler#284)

* support for scheduled jobs!
- add main_scheduled_job entrypoint to run scheduled jobs
- add crawl_cron_job.yaml template for declaring CronJob
- CronJobs moved to default namespace

* operator manages ProfileJobs:
- jobs start with 'profilejob-'
- update expiry time by updating ProfileJob object 'expireTime' while profile is active

* refactor/cleanup:
- remove k8s package
- merge k8sman and basecrawlmanager into crawlmanager
- move templates, k8sapi, utils into root package
- delete all *_job.py files
- remove dt_now, ts_now from crawls, now in utils
- all db operations happen in crawl/crawlconfig/org files
- move shared crawl/crawlconfig/org functions that use the db to be importable directly,
including get_crawl_config, add_new_crawl, inc_crawl_stats

* role binding: more secure setup, don't allow crawler namespace any k8s permissions
- move cronjobs to be created in default namespace
- grant default namespace access to create cronjobs in default namespace
- remove role binding from crawler namespace

* additional tweaks to templates:
- templates: split crawler and redis statefulset into separate yaml file (in case need to load one or other separately)

* stats / redis optimization:
- don't update stats in mongodb on every operator sync, only when crawl is finished
- for api access, read stats directly from redis to get up-to-date stats
- move get_page_stats() to utils, add get_redis_url() to k8sapi to unify access

* Add migration for operator changes
- Update configmap for crawl configs with scale > 1 or
crawlTimeout > 0 and schedule exists to recreate CronJobs
- add option to rerun last migration, enabled via env var and by running helm with --set=rerun_last_migration=1

* subcharts: move crawljob and profilejob crds to separate subchart, as this seems best way to guarantee proper install order with + update on upgrade with helm, add built btrix-crds-0.1.0.tgz subchart
- metacontroller: use release from ghcr, add metacontroller-helm-v4.10.1.tgz subchart

* backend api fixes
- ensure changing scale of crawl also updates it in the db
- crawlconfigs: add 'currCrawlSize' and 'lastCrawlSize' to crawlconfig api

---------

Co-authored-by: D. Lee <leepro@gmail.com>
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2023-04-24 18:30:52 -07:00
sua yoo
1458e2cdd9
hotfix: delete crawl workflow without crawls 2023-04-24 15:18:20 -07:00
Henry Wilkinson
81e4b6c2cf
Revert docs body font to Inter (#790)
* Revert docs body font to Inter

- Adds Inter V4 Beta variable font files
  - Main docs title in the nav retains Recursive as its typeface
- Updates text styling to use app-aligned typography
- Updates code blocks, now with distinct borders!
- Cleans up code blocks, moves like parts together

* font-weight fix

- Aligns with app font weight for titles
2023-04-22 08:46:21 -07:00
Ilya Kreymer
f6dc26eeb5
nginx: enable worker processes autotune to correctly set the number of processes for nginx, possible fix for #780 (#785) 2023-04-21 18:13:22 -07:00
Tessa Walsh
a2435a013b
Add totalSize to workflow API endpoints (#783) 2023-04-20 17:23:59 -04:00
Ilya Kreymer
3f41498c5c quickfix: fix typo, remove unnecessary async 2023-04-18 16:14:15 -07:00
Tessa Walsh
a9c1c54194
Make btrix helper work with microk8s (#768)
* Check for microk8s

* Use python3

* Add note about installing pytest

* Add chart/local.yaml to .gitignore to avoid committing
2023-04-18 08:50:46 -04:00