ucphhpc / docker-migrid

Containerized MiG
GNU General Public License v2.0
3 stars 7 forks source link

PR43 follow-up: replace the problematic nested volume mounts with bind mounts and add shared init volume container #55

Open jonasbardino opened 3 months ago

jonasbardino commented 3 months ago

This is as proposed in relation to PR43 and the fallout it caused regarding build errors and races in launch from pristine clone e.g. when running in the existing CI.

Introduces the shared volume pre-init container to eliminate start-up races.

Uses env variables to allow flexible vgrid_files_readonly and mig_system_run locations, in order to hopefully address the needs originally motivating PR43.

Bjarke42 commented 2 months ago

@jonasbardino I have not tried to implement this into my system, but it get an error.

ERROR: for migrid  Cannot create container for service migrid: invalid mount config for type "bind": field Source must not be empty

ERROR: for migrid  Cannot create container for service migrid: invalid mount config for type "bind": field Source must not be empty
ERROR: Encountered errors while bringing up the project.

my volumes for migrid is the following in docker-compose.override.yml

migrid:
    volumes:
      - ../au-overlay/erda-test2/skin/erda-ucph-science:/home/mig/mig/images/skin/erda-ucph-science:ro
      - ../au-overlay/erda-test2/skin/icons:/home/mig/mig/images/icons:ro
      - type: volume
        source: state
        target: /home/mig/state
      - type: bind
        source: /mnt/erda-x/erda-test2/vgrid_files_writable
        target: /home/mig/state/vgrid_files_readonly
        read_only: true
      - type: bind
        source: /mnt/erda-x/erda-test2/mig_system_run
        target: /home/mig/state/mig_system_run
jonasbardino commented 2 months ago

Can you please verify that you don't end up with a source that has empty value as the error message seems to indicate? One plausible cause could be an empty env value used es source. E.g. in the new

      - type: bind
        source: ${VGRID_FILES_WRITABLE}
jonasbardino commented 2 months ago

You can find good hints about suitable values for the three new bind source-related variables in production.env from line 158 to 180.

Bjarke42 commented 2 months ago

When you introduce variables into docker-compose, then i cannot override them, so it does not make any sense to have docker-compose.override, but that leaves me with alot of problems with the other stuff already in my docker-compose.override.

jonasbardino commented 2 months ago

I'm not sure I understand why you'd want to have docker-compose overrides for values that you can already configure in env. Doesn't it give you the necessary flexibility to 'just' specify your custom locations there?

Bjarke42 commented 2 months ago

This is my current docker-compose.override I also have links for settingup skins and icons in migrid.