Announcement

Collapse
No announcement yet.

When developing a plugin, where should I put it in the Docker container?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Ok, I've put the 'release' code in place in the same way (in the docker container) and I'm seeing the behaviour. So it's either:
    1. The version of LMS running in the Docker container is newer than the one in my VM
    2. There's an issue with the way I've installed the plugin in the container


    The docker container reports version Logitech Media Server Version: 8.2.1 - 1649774087 @ Tue Apr 12 17:18:03 CEST 2022
    The VM reports Logitech Media Server Version: 8.2.0 - 1627922070 @ Tue Aug 3 11:37:35 CEST 2021

    Are there likely to have been any changes between those two? I thought I was checking for new Debian packages, but obviously I haven't updated it since around August last year. Is this likely to be an issue?

    Anyone?

    Andy
    Last edited by adhawkins; 2022-05-17, 20:08.

    Comment


      #17
      Just pulled the 8.2.0 tag in the container, and seeing the same behaviour. There's no evidence of my plugin code being called at all during the scanning process. I suspect some kind of installation issue perhaps?

      Will try installing the released plugin using the installer in LMS and see if that behaves any differently. I'm confused though!

      Andy

      Comment


        #18
        Do you have the same set of plugins in both installations?
        Michael

        "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
        (LMS: Settings/Information)

        Comment


          #19
          Not necessarily. Is that likely to affect it?

          Andy

          Comment


            #20
            Originally posted by adhawkins View Post
            Not necessarily. Is that likely to affect it?
            I wouldn’t say likely, but I wouldn’t rule it out.
            Michael

            "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
            (LMS: Settings/Information)

            Comment


              #21
              Could it be confused by having (once had) the original plugin with the same name in the Cache/InstalledPlugins area?
              Paul Webster
              Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
              and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

              Comment


                #22
                Anything is possible! I've cleared out the local files for the container a number of times though.

                Just tried making sure I have the same plugins enabled on the Docker instance as the VM one. One thought, is there a 'Virtual Libraries' plugin that needs to be enabled for Library Views to work?

                Andy

                Comment


                  #23
                  When developing a plugin,where should I put it in the Docker container?

                  > Just tried making sure I have the same plugins enabled on the Docker
                  > instance as the VM one. One thought, is there a 'Virtual Libraries'
                  > plugin that needs to be enabled for Library Views to work?


                  Start LMS with logging for server.plugins logging. Add some "warn"
                  statements to your plugin initialization, as that'll be logged, no
                  matter what the logging level. Just to see whether the scanner even
                  picks up your plugin.
                  Michael

                  "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                  (LMS: Settings/Information)

                  Comment


                    #24
                    Ok, I've done that. On my 'real' LMS server, I see entries for the initPlugin in both server.log and scanner.log.

                    However, on the Docker instance, I only see the entry in server.log. There is no mention of my plugin in scanner.log.

                    Can you think of any reason why this might be?

                    Andy

                    Comment


                      #25
                      When developing a plugin,where should I put it in the Docker container?

                      > Ok, I've done that. On my 'real' LMS server, I see entries for the
                      > initPlugin in both server.log and scanner.log.


                      What "that"? "warn" statements or regular debugging level changed?

                      Are you sure you're running exactly the same code in both environments?
                      Would the same plugin code run when executed in your normal environment?
                      I guess you checked your scanner.log for information about failure to
                      load the plugin?
                      Michael

                      "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                      (LMS: Settings/Information)

                      Comment


                        #26
                        God, this is so confusing.

                        I've just cleaned out the container and any mounts to it. Copied in the plugin from my working server to /config/cache/Plugins/SimpleLibraryViews. The Plugin directories shown in the Info page of the server are:

                        Plugin Folders: /config/cache/InstalledPlugins/Plugins, /lms/Plugins, /config/cache/Plugins

                        When I start the server up, I don't see any sign of the 'warn' logging that's in InitPlugin. However, the plugin is listed in the web interface, and if I make changes to its settings I get logging in the server log file showing that the settings have been updated.

                        Does this mean that the plugin isn't being loaded when the server starts?

                        I guess it comes back to the original question. If I want to work on the development of a plugin in the Docker container, where should I put the plugin files while working on them?

                        Andy

                        Comment


                          #27
                          When developing a plugin,where should I put it in the Docker container?

                          > When I start the server up, I don't see any sign of the 'warn' logging
                          > that's in InitPlugin. However, the plugin is listed in the web
                          > interface, and if I make changes to its settings I get logging in the
                          > server log file showing that the settings have been updated.
                          >
                          > Does this mean that the plugin isn't being loaded when the server
                          > starts?


                          No. If it wasn't loaded, then you wouldn't have any settings to change.

                          > I guess it comes back to the original question. If I want to work on the
                          > development of a plugin in the Docker container, where should I put the
                          > plugin files while working on them?


                          /config/cache/Plugins IMHO is the right place.

                          But why would you need to run Docker in development? Any system able to
                          run Docker should be able to run LMS from the source, IMHO.
                          Michael

                          "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                          (LMS: Settings/Information)

                          Comment


                            #28
                            Ok, so I'm putting them in the right place it seems. Just odd that I'm not seeing the initialisation messages then.

                            I chose to fire up a Docker container as it seemed the easiest way to keep everything self-contained. I'll spin up a VM and give things a try that way.

                            Andy

                            Comment


                              #29
                              When developing a plugin,where should I put it in the Docker container?

                              > Ok, so I'm putting them in the right place it seems. Just odd that I'm
                              > not seeing the initialisation messages then.


                              Maybe you can describe your Docker workflow? It should work, after
                              all... what image are you using? How are you building the container? How
                              are you running it?
                              Michael

                              "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                              (LMS: Settings/Information)

                              Comment


                                #30
                                I'm using the community container. Here's the full docker-compose file:

                                version: "3.5"
                                networks:
                                default:
                                name: lms

                                volumes:
                                music:
                                driver: local
                                driver_opts:
                                type: nfs
                                o: addr=nas.gently.org.uk
                                device: ":/mnt/data/music"

                                services:
                                lms:
                                container_name: lms
                                hostname: lms-docker
                                image: lmscommunity/logitechmediaserver:8.2.0
                                restart: unless-stopped
                                networks:
                                - default
                                ports:
                                - "9000:9000"
                                - "9090:9090"
                                - "3483:3483"
                                - "3483:3483/udp"
                                volumes:
                                # folder where lms stores its data (cache, logs, prefs)
                                - ./lms_storage:/config
                                # folder where lms should look for music
                                - music:/var/spool/music
                                # use time of host
                                - /etc/localtime:/etc/localtime:ro
                                - /etc/timezone:/etc/timezone:ro
                                # - ./Plugins/SimpleLibraryViews/SimpleLibraryViews:/config/cache/Plugins/SimpleLibraryViews
                                environment:
                                - PUID=1000
                                - PGID=1003
                                (the commented out volume is me trying to inject the local source directory for the plugin into the container. I've stopped doing that for now while I work out what's going on).

                                I run the container using 'docker-compose up -d'

                                That's basically all I'm doing.

                                Andy

                                Comment

                                Working...
                                X