{"id":18192002,"url":"https://github.com/codekow/s2i-dash","last_synced_at":"2025-04-02T08:31:04.573Z","repository":{"id":45678142,"uuid":"514013429","full_name":"codekow/s2i-dash","owner":"codekow","description":"Source 2 Image Dash (Plotly) Example","archived":false,"fork":false,"pushed_at":"2024-05-30T17:28:19.000Z","size":68,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T16:51:47.100Z","etag":null,"topics":["dash","openshift","plotly-dash","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codekow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-14T18:48:36.000Z","updated_at":"2024-05-30T17:28:22.000Z","dependencies_parsed_at":"2024-05-29T16:03:24.067Z","dependency_job_id":"30e4be8f-398f-44dc-84b0-e59765346152","html_url":"https://github.com/codekow/s2i-dash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekow%2Fs2i-dash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekow%2Fs2i-dash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekow%2Fs2i-dash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekow%2Fs2i-dash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codekow","download_url":"https://codeload.github.com/codekow/s2i-dash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781997,"owners_count":20832951,"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","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":["dash","openshift","plotly-dash","python"],"created_at":"2024-11-03T06:41:59.477Z","updated_at":"2025-04-02T08:31:04.180Z","avatar_url":"https://github.com/codekow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example Dash OpenShift / s2i Repo\n\nThis is meant to be a good starting point for creating Dash applications that are deployed to OpenShift.\n\nOpen an issue or PR if the explanations below are inadequate, and we can help get you up to speed! :thumbsup:\n\n## How to use this repo to build your own application\n\n1. Fork this repository into your own Git repo\n    - This will create a copy that you will own\n2. Log into OpenShift\n2. Select the project in which you want to add an application\n    - There will be a dropdown of projects you have permissions to\n3. Go to the catalog and select 'python' to create a new python application\n4. Enter the app name and the URL for the app's repository (from step #1),\n5. Click 'Create'\n\n## Local development\n\nSetup virtual environment\n\n```sh\npython -m venv venv\n. ./venv/bin/activate\n\npip install -U pip\npip install -r requirements.txt\n```\n\nRun w/ python `_main_`\n\n```sh\npython wsgi.py\n```\n\nOR\n\nRun w/ `gunicorn` (s2i python container does this)\n\n```sh\ngunicorn wsgi:application -c config.py\n```\n\nAccess via \u003chttp://localhost:8080/\u003e\n\n## WSGI / gunicorn\n\nThis sample Python application relies on the support provided by the default S2I builder for deploying a WSGI application using the ``gunicorn`` WSGI server. The requirements which need to be satisfied for this to work are:\n\n- The WSGI application code file needs to be named ``wsgi.py``.\n- The WSGI application entry point within the code file needs to be named ``application``.\n- The ``gunicorn`` package must be listed in the ``requirements.txt`` file for ``pip``.\n\nIn addition, the ``.s2i/environment`` file has been created to allow environment variables to be set to override the behavior of the default S2I builder for Python.\n\n- The environment variable ``APP_CONFIG`` has been set to declare the name of the config file for ``gunicorn``.\n\nSee \u003chttps://github.com/OpenShiftDemos/os-sample-python\u003e\n\n## More information about this project\n\nThis repo contains an example dash application that can be deployed to OpenShift using Source to Image (S2I). Here are the main files:\n\n1. The Dash Application (learn about Dash [HERE](https://dash.plotly.com/) )\n\n    - `wsgi.py`;  main application, to be run by gunicorn\n\n    - `app/model.py`;  an optional file, to demonstrate how to modularize code\n\n    - `app/layout.py`;  an optional file, to demonstrate how to modularize code\n\n2. The S2I environment variables. Used to setup additional environment varibles (ex: setup packages using a Nexus repository)\n\n    - `.s2i/environment`\n\n3. This file should contain the dependencies that your application needs to run, and those dependencies should be 'pinned' to a version.\n\n    - `requirements.txt`\n\n    One way to create a requirements file for your application is by running the following:\n\n    ```\n    pip freeze \u003e requirements.txt\n    ```\n\n#### How it works\n\nThe file `wsgi.py` contains the instructions for python to run Dash.\n\nIt relies on `app/model.py` to run calculations on some data, and on `app/layout.py` to return a plotly figure that can be shown by the application.\n\nWhen s2i builds the container, it will look into `.s2i` for additional instructions, including environment variables for installing packages with `pip`.\n\n## Links\n\n- [Python s2i examples](https://github.com/sclorg/s2i-python-container/tree/master/examples)\n- [Dash (Plotly)](https://dash.plotly.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodekow%2Fs2i-dash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodekow%2Fs2i-dash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodekow%2Fs2i-dash/lists"}