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

decide on mount vs recursive copy #2

Open
HenryGeorgist opened this issue Mar 8, 2024 · 1 comment
Open

decide on mount vs recursive copy #2

HenryGeorgist opened this issue Mar 8, 2024 · 1 comment

Comments

@HenryGeorgist
Copy link

two approaches for minio have been proposed:

  1. mounting a local directory for payloads and model data
  2. recursively copying local data into minio

for 1, a developer can make a local change and see it in minio, which is useful.
for 2, the workflow keeps the local copy pristine, only making edits in the minio instance, allowing for the developer to take down minio and relaunch it removing any edits a plugin may have made. it requires remembering to restart minio if you want a local file change to be up in the minio instance, but it does provide a benefit of starting from a clean slate each time.

@HenryGeorgist
Copy link
Author

HenryGeorgist commented Mar 8, 2024

recursive copy example docker compose file

version: '3'
services:
  minio:
    container_name: s3
    image: minio/minio
    environment:
      - MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE
      - MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    command: server /data --console-address ":9001"
    ports:
      - '9000:9000'
      - '9001:9001'
  # configure minio on startup (create buckets, etc)
  # inspired by https://github.com/minio/minio/issues/4769
  # and         https://gist.github.com/haxoza/22afe7cc4a9da7e8bdc09aad393a99cc
  minio_init:
    container_name: s3_init
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc config host add minio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
      /usr/bin/mc rb --force  minio/model-library;
      /usr/bin/mc mb minio/model-library;
      /usr/bin/mc policy set public minio/model-library;
      /usr/bin/mc cp --recursive /models/ minio/model-library/;
      /usr/bin/mc rb --force  minio/cc-store;
      /usr/bin/mc mb minio/cc-store;
      /usr/bin/mc policy set public minio/cc-store;
      /usr/bin/mc cp --recursive /payloads/ minio/cc-store/cc_store/;
      exit 0;
      "
    volumes:
      - ./models:/models
      - ./payloads:/payloads

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

No branches or pull requests

1 participant