< 132023-03-14⋎15 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
03:31*ian_vai[m] has joined
03:39ian_vai[m]hi guys. im looking at farm management systems for a co-op im helping out with. im looking at farmOS's suitability for them. i've installed a dev environment with docker and there are two things right off the bat that im hoping someone wouldn't mind helping with?
03:39ian_vai[m]1) page loads are very slow. between 10secs-60secs, which is strange because it running locally right?
03:39ian_vai[m]2) the default map only shows openstreetmaps base layer, with no option for satellite layers making it difficult to map locations. can someone help me get a satellite layer in place?
03:39ian_vai[m]i am very intrigued with farmOS i especially like the sound of field kit and the aggregator, so i hope i can get this going for them.
04:34ian_vai[m]i managed to figure out question 2, by going 'administration > extend' then ticked the 'farmOS mapbox'. ticking this made the mapbox option appear in the 'settings > map' section. here i was able to input a mapbox api key.
04:34ian_vai[m]however page load times are still pretty painful average about 10secs, doesnt matter what page it is. i took some screenshots of the network tab of inspector tools
04:35*uploaded an image: (70KiB) < libera.ems.host/_matrix/media/v3/downloa >
04:35*uploaded an image: (114KiB) < libera.ems.host/_matrix/media/v3/downloa >
04:36ian_vai[m]s/however page load times are still pretty painful average about 10secs, doesnt matter what page it is. i took some screenshots of the network tab of inspector tools/however page load times are still pretty painful averaging about 10secs, doesnt matter what page it is. i took some screenshots of the network tab of inspector tools of a page load that took 54secs./
04:43paul121[m]Hello and welcome ian_vai !
04:45paul121[m]Re: the page loads, I wonder if this might be related to your docker filesystem. I know on MacOS there had been some pretty bad performance but there are some things you can do. Not so sure about windows. And generally works best on Linux :-) What operating system are you using?
04:46ian_vai[m]currently running it on windows10
04:47ian_vai[m]i might give it a try on linux and see how it goes
04:47ian_vai[m]a quick question about using FarmOS. I
04:49ian_vai[m] * a quick question about using FarmOS.
04:49ian_vai[m]If I have a Land asset, and on that piece of land i have a garden bed of 1000 ginger. what is the best way to record that?
04:49ian_vai[m]so far i have the land as an asset, the bed as an asset with the land as the parent, but how would you recommend i add the ginger?
04:53paul121[m]With windows it might be related to the WSL linux subsystem. Your docker volume may be in the windows filesystem C:\ - but I think you want the volume to be in the linux filesystem. I have never configured this myself though :-)
04:53ian_vai[m]paul121[m]: thanks for the tip, ill look into it
04:55paul121[m]> <@ian_vai:matrix.org> a quick question about using FarmOS.
04:55paul121[m]> If I have a Land asset, and on that piece of land i have a garden bed of 1000 ginger. what is the best way to record that?
04:55paul121[m]> so far i have the land as an asset, the bed as an asset with the land as the parent, but how would you recommend i add the ginger?
04:55paul121[m]Good question! I might recommend you create a single `plant` asset that represents that planting of ginger. You could use a seeding/transplanting log to record that total quantity that was planted and include additional data like row spacing
04:56paul121[m] * Good question! I might recommend you create a single `plant` asset that represents that planting of ginger. You could use a seeding/transplanting log to record that total quantity (1000) that was planted and include additional data like row spacing
04:58paul121[m]When you create the seeding/transplanting log it can also be created as a "movement log" to say the ginger plant asset is located in your bed
04:58paul121[m]You should try the planting quick form if you haven't already seen that
05:00ian_vai[m]recording the qty of 1000 as part of a seeding or transplating log, would that qty be attached to the ginger plant? so in theory we could generate a report of all ginger growing? for example a log of 1000 planted, another log of 500 planted, another log of 50 planted. a report could be made to say that there are 1550 ginger across all lands?
05:03paul121[m]yep! The qty would not be directly linked to the ginger plant, but go through via the seeding log. Plant -> log -> quantity
05:05paul121[m]I think you could get most of that data you would need for the report on the /quantities page too, just filter down to what makes sense
05:05ian_vai[m]thanks. i think i get it. i will experiment.
05:05paul121[m](you can copy or bookmark the URL after you add filters and save it for later!)
05:06ian_vai[m]paul121[m]: ooo nice tip 👍️. thanks for your help paul
05:11ian_vai[m]one more thing, sorry. how do you use tag id, tag type, tag location?
05:24paul121[m]no worries!
05:25paul121[m]ID tags are a flexible tagging system for all asset types. It could be an animal ear tag, tattoo, serial number or even an ID tag on a tree
05:25paul121[m]Modules can provide additional tag types
08:13ian_vai[m]is there anyone on the chat that is using FarmOS for managing fruit and vege that would mind sharing how they are using it? Im struggling to get the results im after.... (full message at <libera.ems.host/_matrix/media/v3/downloa>)
08:13*uploaded an image: (1142KiB) < libera.ems.host/_matrix/media/v3/downloa >
08:14*uploaded an image: (112KiB) < libera.ems.host/_matrix/media/v3/downloa >
08:16ian_vai[m]is there a way to get the log/inventory data out as json?
08:37ian_vai[m]<ian_vai[m]> "is there a way to get the log/..." <- looks like you can using the farmOS API (farmos.org/development/api/) and farmOS.js (farmos.org/development/farmos-js/).
08:37ian_vai[m]If I can use these to talk to my server I might be able to custom build some charts that achieve the desired result 🤞
08:37ian_vai[m]respect to you guys building this stuff. looks like you are covering all bases. nice work team 👏
11:34mstenta[m]ian_vai: if you click through to a specific plant asset you should see the "current inventory" of it
11:35mstenta[m]this is "computed" based on the quantities in the logs... if you use "increments" then it will add them up. or if you use "reset" then it will reset the inventory to that value.
11:36mstenta[m]asset inventory is available via the API on the individual asset records too - so you can get a current inventory of each asset that way
11:36mstenta[m]note that the log must be "done" and the log's timestamp must be passed (otherwise it's a future inventory, not current inventory)
11:36mstenta[m]this describes the details of the logic that farmOS provides: farmos.org/model/logic/inventory/
11:37mstenta[m]it's also possible to pull log records via the API and calculate the inventory yourself using the same logic
11:39mstenta[m]> is there a way to get the log/inventory data out as json?
11:39mstenta[m]fyi, you are basically dealing with three different types of records: `asset`, `log`, and `quantity`
11:39mstenta[m]the inventory value will be stored in a quantity record that is attached to a log record
11:39mstenta[m]the quantity's inventory_asset field references the asset you're adjusting the inventory of
11:58lordeddi[m]Hi, i'm trying to build a docker image on rpi4 and maybe i'm getting in a 🐰🕳️ unnecessarily, but in the Dockerfile i set `ARG FARMOS_VERSION=2.0.1"
11:58lordeddi[m]and `ARG PROJECT_VERSION=2.x`
11:58lordeddi[m]when the `build_farmos.sh` runs composer it says: `Syncing farmos/farmos (2.0.2) into cache`
11:58lordeddi[m] * Hi, i'm trying to build a docker image on rpi4 and maybe i'm getting in a 🐰🕳️ unnecessarily, but in the Dockerfile i set `ARG FARMOS_VERSION=2.0.1" and `ARG PROJECT\_VERSION=2.x`when the`build_farmos.sh` runs composer it says:`Syncing farmos/farmos (2.0.2) into cache`
11:58lordeddi[m] * Hi, i'm trying to build a docker image on rpi4 and maybe i'm getting in a 🐰🕳️ unnecessarily, but in the Dockerfile i set ARG FARMOS_VERSION=2.0.1 and ARG PROJECT\_VERSION=2.x when thebuild_farmos.sh runs composer it says:Syncing farmos/farmos (2.0.2) into cache
13:10mstenta[m]lordeddi: are you building the "production" docker image or the "dev" one?
13:11lordeddi[m]hm.. not sure 😅 i guess i started from the dev code
13:11mstenta[m]what steps are you taking exactly? cloning the farmOS repo, checking out the version tag you want, changing to the docker directory, and running docker build?
13:11lordeddi[m]i cloned the farmos git and checked out the commit tagged 2.0.1 started from there
13:11lordeddi[m]and changed that Dockerfile
13:12FarmerEd[m]I've images on docker hub if you want
13:12mstenta[m]you don't need to edit the Dockerfile, instead you can pass a build argument like: `docker build --build-arg FARMOS_VERSION=2.0.1
13:12mstenta[m] * you don't need to edit the Dockerfile, instead you can pass a build argument like: `docker build --build-arg FARMOS_VERSION=2.0.1`
13:12lordeddi[m]thanks Farmer Ed i wanted to build myself to go through the motions :D
13:13FarmerEd[m]Np
13:13mstenta[m]if you are building the dev image, then you first need to build a farmos/farmos:2.x image, because that is what the dev image is based on
13:13lordeddi[m]i was aiming for a production image
13:13mstenta[m]so something like docker build --build-arg FARMOS_VERSION=2.0.1 -t farmos/farmos:2.x .
13:14mstenta[m]ok cool, then you won't need to do anything in the docker/dev directory
13:14mstenta[m]only in the docker directory
13:14lordeddi[m]thanks! will try that
13:15lordeddi[m]after that i will need to upgrade to 2.0.2 😆
13:15mstenta[m]i'm not sure if that explains/fixes your issue though - that's just some background
13:15lordeddi[m]not to worry, i will see what that build-arg does and read the logs etc
13:15lordeddi[m]i forgot how to check the version of a running instance
13:16mstenta[m]you shouldn't need to set PROJECT_VERSION - that defaults to 2.x
13:16mstenta[m]normally you can find the version in /api under meta.farm
13:16mstenta[m]or in the UI in /admin/reports/status
13:16lordeddi[m]mstenta[m]: my goal is to create a production image for 2.0.1 so i can move an existing instance which is on version 2.0.1
13:16mstenta[m]but... that assumes that version was set in the farm.info.yml file - which build-farm.sh does
13:17mstenta[m]makes sense!
13:23mstenta[m]here is roughly how it's supposed to work:... (full message at <libera.ems.host/_matrix/media/v3/downloa>)
13:25mstenta[m]> `Syncing farmos/farmos (2.0.2) into cache`
13:25mstenta[m]If you are seeing this, then I wonder if #3 is not happening... and the project `composer.json` is still `^2.0`
14:03lordeddi[m]hm, i need to run it again i think (i lost the log). the /admin/reports/status said 2.0.1 though
14:04lordeddi[m]will try that docker --build-arg
14:26mstenta[m]oh good - maybe it worked then
14:27lordeddi[m]mstenta[m]: yeah maybe, under report/status it tells me `Mismatched entity and/or field definitions` + `The Client ID field needs to be updated.`
14:27lordeddi[m]maybe, i have created a monster 👾
14:28mstenta[m]Ah ok no that's OK
14:28mstenta[m]Farmer Ed ran into that too
14:28lordeddi[m]cool
14:28mstenta[m]so wait though... you said you are just moving from 2.0.1 to 2.0.1?
14:28mstenta[m]did you have that error originally before this?
14:29lordeddi[m]i don't think i had that error before, is that a v2.0.2 thing maybe?
14:29lordeddi[m]i have to admint, i dont visit that report/status page often
14:31mstenta[m]no it was an issue between beta and 2.0.0
14:31mstenta[m]so maybe it already existed
14:32lordeddi[m]considering i am only playing with moving an existing instance to a rpi docker image which i am building -> don't spend too much time on my issues, they are quite unimportant :D
14:32lordeddi[m]meaning: i don't wanna steal too much time of yall
14:32mstenta[m]k, and yea that issue is not hard to fix
14:33mstenta[m]it may even be harmless
14:33FarmerEd[m]but needs to be fixed for API to work
14:33mstenta[m]Farmer Ed: did you find that your API didn't work with that?
14:33mstenta[m]ok that's what i was wondering...
14:33FarmerEd[m]^^
14:33mstenta[m]that error has actually come up a few times
14:34mstenta[m]and the most recent one was technically harmless if i remember correctly
14:34mstenta[m]so maybe you actually had an older one Farmer Ed and that's why it broke
14:34mstenta[m]well, in that case maybe lordeddi should just do what you did... delete the client, clear the cache, recreate the client?
14:34FarmerEd[m]I went from beta7 to 2.0.1
14:34lordeddi[m]i did not clear the caches yet
14:35FarmerEd[m]but my consumers were setup in a much earlier beta
14:35FarmerEd[m]lordeddi[m]: and run update.php
14:36mstenta[m]well if you aren't actually updating lordeddi and you're just copying the database from one machine to another you shouldn't need to run update.php, but clearing the caches never hurts
14:38mstenta[m]> delete the client, clear the cache, recreate the client?
14:38mstenta[m]actually there was more to it than this, huh? you also used drush entity-updates?
14:38FarmerEd[m]ah ok........... at least it always tells you if there are changes needed or not, though because he was importing an existing database (and site files?) it might be needed
14:39FarmerEd[m]> <@mstenta:matrix.org> > delete the client, clear the cache, recreate the client?
14:39FarmerEd[m]>
14:39FarmerEd[m]> actually there was more to it than this, huh? you also used drush entity-updates?
14:39FarmerEd[m]yes but that is depreciated so I installed deval temporarily
14:39mstenta[m]yup yup
14:39mstenta[m]that might actually be the easiest way...
14:39FarmerEd[m]did paul121 have a simpler solution?
14:40mstenta[m]well... i may have been thinking about the more recent change, which did not break the API
14:41FarmerEd[m]composer require 'drupal/devel_entity_updates'
14:41FarmerEd[m]drush en devel_entity_updates
14:41FarmerEd[m]drush entity-updates
14:41mstenta[m]the other option is to uninstall farm_api, consumers, and simple_oauth and then re-install farm_api
14:41*uploaded a video: (1380KiB) < libera.ems.host/_matrix/media/v3/downloa >
14:41mstenta[m]that will essentially rebuild the database tables for those modules
14:42FarmerEd[m]Yea, I avoided that as there were some more dependencies on it I thought?
14:43mstenta[m]Yea maybe, that's what I was thinking when I said:
14:43mstenta[m]> that might actually be the easiest way...
14:43mstenta[m]:-)
14:45FarmerEd[m]symbioquine[m]: I🤓 wow
14:45FarmerEd[m]it's like some form of witchcraft
14:45symbioquine[m]TL;DW; Teases a simple UI for creating asset action plugins in Asset Link
14:46lordeddi[m]running docker build --build-arg FARMOS_VERSION=2.0.2 -t farmotag shows Step 3/21 : ARG FARMOS_VERSION=2.x in the logs, that okay?
14:46mstenta[m]lordeddi: yes that's OK
14:47symbioquine[m]I'm taking notes on both these topics Farmer Ed & lordeddi since I expect to need to overcome both sets of challenges...
14:47mstenta[m]symbioquine: stop blowing my mind
14:47lordeddi[m]woa symbioquine !!
14:47mstenta[m]also: you should make a mastodon feed just for asset link vids like this
14:48mstenta[m]i guess you have them in the forum...
14:48mstenta[m]but still haha
14:48FarmerEd[m]mstenta[m]: I agree
14:49mstenta[m](it would give our @farmOS account some posts to Boost too!)
14:50*uploaded an image: (23KiB) < libera.ems.host/_matrix/media/v3/downloa >
14:50lordeddi[m]clearing caches did not resolve that report/status client id error thinkgy
14:50lordeddi[m]s/thinkgy/thingy/
14:50lordeddi[m]and on that update it says its done?
14:51FarmerEd[m]> <@farmer-ed:matrix.org> ```... (full message at <libera.ems.host/_matrix/media/v3/downloa>)
14:52FarmerEd[m]composer require 'drupal/devel_entity_updates'
14:52FarmerEd[m]drush en devel_entity_updates
14:52FarmerEd[m]drush entity-updates
14:52mstenta[m]yea it's a bit more involved than just clearing caches lordeddi :-/
14:52lordeddi[m]that's okay, thanks for the help
14:53mstenta[m]Farmer Ed's commands should work. take a database snapshot beforehand to be safe
14:53FarmerEd[m]Then
14:53FarmerEd[m]Clear cache / run cron
14:53FarmerEd[m]create new consumers
14:53FarmerEd[m]Uninstall devel
14:53mstenta[m](if you don't already have one)
14:53FarmerEd[m]and that but I presume there is as it's a migration isn't it?
14:53mstenta[m]alternatively... (i'm testing out the consumers uninstall locally`
14:55mstenta[m]actually this might not be too bad...
14:55mstenta[m]lordeddi: you can try this...
14:56mstenta[m]1. go to /admin/config/services/consumer and delete all your consumers
14:56mstenta[m]2. drush pm-uninstall -y consumers
14:56mstenta[m]3. drush en -y farm_api
14:56mstenta[m]take a db snapshot first
14:56lordeddi[m]darn, i just started that composer command ...
14:56mstenta[m]oh well :-)
14:56lordeddi[m]it's already done, that 1st command of Farmer Ed
14:57mstenta[m]cool - continue with that then
14:57lordeddi[m]okay
14:57lordeddi[m]sorry !
14:57mstenta[m]all good! two ways to do the same thing
14:57lordeddi[m]i like how you keep repeating "take a db snapshot first" very wise :D
14:58mstenta[m]can't say that enough
14:58FarmerEd[m]experience
14:58lordeddi[m]yes to both :D
14:59mstenta[m]the most important "state" information for drupal is in the db
14:59lordeddi[m]it worked. the error is gone
14:59mstenta[m]and it's possible to break that state
14:59mstenta[m]it's easy to revert code... only easy way to revert db is with a snapshot
15:00mstenta[m]lordeddi: k so now you can "clean up" after those commands:
15:00mstenta[m]drush pm-uninstall devel_entity_updates
15:00mstenta[m]that will uninstall the module from the drupal db
15:01mstenta[m]you can just leave the module code that composer downloaded... won't harm anything, and will go away next time you update
15:01mstenta[m]but if you don't uninstall the module, and then update, it will error because it will try to look for that module code
15:01mstenta[m](you may want to do that too Farmer Ed if you haven't already)
15:01lordeddi[m]i ran it, and it said it deleted that devel_entity_updates, so i guess i'm good
15:02mstenta[m](depends on what you're mounting in the container... whether or not that will be an issue for you in the future)
15:02FarmerEd[m]just check that devel is also uninstalled
15:03mstenta[m]note that devel and devel_entity_updates are two different modules...
15:04lordeddi[m]so i do need to drush pm-uninstall for the devel too
15:04FarmerEd[m]yes, but I think devel was installed as a dependency
15:04mstenta[m]oh actually lordeddi that may mean you also need to `drush pm-uninstall devel` - i forget if it is a dependency)
15:04mstenta[m]yes i think so
15:05mstenta[m]composer require drupal/devel_entity_updates probably downloaded both www.drupal.org/project/devel/ and www.drupal.org/project/devel_entity_upda
15:05mstenta[m]and drush en devel_entity_updates probably installed both
15:05lordeddi[m] [success] Successfully uninstalled: devel
15:05mstenta[m]cool! well hopefully you're all good now (on stable and updated) so you won't run into that issue again :-)
15:06FarmerEd[m]You'll need to create new consumers now if using the API
15:06mstenta[m]oh yea true
15:06lordeddi[m]thanks all
15:06mstenta[m]> 1. go to /admin/config/services/consumer and delete all your consumers
15:06mstenta[m]> 2. drush pm-uninstall -y consumers
15:06mstenta[m]> 3. drush en -y farm_api
15:06mstenta[m]this would have done that too, fwiw
15:06mstenta[m]but actually... here...
15:07mstenta[m]that will recreate the consumer
15:07mstenta[m]1. go to /admin/config/services/consumer and delete all your consumers
15:07mstenta[m]2. drush pm-uninstall -y farm_api
15:07mstenta[m]3. drush en -y farm_api
15:08mstenta[m]so probably would have been easiest to just do that in the first place 😄 🤷
15:08lordeddi[m]> <@mstenta:matrix.org> 1. go to /admin/config/services/consumer and delete all your consumers
15:08lordeddi[m]> 2. drush pm-uninstall -y farm_api
15:08lordeddi[m]> 3. drush en -y farm_api
15:08lordeddi[m]`[success] Successfully enabled: farm_api`
15:08mstenta[m](only difference is my first one also uninstalled consumers... but that isn't necessary now that you've run entity updates)
15:09mstenta[m]cool - you should see the default consumer in the UI now
15:09mstenta[m](created by farm_api install)
15:11FarmerEd[m]Yea, I was just trying to avoid uninstalling modules with dependenceys,didn't know how far back that chain might have gone
15:12FarmerEd[m]Plus I don't use the default consumer settings anyway
15:12mstenta[m]ah yea
15:14FarmerEd[m]I guess this will come up a again for others so no harm having the simplest solution documented
15:15mstenta[m]> I'm taking notes on both these topics Farmer Ed & lordeddi since I expect to need to overcome both sets of challenges...
15:15mstenta[m]👀
15:16mstenta[m]> 1. go to /admin/config/services/consumer and delete all your consumers
15:16mstenta[m]> 2. drush pm-uninstall -y consumers
15:16mstenta[m]> 3. drush en -y farm_api
15:16mstenta[m]symbioquine: for your notes^
15:16mstenta[m]> yeah maybe, under report/status it tells me `Mismatched entity and/or field definitions` + `The Client ID field needs to be updated.`
15:16mstenta[m]if you run into this^
15:21mstenta[m]> > Learn how to use Python scripting and farmOS.py to work with #farmOS data: farmos.org/blog/2023/quick-intro-to-pyth
15:21mstenta[m]fosstodon.org/@farmOS/110022310994235108
15:36FarmerEd[m]That python scripting blog is great, posts like that will really make the blog worthwhile
15:37mstenta[m]agreed! well done symbioquine (and paul121 for review/feedback/etc)
15:39symbioquine[m]Thanks 😁
15:40symbioquine[m]To be fair, a lot of the same info is in the docs: farmos.org/development/farmos-py/
15:41symbioquine[m]So credit for that all goes to paul121
15:42paul121[m]and those docs are inspired by farmOS.js so some credit to jgaehring - it's a community effort round here :-))
15:43FarmerEd[m]It is but more examples the better, especially for us more amateur coders.

< 132023-03-14⋏15 >