{"id":22147277,"url":"https://github.com/centerforopenscience/modular-file-renderer","last_synced_at":"2025-09-05T02:12:45.660Z","repository":{"id":816843,"uuid":"13421446","full_name":"CenterForOpenScience/modular-file-renderer","owner":"CenterForOpenScience","description":"A Python package for rendering files to HTML via an embeddable iframe","archived":false,"fork":false,"pushed_at":"2025-08-17T13:35:46.000Z","size":47434,"stargazers_count":46,"open_issues_count":36,"forks_count":73,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2025-08-17T15:24:16.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://modular-file-renderer.readthedocs.io/en/latest/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CenterForOpenScience.png","metadata":{"files":{"readme":"README-docker-compose.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"supportedextensions.md","governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-10-08T18:11:00.000Z","updated_at":"2025-04-25T19:13:00.000Z","dependencies_parsed_at":"2025-05-26T03:12:00.870Z","dependency_job_id":"e79501e5-de64-4afb-b75f-a8e5f5c0a575","html_url":"https://github.com/CenterForOpenScience/modular-file-renderer","commit_stats":null,"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"purl":"pkg:github/CenterForOpenScience/modular-file-renderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2Fmodular-file-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2Fmodular-file-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2Fmodular-file-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2Fmodular-file-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CenterForOpenScience","download_url":"https://codeload.github.com/CenterForOpenScience/modular-file-renderer/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2Fmodular-file-renderer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273699712,"owners_count":25152286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T23:15:47.557Z","updated_at":"2025-09-05T02:12:45.639Z","avatar_url":"https://github.com/CenterForOpenScience.png","language":"JavaScript","readme":"# MFR docker-compose README\nNote: These instructions are for running with the [Open Science Framework](https://github.com/CenterForOpenScience/osf.io/) (OSF) and its docker-compose setup.  [Check here](https://github.com/CenterForOpenScience/osf.io/blob/develop/README-docker-compose.md) for more info on working with docker/docker-compose/docker-sync. \n\n## Adding new extensions\nWhen adding a new extension you will need to add it properly in `setup.py` and then run a `invoke install`.\n\n* In `setup.py` add your new extension in the form of:\n```python\n'\u003cextension-name\u003e = mfr.extensions.\u003cextension-name\u003e:\u003crenderer-or-exporter-name\u003e',\n```\n\n* Make sure you place it under the correct `mfr.exporters` or `mfr.renderers` section.\n\n* Check that your docker-sync is running.\n\n* If you are not in your MFR `virtualenv`, bring it up.\n\n* Run:\n\n```bash\ninvoke install\n```\n\n* This will build your `mfr.egg-info` folder and add the new entrypoints.\n\n## Building a new image\nWhen working on an exporter or renderer, you may need a third party library to export certain file types. In order to do this easily you will need to edit the `Dockerfile` and rebuild your image.\n\nExample Dockerfile changes\n```bash\nRUN apt-get update \\\n    # mfr dependencies\n    \u0026\u0026 apt-get install -y \\\n        git \\\n        make \\\n        gcc \\\n        build-essential \\\n        gfortran \\\n        r-base \\\n        \u003cnew program\u003e \\\n```\n\n* You can usually just add the required tool to this list in the dockerfile as above.\n\n* In the same directory as your dockerfile run:\n\n``` bash\ndocker build -t \u003cimage-name\u003e ./\u003e\n```\n* If docker hasn't cached this command recently it will take quite a while to finish.\n\n* In order to use your new image, you will have to change the `docker-compose.yml` file in your copy of the OSF. Comment out the default and add your own.\n\n```bash\n  mfr:\n    image: \u003cimage-name\u003e # quay.io/centerforopenscience/mfr:develop\n    command: invoke server\n    restart: unless-stopped\n    ports:\n      - 7778:7778\n    env_file:\n      - .docker-compose.mfr.env\n    volumes:\n      - mfr_requirements_vol:/usr/local/lib/python3.5\n      - mfr_requirements_local_bin_vol:/usr/local/bin\n    stdin_open: true\n```\n\n* Running `docker-compose up -d` should now bring up MFR based on your new image.\n\n\n## Running mfr_requirements\nWhen you add a new python library to the requirements.txt, you can install it by running the `mfr_requirements` container.\n\n* Make sure you are in your OSF directory.\n\n* Bring up your MFR container with:\n\n```bash\ndocker-compose up --no-deps --force-recreate mfr\n```\n\n* Then run:\n\n```bash\ndocker-compose up mfr_requirements\n```\n\n* Sometimes the requirements will get stuck. Restarting the container, docker, or trying again can help.\n\n\n## Manually installing packages and programs in a docker container\nWhile not always the best solution, sometimes it can be useful to forgo running mfr_requirements or building an image. When this is the case, you can exec into a docker container directly and install them. This is mostly useful for testing/updating packages.\n\n* Find your container ID:\n\n```bash\ndocker ps | grep mfr\n```\n* Usually you only need the first 3 characters of the id.\n\n* Exec into the container:\n\n```bash\ndocker-exec -ti \u003cid\u003e bash\n```\n\n* Once inside the container run your command. If you are using pip, just pip install your required package. If you need to `apt-get install` something, run `apt-get update` and then you can install the package you need.\n\n## Logging information\nYou can create a logger and use it to report whatever information you want.\n\n* In your python file import logging and create a logger.\n\n```python\n  import logging\n  logger = logging.getLogger(__name__)\n```\n\n* You can now log with the command `logger.info`.\n\n```python\nname = 'log me!'\nlogger.info(name)\n```\n\n* To find the log, use `docker-compose logs -f --tail 1000 mfr` or recreate the container and leave it attached to your terminal. IE `docker-compose up --no-deps --no-recreate mfr`.\n\n* Make sure you remove your debugging statements before committing.\n\n## Docker is not syncing correctly\nIf your docker is not syncing correctly, most of the time it can be one of a few problems.\n\n* Make sure your `docker-sync.yml` and `docker-compose.override.yml` files are set up correctly.\n\n* Run `docker-sync clean`\n\n## Setting up Keen logging in MFR or Waterbutler.\n\n* Go to https://keen.io/ and make an account.\n\n* Locate your unique logging key and ID after making a project.\n\n* Add your keys [here](https://github.com/CenterForOpenScience/waterbutler/blob/develop/waterbutler/settings.py). It should look something like this:\n\n```python\nKEEN_PRIVATE_PROJECT_ID = keen_private_config.get_nullable('PROJECT_ID', \u003cYOUR_ID_HERE\u003e)\nKEEN_PRIVATE_WRITE_KEY = keen_private_config.get_nullable('WRITE_KEY', \u003cYOUR_KEY_HERE\u003e)\n```\n\n* Restart MFR and download a file. Information should appear on your Keen stream.\n\n## Setting up Sentry logging in MFR or Waterbutler.\n\n* Go to https://sentry.io/welcome/ and create an account.\n\n* Make a python project and get your unique url.\n\n* Add your keys [here](https://github.com/CenterForOpenScience/waterbutler/blob/develop/waterbutler/settings.py).\nIt should look something like this:\n\n```python\nSENTRY_DSN = config.get_nullable('SENTRY_DSN', \u003cYOUR_SENTRY_URL_HERE\u003e)\n```\n\n* Trigger an error in MFR or in Waterbutler and make sure it is logged correctly to Sentry. \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenterforopenscience%2Fmodular-file-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenterforopenscience%2Fmodular-file-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenterforopenscience%2Fmodular-file-renderer/lists"}